Expanding ZFS Pool (vmware)

Status
Not open for further replies.

Florian K.

Cadet
Joined
Nov 12, 2013
Messages
1
Hello,

I've searched various forums regarding this subject, tried several suggestions, unfortunately I have not managed to enlarge a pool.

My system:
vmware ESXi 5.0
FreeNAS v.9.1.1 x64 as vm
HDD1: 10GB, FreeNAS installation
HDD2: 50GB, data storage
The second HDD I have expanded to 60GB.Commands such as eg. gpart and zpool did not work.
In the web interface is still 50GB displayed as pool size, or unknown.

Has anyone done this already, is there a working manual for it?

Thanks,
Florian
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Hello,

I've searched various forums regarding this subject, tried several suggestions, unfortunately I have not managed to enlarge a pool.

My system:
vmware ESXi 5.0
FreeNAS v.9.1.1 x64 as vm
HDD1: 10GB, FreeNAS installation
HDD2: 50GB, data storage
The second HDD I have expanded to 60GB.Commands such as eg. gpart and zpool did not work.
In the web interface is still 50GB displayed as pool size, or unknown.

Has anyone done this already, is there a working manual for it?


I encountered the same issue a few days ago as I ran out of space in my VM; I couldn't find a way to extend the exisisting zfs volume even after I increased the size of my disk.
gpart would show the increased disk size; but zfs wouldn't want to know anything about it.

So in the end, I simply created another vdev and added it to the existing pool... for my purpose that was enough.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
This works for me in Virtual Box:
  1. Export the pool in GUI
  2. Shutdown the VM
  3. Grow the VDI (vboxmanage modifyhd ...)
  4. Start the VM
  5. gpart recover /dev/ada1
  6. gpart resize -i 2 /dev/ada1
  7. Auto import the pool in GUI
  8. The pool has still the old size and here comes the magic:
    zpool online tank /dev/gptid/1101faa1-5888-11e3-84eb-0800277c029f
  9. Enjoy your larger pool
In theory importing a pool with with the autoexpand=on property should grow the pool, but it doesn't in this case. I still do not fully understand the reason but "onlining" the already online device does the trick.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You can't expand a disk in a VM the way you did jyavenard. The reason is because a disk wouldn't suddenly "expand" normally without doing a disk replacement. 2TB disks don't suddenly become 3TB disks which is pretty much what you did in the VM. You have to either do a disk replacement procedure in the VM or perhaps do what Dusan recommended.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
This works for me in Virtual Box:
  1. Export the pool in GUI
  2. Shutdown the VM
  3. Grow the VDI (vboxmanage modifyhd ...)
  4. Start the VM
  5. gpart recover /dev/ada1
  6. gpart resize -i 2 /dev/ada1
  7. Auto import the pool in GUI
  8. The pool has still the old size and here comes the magic:
    zpool online tank /dev/gptid/1101faa1-5888-11e3-84eb-0800277c029f
  9. Enjoy your larger pool
In theory importing a pool with with the autoexpand=on property should grow the pool, but it doesn't in this case. I still do not fully understand the reason but "onlining" the already online device does the trick.

hmm... didn't get much luck there:
gpart recover /dev/da1 -> gpart arg0 da1: invalid argument

gpart resize -i 2 /dev/da1 -> gpart: No such geom: /dev/da1

I attempted to do the 2nd online trick anyway; and it didn't seem to do anything... certainly didn't grow my device...

with raidz1 or raidz2 I can simply remove the device; and re-add it: it will then see the bigger size. But if it's a plain single device: not much luck there.

any other ideas?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Was the pool created in the GUI? (i.e. does it use labels/GPTIDs and is there a swap partition?)
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
No to both questions.

