1

Two question.....

  1. I have installed Ubuntu LTS 20.04.3 with ZFS and encryption, few hours ago, but don't know how to delete snapshots as they are piling up pretty quickly, I'm setting up my installation, installed zfs-auto-snapshot package but it's not detecting the snapshots for some reason on

$sudo zfs-auto-snapshot --keep NUM

No matter what number I give it's says no snapshots detected or sth like that, also skimmed through ZFS manpage but there was only method of deleting snapshots one by one which is very tedious as I have already like 15/20 snapshots piled up....

So what's the method/solution I should use to tackle it??

  1. Though I moved to LTS version by now, I want the non LTS version, so is there anyway I can achieve that from LTS version to non LTS version a smooth shift without messing anything up?
1

2 Answers 2

2

You can list ZFS snapshots in the terminal with the following command:

zfs list -t snapshot

To remove a specific snapshot, you can do this:

sudo zfs destroy rpool/USERDATA/MHT@FRIDAY09-03-21

If you would like to remove all snapshots — damn the torpedoes! — you can do this:

sudo zfs list -H -o name -t snapshot | xargs -n1 zfs destroy

Be careful when issuing zfs destroy commands, because there is no undo.

As for your second question, the window to upgrade from 20.04 ⇢ 20.10 ⇢ 21.04 has closed, as 20.10 is no longer supported. The simplest way to get your machine up to 21.04 would be to reinstall the OS using the newer installation .iso.

7
  • I know, I can delete specific snapshots with these commands but I wanna delete all snapshots in one go or more than one as they pile up pretty quickly Sep 7, 2021 at 1:12
  • 2
    I generally do not share the "damn the torpedoes" command to remove all ZFS snapshots, because this almost always results in people holding me accountable for their impatience later. However, there you go. Note: I offer no warranty with this answer.
    – matigo
    Sep 7, 2021 at 1:17
  • I get no datasets available on the first command. (yes, I am on a ZFS ubuntu)
    – tatsu
    Oct 3, 2022 at 19:11
  • 1
    I keep getting annot destroy snapshots: permission denied and the are about 100's of these to delete one at a time. After deleting about 50, the remaining space amount has not changed at all. There has to be a better way to get this done. Nov 6, 2022 at 3:36
  • If you are receiving permission denied errors, then it usually means that there's a missing sudo in front of the command or you're trying to do things with a ZFS volume that was created elsewhere and not fully brought into the current system 🤔
    – matigo
    Nov 6, 2022 at 5:13
0

You can avoid the error Error: The filesystem argument list is empty. by listing the filesystem you want to remove snapshots for. As an example:

zfs-auto-snapshot --destroy-only -k 1 --label=hourly rpool/USERDATA

This command won't remove any snapshots created manually or snapshots created by zsys.

To upgrade to the latest normal Ubuntu release, you can use the following:

sudo sed -i 's/^Prompt=.*/Prompt=normal/' /etc/update-manager/release-upgrades
sudo do-release-upgrade

You must log in to answer this question.

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