changing home directory location

Longman, Bill yellowdog-newbie@lists.terrasoftsolutions.com
Wed, 22 Oct 2003 11:37:32 -0700


> I am currently setting up a YDL G3 on a 20 GB hard drive. 
> Sometime, around a
> month or so from now, I plan on getting a 80 GB hard drive. I 
> want to, when
> the time comes, switch the home folder to this new drive. How 
> hard is this
> to do? How would I go about doing it?

It's pretty straightforward:

Assumptions:
 A - You are only ADDING a new 80GB drive to your system, leaving you with a
20GB system drive and a spiffy new 80GB data drive = 100GB total.
 B - It will be an IDE drive as /dev/hdb
 C - You can become the root user.


General steps:
1 - Install disk
2 - Partition disk
3 - Create file system(s)
4 - Mount it somewhere
5 - Copy the files
6 - Zap the old stuff
7 - Mount the new filesystem over the old directory
8 - Cleanup

Details:
1 - Pop the hood, hook up the wires.
2 - pdisk, c to create a new partition, etc.
3 - mkfs -t ext3 /dev/hdb1
4 - mkdir /boofar; mount /dev/hdb1 /boofar
5 - cd /home; find | cpio -pdumv /boofar
6 - rm -rf .
7 - cd; umount /home; mount /dev/hdb1 /home
8 - edit /etc/fstab so /home is from /dev/hdb1 instead of /dev/hda#
  - rmdir /boofar
  - read up on LVM so you can add the old /home to the new /home

Bill