how to upgrade a drive in a FreeBSD system
July 2nd, 2008 (as amended)

This procedure details how to upgrade a hard disk in an existing FreeBSD installation. It assumes you already have an existing drive, which contains data that you wish to migrate. This procedure is suitable for data drives only - do NOT use this to upgrade your boot drive!

Below, it's assumed that the drive to be replaced is called /mnt/ad0 and the new drive is called /mnt/ad2

  1. to begin, follow the instuctions under adding a disk
  2. ensure you can see both the old and new drives when you run the df command
  3. ensure you're logged in as root
  4. Now to copy the data. If you're brave, you can migrate all your data at once, however this is not recommended as it will stress your hardware. It's recommended to migrate one directory at a time, leaving some time between directories. This will allow your hardware time to cool. It will also minimise the damage, if you copy the wrong thing to the wrong place. Use this command to copy the "example" directory, and all its subdirectories, from the old drive to the new drive:
    cp -Rpv /mnt/ad0/example /mnt/ad2
  5. repeat the above command for each directory to copy
  6. (optional) test the copied data somehow, if there's a large ZIP file this can be tested for errors
  7. remove the old drive from the system