This page looks best with JavaScript enabled

Adding a ZFS zpool using a label

 ·  🎃 kr0m

First, identify the disk to be added:

camcontrol devlist

<WD 0524AS External 1.75>          at scbus6 target 0 lun 0 (da0,pass2)

We assign a label since it is a USB external disk and can be detected as a different device each time it is connected. This way we can create the zfs pool and it will always work:

glabel label -v storage /dev/da0
zpool create storage /dev/label/storage
zpool status

  pool: storage
 state: ONLINE
  scan: none requested
config:
    NAME             STATE     READ WRITE CKSUM
    storage          ONLINE       0     0     0
      label/storage  ONLINE       0     0     0

errors: No known data errors

We can see how it has been mounted in /storage:

df -h /storage

Filesystem    Size    Used   Avail Capacity  Mounted on
storage       899G     37G    862G     4%    /storage
If you liked the article, you can treat me to a RedBull here