[lug] Moving / partition to a new disk
Elyse M. Grasso
emgrasso at data-raptors.com
Fri Dec 10 06:44:21 MST 2004
On Thursday 09 December 2004 11:16 pm, Michael Kahn wrote:
> I did this wrong once and it cost me hours to untangle the mess.
> I am hoping that by posting first, I'll avoid a repeat.
>
> I wish to transfer an entire / directory structure from
> a partition on an old disk drive to a new partition on
> a new disk drive.
>
> The first time around, I did a cp -R * and then promptly
> erased the old partition. **BIG MISTAKE** as cp -R is
> not faithful about owners/groups/symbolic links and all
> the other "small stuff" that made the new root partition
> useless.
>
> So, what is the magical collection of command switches
> that would ensure that the copy into the new partition
> creates a faithful copy of the old partition's file
> structure? Since the new partition size will be larger than
> the old partition, I am not seeking a sector-by-sector image
> type of copy.
>
> Of course, this time around I won't be so quick to erase the
> old partition until I am sure that the copy does the right thing.
>
> Thanks in advance.
>
> Michael Kahn
> mkahn at fast-track.com
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us portf67 channel=#colug
>
I'm partial to
find . -depth -print |cpio -pdumv <newlocation>
it's not fast, but it's thorough. You may need more params on the find if you
need to handle symbolic links, and newlocation needs to exist. I believe
there are ways to do this through tar, also, but this works for me. (I
learned this incantation at AT&T in the late 80s, and their version of UNIX
didn't have tar)
--
Elyse Grasso
http://www.data-raptors.com Computers and Technology
http://www.astraltrading.com Divination and Science Fiction
More information about the LUG
mailing list