how to add a drive to a FreeBSD installation
September 16th, 2007

This procedure details how to add a hard disk to an existing FreeBSD installation. I had a spare drive, I wanted to install it so I could cd to it, make directories, copy files to it, etc.

  1. install hard drive into the computer (ensure to set jumpers correctly)
  2. ensure BIOS can see the drive correctly
  3. boot FreeBSD
  4. login as root
  5. run dmesg
  6. note the devicename given to the new drive - it should be visible at the end of the dmesg output (eg. ad1)
  7. (optional) run fdisk devicename see the existing partitions on the drive
  8. run sysinstall
  9. select Configure, then select Fdisk
  10. select the drive to work with (the devicename noted earlier will be listed here)
  11. press A to erase all existing partitions and allocate all the space to FreeBSD
  12. press W to write the new partition table to the disk (all data on the drive will be lost at this point) [accept warning if prompted]
  13. press Esc to select None - leave MBR untouched (unless you have reasons for doing otherwise)
  14. press Q, then select OK to quit Fdisk
  15. select Label
  16. press C to create a new FreeBSD slice
  17. define the size of the slice (press Enter to accept the default maximum size)
  18. select FS (filesystem)
  19. specify a mountpoint (eg. /mnt/ad1) - this is the path to the new drive
  20. press W to write the slice to disk [accept warning if prompted]
  21. press Q to quit the label editor
  22. press Esc, Esc, and Esc to exit back to the command prompt

The drive will then be available for use, in /mnt/ad1. It will also be listed in the output of the df command.

Notes: