On Sat, Oct 23, 1999 at 12:32:34AM -0700, Eric L. Damron wrote:
> I want to move the home directory away from my system disk onto a larger
> disk.  What files to I need to edit to make everything point to the right
> things?

        (We'll assume /dev/hdb2 is the new partition)

First, create the new partition and format it.

        fdisk /dev/hdb
                n
                2
                w
        mke2fs /dev/hdb2

Second, mount the partition somewhere.

        mkdir /mnt/new-home
        mount /dev/hdb2 /mnt/new-home

Third, copy the existing /home directories to the new drive.

        cp -a /home/* /mnt/new-home/.

Fourth, unmount the new partition.

        umount /mnt/new-home

Fourth, edit /etc/fstab to reflect the new mount point.

        /dev/hdb2    /home    ext2    defaults    1   1

Fifth, test the new partition to ensure the copy worked well.

        mount /home

If everything looks okay, we're all set (almost).  If things are wrong, just
unmount the filesystem, you've still got all of your old /home stuff
available to make another pass at the copying.

Sixth, clean up and go!

        umount /home
        rm -rf /home

                # this step may seem odd, but it's really true.
                # When you mount the new /home partition, anything that
                # was on the old /home will still be using disk space,
                # but you won't be able to get to it.
                # You want to remove it so you get the disk space back.

        mount /home

Good luck!
-- 
Steve Philp
Network Administrator
Advance Packaging Corporation
[EMAIL PROTECTED]

Reply via email to