cybercyber

Listing (and possibly removing) the ZFS snapshots using the most space

Quick command to find the 10 largest snapshots in your ZFS-pool “data”:

#!bash
zfs list -t snapshot -s used -r data -o name,used | tail -n 10

Obviously, this is (as always with ZFS and “Disk Usage”) only part of the story. But it gives you an idea of where to find more free space.

If I wanted to delete one or more of these snapshots, I would usually just copy the names from the output manually. Of course you can easily whip something up with “while” and “read”…