LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2007, 09:20 PM   #1
djeikyb
Member
 
Registered: Nov 2005
Location: California
Distribution: ubuntu 10
Posts: 162

Rep: Reputation: 33
How do I accurately copy files?


I need to repartition my hard drives without losing any important data. My current partitioning scheme is wasting gigs of space, mostly because I've changed my primary OS a few times in the last year or so, like to keep a few versions of Windows around, and install new flavours of Linux when the urge strikes. In any case, I need to shuffle data. Circumstances demand WinXP is my main OS. I don't trust Windows to properly copy massive quantities of files across devices. I've tried it before, and always end up with missing, and sometimes corrupted, files. I'm hoping linux is more reliable. However, I'm still more or less a noob.

I tried "cp -Rv /source/* /destination". I think it worked, but I can't tell for sure. I expected the checksums to match, but no such luck:
Code:
$ls -s /source > data0
$ls -s /destination > data1
$md5sum data0
asfsa;dlkfaslkf
$md5sum data1
234-r89qwer-98
Looking at the contents of data0 and data1, the file sizes are similar, but not exact. This is probably okay, right? But now I'm paranoid. I'd really like a transfer method I can efficiently (lazily) and accurately verify.

DD looks useful, but I'm wary, especially after reading the lq tutorial on it. Destination partition is way bigger than source partition.* And how will I verify its success? Will I run into the same problems?

I decided I'd tar/bzip2 my files with cygwin. Tarring fifty gigs apparently takes a while. In retrospect, the bzip2 was unnecessary, as this set of files are compressed audio.
Code:
$tar -cvvf /destination/archive.tar.bz2 /source/
tar: Error exit delayed from previous errors
$cd /destination
$tar -xvvjf music-archive.tar.bz2
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error exit delayed from previous errors
I scrolled up as far as I could, and didn't see any errors, and the tar file looks the right size.


*I plan on using gparted to make Destination partition even bigger once I degunk more of that drive. Hopefully someone will tell me now if using gparted to extend a fat32 partition will destroy all its data.

By the way, can Windows really only use fat and ntfs? Is it simply a matter of "no one has done it yet"?
 
Old 12-22-2007, 09:51 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Use "cp -a ..." that way it preserves any links. I use it all the time (and nothing else) to move systems around.
Do it from a liveCD - that way you don't have to worry about the pseudo filesystems (/dev, /proc, things like that).

Easy.
 
Old 12-23-2007, 05:30 AM   #3
lin_myworld
Member
 
Registered: Oct 2007
Location: India
Distribution: Ubuntu 8.04
Posts: 93

Rep: Reputation: 15
use the dd command it is best...
 
Old 01-24-2008, 01:07 AM   #4
djeikyb
Member
 
Registered: Nov 2005
Location: California
Distribution: ubuntu 10
Posts: 162

Original Poster
Rep: Reputation: 33
Just for the record, I eventually bought another hard drive and used an Ubuntu livecd to rsync my data. Unlike cp, the transfer was perfect enough for checksums.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Can Linux Adoption Ever be Accurately Gauged? LXer Syndicated Linux News 0 07-09-2007 02:31 PM
Command to copy files/folders but skip bad/corrupt files?? leemoreau Linux - Newbie 2 04-02-2007 03:27 PM
Mepis, copy files to thumb drive, files deleted? vremenno Linux - Newbie 6 09-16-2006 12:21 AM
accurately measure time rasselin Programming 1 09-05-2003 06:18 PM
how to accurately measure processing time rasselin Programming 3 09-01-2003 12:45 PM


All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration