FreeNAS on VMware Expand Single Disk ZFS

First, turn off CIFS and any other sharing services to prevent users from attaching to shares during this operation, in order to freeze the data for backup.

Back up the entire ZFS pool and child pools by adding a second hard disk and using ZFS send/receive (or using the backup of your choice).

Unmount and export the filesystem (and all child filesystems):

# zfs umount -f /mnt/zpool0
# zpool export zpool0

Check the status of the partition table (and recover if necessary, in my case no recovery required):

# gpart status da1
# gpart recover da1

Resize the zfs partition (in this case, 2):

# gpart show da1
=> 34 3221225405 da1 GPT (1.5T)
34 94 - free - (47k)
128 4194304 1 freebsd-swap (2.0G)
4194432 2143289176 2 freebsd-zfs (1T)
2147483608 1073741831 - free - (512G)

# gpart resize -i 2 da1
da1p2 resized

# gpart show da1
=> 34 3221225405 da1 GPT (1.5T)
34 94 - free - (47k)
128 4194304 1 freebsd-swap (2.0G)
4194432 3217031007 2 freebsd-zfs (1.5T)

Import and expand the pool:

# zpool import zpool0 
# zpool set autoexpand=on zpool0
# zpool online -e zpool0 gptid/59d5cb05-12d6-11e4-ab90-000c2940e763

 

Reboot, restart sharing services, and if all went well, delete the backup drive.

Leave a Reply