On 10/21/05, jim scott <jimdscott at gmail.com> wrote:
> I just installed a second hard drive. For now I'm mounting it as
> /mnt/drive2. Everything is working fine. I'd rather mount it as /usr or
> /home, but I'm worried about what will happen to my existing data in those
> paths if suddenly mount the new drive at either of those points. Thanks for
> any advice.
>
> Here's my current config:
> /etc/fstab:
> # This file is edited by fstab-sync - see 'man fstab-sync' for details
> /dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
> LABEL=/boot             /boot                   ext3    defaults        1 2
> /dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
> /dev/hda1       /windows        vfat     users 0 0
> /dev/hdd2       /mnt/drive2     ext2    defaults        1 1
> /dev/hdd1       /mnt/D           vfat    umask=000,rw    0 0
>
> First hard drive
> Disk geometry for /dev/hda: 0.000-12419.056 megabytes
> Disk label type: msdos
> Minor    Start       End     Type      Filesystem  Flags
> 1          0.031   5812.580  primary   fat32       boot
> 2       5812.581   5914.555  primary   ext3
> 3       5914.556  12417.429  primary               lvm
>
>
>  Second hard drive
> Disk geometry for /dev/hdd: 0.000-78167.250 megabytes
> Disk label type: msdos
> Minor    Start       End     Type      Filesystem  Flags
> 1          0.031  39997.771  primary   fat32
> 2      39997.771   78159.990  primary   ext2

Jim - this isn't hard to do at all - I've done it several times w/
very few problems.  For purposes of this example, let's assume that
you're going to be moving /home to the new drive.

1.  You have the new drive mounted as /mnt/drive2 currently, right? 
Make sure there's no data on it that you need and then wipe the
partition clean.
2. Run this command:
    $ rsync -av /home/ /mnt/drive2/
Make sure you run that *exact* command, including the trailing
slashes, otherwise rsync will do funky stuff with your files.  If
you're not familiar with rsync, it's (more or less) an effecient copy
routine.  If an rsync gets interrupted for some reason, you can just
run it again and it'll pick up where it left off.
3. After you get everything copied over, verify that, indeed, all the
data is there, and that is has the correct ownership/mode/etc.  The
"-a" flag of rsync copies in "archive" mode, and it is supposed to
transfer all of that information over.  It never hurts to
double-check, though.
4.  After verifying this info, you can delete the data in your original /home :
    $ cd /home
    $ rm -rf *
If it makes you feel better, and you don't have a huge amount of data
in home you may want to make a second "backup" of the folder:
   $  cd /
   $  tar cvzf /tmp/home-backup.tar.gz /home
5.  Now, once your original /home is empty, unmount your second drive
and remount it as /home:
   $  umount /mnt/drive2
   $  mount /dev/hdd2 /home
6.  Now you need to make the changes to your fstab file...you should
delete the current line that includes /dev/hdd2 and then add a line
like this:

/dev/hdd2               /home           ext2            noatime       
         0 2

That should be about it.  Good luck!

-Erik