# expand ZFS partition at the front



## longneck (Dec 24, 2011)

I have no idea how this happened but I have a ZFS pool where each disk in the pool has partition 2 allocated to ZFS. Partition 1 is a 2 GB swap space. I wanted ZFS to use the whole device.

The only way I can think of to fix the problem is to offline each vdev and replace it with that same drive, allowing ZFS to resilver each time.

Anyone have a better idea?


----------



## phoenix (Dec 24, 2011)

That's the only way.

Offline the disk.

Repartition the disk as needed.

"zpool replace" the disk in the pool.

Wait for it to resilver.

Rinse and repeat for each disk.

But, is it really worth the effort to reclaim 2 GB?


----------



## longneck (Dec 25, 2011)

You're right, it's not worth the effort to reclaim 2 gig from each drive. But I'm not doing this on a practical setup. I'm just learning about ZFS and am curious if it would be possible.

Theoretically, it should be possible, right? Just move the root node and adjust the pointers on all of the other nodes.


----------



## phoenix (Jan 1, 2012)

Heh, we're still waiting on the mythical "Block Pointer Re-Write" feature that would allow something like that to work.    Should be here any year now ...


----------

