6

Given an installation on a single disk with zfs, how can I shrink the zfs partition/pool so that I can add a new partition to the disk? Other instructions I've seen indicate setting the volsize property on the pool, but doing so gives the following error: cannot set property for 'rpool': 'volsize' does not apply to datasets of this type

$ zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
bpool  1.88G   196M  1.68G        -         -      -    10%  1.00x    ONLINE  -
rpool   228G  10.9G   217G        -         -     2%     4%  1.00x    ONLINE  -
2
+50

Once you add your disk to zfs pool, by default zfs allocates whole disk for usage and it formats the disk using an EFI label to contain a single, large slice. This is recommended way.

It is not possible to shrink size of volume if you have allocated whole disk. You can technically force it to shrink by gparted or some other tool but that will cause problems and you may loose your data or zfs pool might be impacted, so that is not recommended at all.

You can reduce size of particular zfs pool and create new pool from free space. Only way possible to make free some space is you can make disk offline (I hope that you have multiple disks in zfs pool), re-format it and use some space for your desired partition and remaining space allocated to zfs partition for example c150d0. When you add disk back to zfs pool, you need add zfs partition for usage. This is not recommended way but should be counted as workaround. Do it at your own risk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.