(1) Install the new drive, as master or slave as appropriate, in a vacant slot on an available IDE-chain in the motherboard. Bring up Linux.
(2) If you're using a current Linux (2.6, with udev), then the device should magically appear in the /dev
directory as /dev/hd[a-d]
depending on the position where you put the drive. (Chain-1 master=hda, slav=hdb; Chain-2 hdc, hdd.)
(3) Use smartctl
to run on-board diagnostics on the drive.
(4) Make a filesystem on the device. I suggest aggressive testing at this point for read-write errors, e.g. #mkfs.ext3 -j -c -c /dev/hd_
(where "_" is the appropriate drive-letter). Make damn sure that you specify the correct drive!
With aggressive testing options, this could easily take all night. Time to get some sleep...
(5) Now use parted
to partition the drive. You might wish to consider putting swap-space here, or an emergency /boot
partition, and so on.
(6) After the process completes, make a temporary mount-point and mount the drive: #mkdir /mnt/newdrive && mount /dev/hd_ /mnt/newdrive
(7) Copy files to the new drive: #rsync --links /usr /mnt/newdrive
. (Use man rsync
to review the many options here!)
(8) Now update /etc/fstab
to mount /usr
as this new drive. Meanwhile, add another entry to point to the old partition; make a mount-point for it in /mnt
as we did earlier (with "newdrive").
(9) Now you can test your changes by unmounting and remounting .. you may need to drop into single-user mode to do this .. or by restarting the system. Have a LiveCD handy and know how to use it
in case you "tpyo" something in the fstab-file and have to edit it.
All of these steps can be done in the background while you do other things, although they will monopolize the disk I/O channels and so the system will be sluggish. The nice
command is useful, especially when you are using rsync
Please read the man pages carefully for all commands mentioned here, before using them!
I suggest that you write down a checklist .. with pencil on a nice legal pad .. before you do anything,
and that you carefully check off each step.