Computer >> Computer tutorials >  >> System >> Linux

How to Use ZFS Snapshots in Ubuntu 20.04

How to Use ZFS Snapshots in Ubuntu 20.04

Ubuntu’s support for ZFS isn’t new in the 20.04 LTS version. What is new is how easy it is to use one of ZFS’s most essential features – snapshots. Thanks to snapshots, you can revert your operating system to an earlier state before any problems occurred. Learn here how to use ZFS snapshots in Ubuntu 20.04.

Install with ZFS

To be able to use ZFS’s features, you must also be using ZFS. This means that during Ubuntu’s installation, during the “Installation type” step, instead of going with the default “Erase disk and install Ubuntu,” you should click on “Advanced features … “

How to Use ZFS Snapshots in Ubuntu 20.04

In the window that pops up, select “EXPERIMENTAL: Erase disk and use ZFS” and click OK.

How to Use ZFS Snapshots in Ubuntu 20.04

With “ZFS selected” showing next to “Advanced features … “, you can proceed with the rest of the installation as usual.

How to Use ZFS Snapshots in Ubuntu 20.04

Automatic Snapshots

With Ubuntu 20.04, you don’t have to do anything to take advantage of ZFS’s snapshot feature. You may notice the feature in action when installing new packages in your favorite terminal, creating symlinks to alternate versions of files, and updating the GRUB menu.

How to Use ZFS Snapshots in Ubuntu 20.04

When you do need them, though, to revert your system to an earlier state, they’ll be there for you. Let’s do a test run. Install a package you’d like to try with:

sudo apt install PACKAGE_NAME

After you’ve tried your new package, you can uninstall it again with apt. For this tutorial, though, you’ll see in the steps that follow how you can revert your whole system to the point before its installation.

Restoring to an Earlier State

Whenever you decide you want to revert your file system to an earlier state, do a restart. After the initial boot screen, you will have to press a different key to access GRUB, depending on your computer’s firmware.

If your computer uses BIOS, you have to keep the Shift key pressed. If it uses UEFI, you must hit Escape after the initial system boot but before the operating system starts loading.

How to Use ZFS Snapshots in Ubuntu 20.04

Move to the third entry, “History for Ubuntu 20.04 LTS,” and press Enter.

How to Use ZFS Snapshots in Ubuntu 20.04

Choose the snapshot you want to revert to from the list that appears.

How to Use ZFS Snapshots in Ubuntu 20.04

Choose if you want to revert only the system files to an earlier state, but keep your personal data intact, or if you’d like to turn back time on everything.

How to Use ZFS Snapshots in Ubuntu 20.04

Wait a while for the different versions of files to “remap” in the filesystem. When you next enter your desktop, it will be back to where you left it before the selected snapshot.

Do you like the ZFS snapshots feature in Ubuntu 20.04? Or do you prefer using a combination of Ext4 and a backup tool with similar functionality? Tell us in the comments section below.