FreeBSD and USB Drive automount

If you want to use USB drive for backup, it’s super easy to use it as an additional storage space.

1. Locate your drive using dmesg

da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0:  Fixed Direct Access SPC-4 SCSI device
da0: Serial Number ####
da0: 40.000MB/s transfers
da0: 953837MB (1953458176 512 byte sectors: 255H 63S/T 121597C)
da0: quirks=0x2

2. I assume that you have clean drive, so I suggest to use newfs to create UFS on your drive

# create file system
newfs /dev/da0s1

# give it a label
# this way, your disk will be visible via /dev/ufs/my_backup
tunefs -L my_backup /dev/da0s1

3. Make sure to create mount point

mkdir /media/my_backup

4. Create mount definition inside /etc/fstab

/dev/ufs/my_backup /media/my_backup  ufs  rw  0  0

5. Make sure to mount the location and create space for the users

mount /media/my_backup
mkdir -p /media/my_backup/some_user
chown some_user:some_user /media/my_backup/some_user

That’s it.