6

I found a list of versions and their Solaris release numbers http://download.oracle.com/docs/cd/E19253-01/819-5461/appendixa-1/index.html

I know that you can grow a pool by replacing drives with larger ones or adding new drives or mirrors to the pool. I heard that ZFS did not yet support shrinking pools by removing drives/mirrors. But that has probably been changed.

Which version (if any) released the ability to shrink a pool?

3
  • 2
    A really desired feature if you have disk fail with no ability to find a replacement. In that case some free space can be traded-in to restore the ZRAID redundancy. Apr 12, 2011 at 23:15
  • @Aleksandr: Interesting concept :) You could use free space for redundancy even if there was no failure in disks. You would just have to make sure that the feature will trade in redundancy for extra space if you have too much usage, or if the usage goes up right after a disk failure. (better cap your usage or else it is possible to lose redundancy even without disk failure) (I am glad I am not the programmer making it work!) Apr 12, 2011 at 23:28
  • I suggested to add shrinking facilities for zfsonlinux at github.com/zfsonlinux/zfs/issues/6857. Nov 12, 2017 at 8:54

6 Answers 6

10

No current release can shrink a pool and I have not heard any announcements of an upcoming feature to do so. Considering how rare it is that a properly designed pool would need the ability, I wouldn't expect it anytime soon.

1
  • As @jan pointed out, there some feature in the works, that does at least allow some forms of vdev removal. Nothing released as of yet, but at least an announcement
    – Slizzered
    Apr 10, 2015 at 11:15
4

The new ZFS version in Solaris 11.4 allows shrinkage of arrays. Say you have 5-disk array, you can now shrink to 4-disk array.

And, dedup has been fixed! It is using Greenbyte superior deduplication.

2

I cant find that it is supported, yet anyways.

Here's a printout from my Solaris 11 Express running ZFS pool version 31.

zpool upgrade -v
This system is currently running ZFS pool version 31.

The following versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)    
 3   Hot spares and double parity RAID-Z    
 4   zpool history    
 5   Compression using the gzip algorithm         
 6   bootfs pool property    
 7   Separate intent log devices    
 8   Delegated administration    
 9   refquota and refreservation properties    
 10  Cache devices    
 11  Improved scrub performance    
 12  Snapshot properties    
 13  snapused property    
 14  passthrough-x aclinherit    
 15  user/group space accounting    
 16  stmf property support    
 17  Triple-parity RAID-Z    
 18  Snapshot user holds    
 19  Log device removal    
 20  Compression using zle (zero-length encoding)    
 21  Deduplication    
 22  Received properties    
 23  Slim ZIL    
 24  System attributes    
 25  Improved scrub stats    
 26  Improved snapshot deletion performance    
 27  Improved snapshot creation performance    
 28  Multiple vdev replacements    
 29  RAID-Z/mirror hybrid allocator   
 30  Encryption    
 31  Improved 'zfs list' performance

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.
1

It looks that Alex Reece works on implementing the feature in the OpenZFS project: OpenZFS Device Removal blog.

Thorough ZFS in Solaris and OpenZFS are two different projects (see Wikipedia: ZFS).

1
  • The first link is dead. Nov 12, 2017 at 8:25
0

You may read this or this blog posts about How to shrink zfs pool. Both seem from oficial source

  1. Use format to create a smaller partition on a new device, say c0tXs0
  2. zpool create -f newpool c0tXs0
    
  3. beadm create -a -d "smaller s11.1" -p newpool solaris-SRUnn
    
  4. Use {ok} probe-scsi-all and
    {ok} devalias to identify the new disk
  5. {ok} setenv boot-device diskNN
  6. Boot new system, and clean up or copy (zfs send/receive) other file systems from the old device (e.g. /export, /export/home, perhaps also swap, dump, and VARSHARE)
  7. Use zpool export - or use zpool destroy - to hide or destroy the original
  8. Use format to create the mirror partition, say c0tYs0
  9. zpool attach -f newpool c0tXs0 c0tYs0
    
  10. Allow the resilver to complete
  11. At OBP, hunt down c0tY and boot the mirror
0
0

If you want to shrink root filesystem, this article was very helpful, when I moved root-FS pool to smaller disk on PVE node: https://aaronlauterer.com/blog/2021/proxmox-ve-migrate-to-smaller-root-disks/

In short, rpool - pool that we move; sdb2, sdb3 - EFI and ZFS partitions on the new drive:

proxmox-boot-tool format /dev/sdb2
proxmox-boot-tool init /dev/sdb2
zpool create rpool-new /dev/sdb3
zfs snapshot -r rpool@move
zfs send -R rpool@move | zfs receive -F rpool-new
zpool set bootfs=rpool-new/ROOT/pve-1 rpool-new
# boot to Proxmox ISO, enter Debug mode
# in first, initramfs prompt press Ctrl+D to exit
# in booted system prompt run:
zpool import rpool rpool-old -f
zpool import rpool-new rpool -f
zpool export rpool
zpool export rpool-old
reboot
# remove old drive(s), and run:
proxmox-boot-tool refresh
# it will complain about missing UUIDs in /etc/kernel/proxmox-boot-uuids
# remove those UUIDs from the file to suppress warnings
  • proxmox-boot-tool - is the analog of grub-install, update-grub
  • rpool/ROOT/pve-1 - is the root FS dataset on PVE

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .