hacker / welder / mechanic / carpenter / photographer / musician / writer / teacher / student

Musings of an Earth-bound carbon-based life form.

2 min read

Growing your FreeNAS USB root partition

I needed to upgrade the USB storage in my FreeNAS machine as, I was unable to update to the latest version without having more free space (my original 4GB flash drive wasn’t cutting it anymore…)

freenas# df -h
Filesystem                          Size    Used   Avail Capacity  Mounted on
freenas-boot/ROOT/Corral-RELEASE    3.3G    1.1G    2.2G    34%    /

Attach a new USB drive…

freenas# zpool attach freenas-boot d0p2 d1p2

Check the status …

freenas# zpool status
  pool: freenas-boot
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
    continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Mon Jun 12 15:24:36 2017
        3.09G scanned out of 4.99G at 774K/s, 0h42m to go
        3.09G resilvered, 61.89% done
config:

    NAME        STATE     READ WRITE CKSUM
    freenas-boot  ONLINE     0     0     0
      mirror-0  ONLINE       0     0     0
        da0p2   ONLINE       0     0     0
        da1p2   ONLINE       0     0     0  (resilvering)

errors: No known data errors

… get some coffee or something …

freenas# zpool status
  pool: freenas-boot
 state: ONLINE
  scan: resilvered 4.97G in 2h2m with 0 errors on Mon Jun 12 17:27:21 2017
config:

	NAME        STATE     READ WRITE CKSUM
	freenas-boot  ONLINE     0     0     0
	  mirror-0  ONLINE       0     0     0
	    da0p2   ONLINE       0     0     0
	    da1p2   ONLINE       0     0     0

errors: No known data errors

… detach the old disk …

freenas# zpool detach freenas-boot d0p2

… wait a bit …

freenas# zpool status
  pool: freenas-boot
 state: ONLINE
  scan: resilvered 4.97G in 2h2m with 0 errors on Mon Jun 12 17:27:21 2017
config:

    NAME        STATE     READ WRITE CKSUM
    freenas-boot  ONLINE     0     0     0
      da1p2     ONLINE       0     0     0

… check the size …

freenas# df -sh
Filesystem                          Size    Used   Avail Capacity  Mounted on
freenas-boot/ROOT/Corral-RELEASE    3.3G    1.1G    2.2G    34%    /

Hmm, it is still the same size; let’s extend it!

zpool online -e freenas-boot

… and check again!

freenas# df -h
Filesystem                          Size    Used   Avail Capacity  Mounted on
freenas-boot/ROOT/Corral-RELEASE     26G    1.1G     24G     4%    /

Much better! Don’t forget to update the boot signature…

gpart bootcode -b /tmp/zroot/boot/pmbr -p /boot/gptzfsboot -i 1 da1