Todd Walton wrote:
> I partitioned my hard drive at something less than optimal.  Now I'd
> like to put /usr on a different partition.  How do I do this?
> 
> I suppose I have to 1) copy the contents of /usr over to the new
> filesystem on the new partition, and 2) tell my filesystem to use
> that.
> 
> So... maybe...
> 
> # mount /dev/sda3 /mnt/newusr
> # cp /usr /mnt/newusr
> # umount /dev/sda3
> # mount /dev/sda3 /usr

I'd do something like this:

# mount /dev/sda3 /mnt
# rsync -vaxHP /usr/. /mnt/.
# umount /mnt
# mount -o bind /usr /mnt
# vi /etc/fstab   /* to add /dev/sda3 to /usr */
# mount /usr
 /* possibly repeat the rsync with  rsync -vaxHP /mnt/. /usr/.

You can then access he old /usr on /mnt, so you can delete it and gain
the free space.

If you can, edit /etc/fstab first then mount / read-only

# vi /etc/fstab
# mount -o remount,ro /
..mount, rsync, umount, mount, rsync..
# mount -o remount,rw /

If you want to be UBER safe, boot into single user mode. That would
likelt be overkill, though.

Whatever you do, have a good, tested backup *first*, _document_ your
steps, then tell us what you did, how you did it, and if it worked as
you expected.

-john


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to