Monday, July 28, 2008

HowTo: Add a new disk to FreeBSD

I needed to add a 120GB IDE drive to my FreeBSD 7.0 install on the old Celeron 266.

Here are the steps:
  1. become superuser
  2. # mkdir /mnt/data
  3. # sysinstall
  4. Choose Configure -> Fdisk
  5. If there are existing partitions press D to delete them
  6. To create a slice press C. To use the entire disk press A
  7. To commit changes press W. A warning pops up, choose YES.
  8. When asked to install a boot manager choose STANDARD
  9. Leave Fdisk by pressing Q
  10. Choose Configure -> Label
  11. Create a new partition by press C. Choose FS.
  12. Type in the mountpoint, e.g. /mnt/data. Take note of the drive device node, e.g. /dev/ad4s1d
  13. Commit changes by pressing W
  14. Exist the sysinstall.
  15. # vi /etc/fstab accordingly, e.g. /dev/sda4s1d /mnt/data ufs rw 2 2 in my case
I essentially used my 120GB drive to be entirely by FreeBSD and mounted under /mnt/data.

Take a look on section 18.3 "Adding disks" of the official FreeBSD Handbook for finner details.

No comments: