This article will document the procedure to setup a second UFS filesystem on a second drive and have it added into your FreeBSD server. Installing a second drive into FreeBSD can be done line without a shutdown. The only reason why you may have to shutdown would be for the physical install of the drive. If you have hot swappable drives (or it’s a VM) then you don’t even have to shutdown for the drive install.
Install the new drive on the server. Make sure the new drive device is seen and you are sure you are working on the new one.
# camcontrol rescan all
# dmesg | grep -i disk
In my case, the drive shows up as da2
Create a new partition scheme on the new drive.
# gpart create -s GPT da2
# gpart show da2
Verify that you can see the new partition scheme.
This is a second drive that we are going to add to the existing server. We want to use the whole disk as one large filesystem. Let’s go ahead and create one large partition that used the whole disk.
# gpart add -t freebsd-ufs -a 1M da2
Format the new drive
# newfs -U /dev/da2p1
Mount the drive where you would like it in your file system.
# mount /dev/da2p1 /mnt/disk
Don’t forget to update /etc/fstab with the new file system so it get’s mounted on boot.