Expanding FreeNAS 9.3 ZFS Pool (vmware)

Status
Not open for further replies.

giox069

Dabbler
Joined
Jun 1, 2012
Messages
28
I'm using FreeNAS 9.3 under VMware ESXi 5.5.
In FreeNAS I have a single ZFS pool (created via the WEB GUI) on a single 5TB VMware virtual disk (/dev/da1).

Now the vmware disk has been expanded to 7TB, but I cannot find the right way to tell FreeNAS to use the extra 2TB.

I have found an old post, but they are not really speaking about FreeNAS.
I tried with the two suggested command (gpart recover + gpart resize), but I'm unable to complete the resize:

[root@sxgraf] /mnt/vol1/dati2# gpart show da1
=> 34 10737438653 da1 GPT (7.0T) [CORRUPT]
34 94 - free - (47k)
128 4194304 1 freebsd-swap (2.0G)
4194432 10733244255 2 freebsd-zfs (5T)

[root@sxgraf] /mnt/vol1/dati2# gpart recover /dev/da1
da1 recovered
[root@sxgraf] /mnt/vol1/dati2# gpart show da1
=> 34 15032401853 da1 GPT (7.0T)
34 94 - free - (47k)
128 4194304 1 freebsd-swap (2.0G)
4194432 10733244255 2 freebsd-zfs (5T)
10737438687 4294963200 - free - (2T)


Recover seems to be completed correctly. Now the resize part:

[root@sxgraf] /mnt/vol1/dati2# gpart resize -i 2 /dev/da1
gpart: Device busy


What should I do now ?

Thank you in advance.
 

giox069

Dabbler
Joined
Jun 1, 2012
Messages
28
Thank you for answering. Here is the output

[root@ssgraf] ~# zpool get autoexpand
NAME PROPERTY VALUE SOURCE
freenas-boot autoexpand off default
vol1 autoexpand on local

[root@ssgraf] ~# gpart status da1
Name Status Components
da1p1 OK da1
da1p2 OK da1

[root@ssgraf] ~# gpart resize -i 2 da1
gpart: Device busy

It seems that the second partition is in some way "busy". Sholud unmount the vol1 volume ? How ?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
In the 2nd link i posted they do an export, some gpart commands (including the resize), and then import. Did you export before doing your gpart stuff?

(I'm really not an expert on this, just found the reference above.)
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You do know using zfs like this is unsupported and won't keep your data safe. You might want to read some documentation. Good luck with expanding your disk.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Why bother expanding the 5TB drive. Just stripe in a second 2TB drive. It's not like the storage is any less tolerant against vmware drive failure.
 

giox069

Dabbler
Joined
Jun 1, 2012
Messages
28
@todman: I tried to "zpool export" and "zpool unmount" from the commandline as suggested on the second link, but they failed both due to the fact that the volume was busy (some files were open by smbd and afpd, the System Dataset of freenas was keeping it locked).
After moving away the system dataset and stopping afpd/samba, I was able to export the volume via the commandline, expand it (gpart + zpool online -e) and reimport.
But... that's a wrong procedure: exporting and importing the zfs pool via the commandline makes FreeNAS no longer recognize it.
The correct procedure is NOT exporting via commandline, but using the button "Detach volume" on FreeNAS web interface, without enabling both checkboxes. Luckily I have been able to use the gui even after my wrong export/import procedure, and now Freenas can correctly mount my expanded volume.
If you like, I can repeat it in a test environment and post a full guide for resizing here :)

For other people: yes, I can see that in FreeNas resizing is unsupported. But in ZFS is supported. And when the volume is detached, FreeNAS is no longer the responsible of the volime. It's a zfs problem now :)
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
If this is a production environment, I hope you have good backups.... Your system is totally and completely against the way freenas expects to be operated
 
Status
Not open for further replies.
Top