I've used this method several times and it works. I know, there are other ways. To exactly copy directory /original to /target. THe -xdev option on find stops it from following symbolic links.

# mkdir /target

# cd /original

# find . -xdev | cpio -padm /target

(that's the same as same as)

# find /original -xdev | cpio -padm /target

Make the mount point of the new place, do

mount /dev/sdc2 /mnt/sdc2

and then use /mnt/sdc2 as the /target.

I'm open to other suggestions....

That still works in RH9, I just did it to move a root partition. Here are other things worth keeping in mind.

If you create a partition, then format it

/sbin/mkfs -t ext3 /dev/sda2

If you forget to set it ext3, then you can turn an ext2 file system to ext3:

/sbin/tune2fs -j /dev/sda2

To set the label on that partition so that /etc/fstab make sense,

/sbin/e2label /dev/hdbX /mount/point

For a root partition, i did

/sbin/e2label /dev/sdc5 /

and then I changed the label on the old root partition

/sbin/e2label /dev/sda2 /oldroot

To review labels:

/sbin/tune2fs -l /dev/sdc5 |grep volume

-- PaulJohnson - 07 Feb 2003

 
|Powered by TWiki