In the last article, we installed and configured a hardware RAID 1 array in our FreeBSD box, and mounted it temporarily at /mnt. Now, it's time to migrate the home directories over to this drive and mount it at /usr/home.

  1. Copy the current home directories to /mnt.
    Best practice says to do this in single user mode, but I could not figure out what to do to get that working once I was in it. What I did instead was physically go to the machine and log in as root, ensure that I was the only one logged in (by using the w command), and then disconnect the network connection to ensure no one would log in while I copied the files. I then used a carefully crafted set of tar commands, so that all of the file permissions and links would be preserved:
    [root@solstice] ~# tar cpf - -C /usr/home . | tar xpf - -C /mnt
  2. Ensure that the directories copied, and then remove the originals.
    Once the directories are finished copying, run an ls -al on both /usr/home as well as /mnt to ensure they are identical. If they are, you can safely remove the originals:
    [root@solstice] ~# cd /usr/home
    [root@solstice] ~# rm -rf *
  3. Add a line to fstab and reboot.
    To get the new "drive" to mount at /usr/home, you simply need to add one line to your /etc/fstab, and then reboot. As long as your drive or array is located at /dev/twed0s1d, this line is:
    /dev/twed0s1d           /usr/home       ufs     rw              1       1
    Now, simply reboot your system, and when it comes back up, you should notice no change (except for the fact that you and your users have much more space at their disposal).

Stay tuned for the next article - writing a plugin for Nagios so you know if your 3ware RAID array has a fault.