Swapping Drives...

Charles Steinkuehler charles at steinkuehler.net
Mon Jul 21 23:49:53 CDT 2003


Steven Elling wrote:
> On Monday 21 July 2003 12:36, Frank Wiles wrote:
>>   3) mv /oldhome/* /home
> 
> I would do "cp -a /oldhome/* /home" instead just in case something goes 
> wrong during the copy.

"cp -a ..."  Bah!

Does anyone besides me use rsync for this (and does it raise or lower my 
geek quotent that I have to type 3 more characters)?  I usually find 
myself doing the copy more than once, but after the first rsync, it 
really flies!

I've also done this with tar, which I know preserves hardlinks in the 
filesystem.  I don't think the cp command does this, and I'm off-hand 
not sure about rsync.  The easy way to tell if hardlinks are not being 
preserved is the size required by /usr grows dramatically when all the 
localization hardlinks turn into physically seperate files (each taking 
up space on the drive) after a copy.

I've also been know to just dd the entire drive to the new drive (from a 
recovery disk or similar, of course), and then just resize everything 
with a repartitioning tool (this won't work right if the drives don't 
have matching head & sector counts (different # of cylinders is OK), but 
in today's world of LBA drives, it generally works w/o a hitch, since 
the head & sector counts are bogus and typically set to maximum values 
anyway...plus you can override the CHS mapping at boot-time if necessary).

The old drive is then put on a shelf with a post-it note indicating when 
it is safe to re-use (I typically keep the old data around for about 3-4 
months, to make sure everything is really OK, and as a handy backup if 
my fancy new drive suffers an infant mortality problem or something).

-- 
Charles Steinkuehler
charles at steinkuehler.net




More information about the Kclug mailing list