Adding as a second hard drive

Jerry McAllister jerrymc at
Thu Jun 1 19:18:47 PDT 2006

> Yes, I was wondering what the best way was to add a second hard drive to my
> existing FreeBSD system, I searched the Handbook, but cannot find it.

Basic process:

Get a good, that either works with your existing controller or also
get a controller with is.   eg.  If it is SCSI and you only have SATA
you will need another controller, etc.

Install it in the box and boot the machine.

Observe the boot messages or use dmesg to make sure it is recognized
and that you know how the system is identified.  It will probably 
be either da1 or ad1 depending on whether it is SCSI or SATA.

Decide on how you want the new disk divided.

Use fdisk     to create a FreeBSD slice on the disk

Use bsdlabel    (or disklabel for systems and before)
              to create at least one partition within the slice.

Use newfs     to build a filesystem on all of the partitions you create
              with bsdlabel.

create a mount point  (for example   'mkdir /newdsk')

Edit the  /etc/fstab  file to add an entry to make it mount upon boot.

Mount the new disk    (For example   'mount /newdsk' or just  'mount -a')

The man pages for fdisk, bsdlabel and newfs have all the information 
you need but can be a little confusing.   In the bsdlabel man page
there are some examples near the bottom that are good.  They suggest
using  dd to overwrite anything that might preexist in the first sector.
That isn't always needed, but can fix things if that sector is a problem.
Actually, I usually write around the first 100 sectors just for good
measure when I need it.

The only more complicated things are if you want to make more than
one partition and/or slice, and if you want to be able to boot from it.
More slices and partitions amounts to the same, but just require some
calculations.   Making it bootable requires using -B on both fdisk
and bsdlabel.

All this can also be done using sysinstall, but I prefer doing it
straight up with the regular tools.

Read the man pages.

Good luck,


> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list