It's a FreeBSD 9.2 install.
Zpool was a later addition created using the zpool command. Plain and simple. Used the whole disk
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Oh, the instructions above are for FreeNAS (e.g. gpart -i 2 references the data ZFS partition as the first partition is swap). I'll try it in plain FreeBSD when I find some time.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
It's actually quite easy :). Run zpool online -e tank /dev/da1. FreeNAS sets the autoexpand=on zpool property (it normally defaults to off). It still for some reason doesn't autoexpand in FreeNAS, but it seems the property makes the -e flag not necessary.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
It's actually quite easy :). Run zpool online -e tank /dev/da1. FreeNAS sets the autoexpand=on zpool property (it normally defaults to off). It still for some reason doesn't autoexpand in FreeNAS, but it seems the property makes the -e flag not necessary.


Excellent... That did the trick... thanks.

the originally 10GB drive I had and that I had increased to 20GB was now properly seen by the zpool as a 20GB drive and the pool size got increased accordingly.

Learned something today :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No to both questions.

It's a FreeBSD 9.2 install.
Zpool was a later addition created using the zpool command. Plain and simple. Used the whole disk

Surprise. Not following the FreeNAS manual and it didn't work. Color me surprised!

/facepalm
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Surprise. Not following the FreeNAS manual and it didn't work. Color me surprised!

/facepalm


I sworn not to respond to your bait and constant trolling.. but really...

It's a FreeBSD VM created to make a daily build of freenas as available here:
http://www.avenard.org/files/freenas/nightlies/

it's not freenas, never said it was. And I actually followed the manual on how to build freenas as it clearly states you need a FreeBSD 9.1 and later, and build on a zfs partition.

You never lose the opportunity to shut up and make a fool of yourself..

You can't expand a disk in a VM the way you did jyavenard.

well that was wrong as Dusan pointed out by providing a solution

The reason is because a disk wouldn't suddenly "expand" normally without doing a disk replacement. 2TB disks don't suddenly become 3TB disks which is pretty much what you did in the VM

and that was wrong again...

Luckily, you have people like Dusan who knows their stuff, don't feel like they have to intervene for the sake of it even if they have nothing to add to a conversation, nor need to patronise every single poster here...

so wonder who should facepalm .... sigh...
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't know about you, but your incompetence level is so high I know quite a few people that get a laugh every time you post. So keep up the good work! We all need a good laugh now and then. :)
 
J

jkh

Guest
Guys, guys! Enough, please! I'm not here to take anyone's "side", and in all the threads in which I've seen jyavenard and cyberjock going at it, both parties have frankly chosen not to mince words or make their dislike or disdain for the other anything but manifestly evident, so I don't think anyone's really taking the high road here and that means there is plenty of culpability to go around (as my old teacher used to say: "It takes two to tango!").

I also don't expect everyone on the forums to like one another, especially not when things have gotten personal and allegations of incompetence and/or malfeasance have already been flying around, but I will point out nonetheless that other folks are watching these little exchanges and taking away some fairly uncharitable impressions of not just those doing the arguing but the forums in general. Please keep that in mind (everyone) when you decide to air your grievances in public.

I have also read enough of cyberjock and jyavenard's posts to know that both are into FreeNAS and do, in spite of their personal differences, want the best for the project and genuinely like messing with this kind of tech, so as much as I'm sure you both would fervently deny it, you have more in common than you think. While you have chosen to express yourselves in different ways, I see the same sort of drive and enthusiasm at the core of your participation here, and the fact that cyberjock has been around a lot longer than jyavenard (and is also an administrator here) gives him a bit more responsibility for keeping things on the straight-and-narrow!

Cyberjock: You've tried the vinegar, now how about trying the honey? Try to teach jyavenard rather than judge him, and don't always assume that you need to be first out of the gate in responding - I see Dusan is also participating and that's to be encouraged. I know it requires some extra effort to be patient, and you'd probably rather stick your nuts in a vice than be nice to him, but we all might just be surprised at the results! :)

Thanks,

- Jordan
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
How dare you inject civility into the flamefest... heh
 
Status
Not open for further replies.
Top