[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Copy entire filesystem



On 26 Aug 98 08:16:03 GMT, adavis@netpci.com wrote:

>I have gotten a new, larger harddisk, and wish to use it to expand my
>existing linux box.  I would like to copy the filesystems off the old hard
>disk, and replace it with this one.  
>
>So far I haven't succeeded.  I haven't been able to confine tar's action to
>a single filesystem (so that directories linked to directories on other
>filesystems, on the other system drive, will not be copied.  Included is the
>linux boot filesystem, /dev/hda2.  I basically want the current drive
>duplicated to the new drive, with larger partitions, and another partition.  
>
>When I thought I had it right, and edited /etc/fstab using a rescue disk,
>the disk failed somehow.
>
> My questions are, again, how to copy a filesystem but not it's linked
>directories from other drives, and, second, how to do this whole job
>successfully.  

Try this method, which copies the root filesystem to another partition
(already mounted on /mnt).

cd /
find . -xdev -print | cpio -padm /mnt

This should answer both your questions.  It handles device files okay
and doesn't recurse down other devices (but does copy the mount points
for you).


Rob Wilderspin
--
"But I need it to crash once every few days - 
reboots are the only chance I get to sleep..."
----------------------= (send replies to rob@)


Reply to: