Correct Way to expand ZFS?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Albert Yang

Member
Oct 26, 2017
72
1
8
30
Hi
I was wondering if someone could shed currently wanted to know whats the correct way to expand a zfs pool these are the steps i normally take

Code:
apt-get install parted
zpool set autoexpand=on data2
then i delete the partition 9 not sure why i have to run it twice as the first time fails

Code:
root@dockers:~# parted /dev/sdb rm 9
Warning: Not all of the space available to /dev/sdc appears to be used, you can fix the GPT to use all of the space (an extra 104857600 blocks) or continue with the current setting?
parted: invalid token: 9                                                 
Fix/Ignore? fix                                                           
Error: primary partition table array CRC mismatch
root@dockers:~# parted /dev/sdb rm 9                                     
Information: You may need to update /etc/fstab.
then
Code:
parted /dev/sdb resizepart 1 100%
zpool online -e data2 /dev/sdb
i do see that it expands but i find it odd the delete portion part
 

Albert Yang

Member
Oct 26, 2017
72
1
8
30
thanks for the reply, so there is no need to delete part 9 ?
forgot to mention im doing it on a test server VM

in the VM i have zfs raid 0 with 1 virtual disk.

then i turn off the vm i expand the disk start the vm again

so all i would need to do would be zpool set autoexpand=on pool

Thank you
 

TRACKER

Active Member
Jan 14, 2019
178
55
28
In case you've allocated the whole disk for ZFS (not only one partition) and parameters, mentioned by Gea are in place, then during import of the pool new size will be reflected.