How to use snapshots on OpenSUSE
OpenSUSE is one of a few Linux operating systems that use BtrFS by default instead of Ext4. The BtrFS filesystem is excellent on OpenSUSE, and with it, users can take filesystem snapshots for each update and change made and roll it back if anything happens. In this guide, we’ll show you how you can use the robust snapshot feature in both OpenSUSE Leap and Tumbleweed.
How to take a snapshot in OpenSUSE using YaST2
Taking manual snapshots in OpenSUSE using YaST2 is done with the YaST Filesystem Snapshots tool. To open it, launch the app menu, and search for “YaST Filesystem Snapshots”. Once you’ve found it, enter your password and launch it.
After launching the snapshot tool on the OpenSUSE desktop, locate the “Create” button. When you’ve found “Create,” click on it with the mouse. Selecting this button will open a “Create New Snapshot” window.
Inside the “Create New Snapshot” window, find the “Description” box. In this box, type in a brief description of the snapshot you are making. In this example, it will be a “Test snapshot.”
Next, make your way to the “User data” section. If left blank, this section will take a new snapshot of your entire OpenSUSE system. If you are an expert, you may wish to fill out the specific user data for the OpenSUSE Snapshot tool to backup. However, don’t do this unless you know what you are doing.
Following the “User data” section, you’ll need to address the “Cleanup algorithm” section. This section can be left blank3 if you do not plan to address how your snapshot is cleaned up. However, if you do wish to clean it up, choose from either “number” or “timeline.”
Once you’ve customized the “Cleanup algorithm,” find the “OK” button and click on it with the mouse. Selecting the “OK” button will create your new snapshot in OpenSUSE via YaST2.
How to create pre and post snapshots
Creating a single snapshot is useful. With single snapshots, you can restore your system to working condition. However, if you want to keep track of files changing, you may want to create pre and post-snapshots.
A “pre” snapshot is a snapshot taken before something is changed. A post snapshot is taken after something is changed. When paired together in the YaST Snapshot tool, you can see changes and easily revert them. Here’s how.
First, find the “Create” button, and select it. Then, enter your description for your “pre” snapshot. Select the “Pre” option. Click the “OK” button to create your snapshot.
After creating your “Pre” snapshot, click on the “Create” button a second time. Select “Post,” and pair it with your previous snapshot. Enter your description, and click “OK” to take the snapshot.
When you’ve created your “pre/post” snapshots, select it inside of YaST2, and click on the “Show Changes” button. You can now view changes from your pre-snapshot and post-snapshot.
How to restore a snapshot in OpenSUSE using YaST2
Restoring snapshots in OpenSUSE is easy. To start, open up the YaST Filesystem Snapshots app. Once it is open, look through your snapshots and select the one you wish to restore.
After selecting a snapshot, find the “Show Changes” button, and click on it with the mouse. Once you’ve selected the snapshot, it will show an overview of the changes (if there are any). Select the files you wish to restore, and click on the “Restore” button.
How to delete a snapshot in OpenSUSE using YaST2
It’s possible to delete a snapshot in OpenSUSE Snapshot. To do it, launch the YaST2 snapshot tool. Then, find the snapshot you want to delete from the list and select it with the mouse. Finally, click the “Delete” button to delete your snapshot.
How to boot into a snapshot in OpenSUSE
OpenSUSE has an amazing ability that lets users boot into snapshots. This means that if your system breaks, you can simply boot into the snapshot, and fix the issue. To boot into a snapshot, reboot your OpenSUSE system.
After rebooting your OpenSUSE system, you’ll be presented with the OpenSUSE Grub bootloader. Using the arrow keys, select the “Start bootloader from a read-only snapshot” option. Then, press the Enter key on the keyboard to confirm.
When you select the “Start bootloader from a read-only snapshot’ option, you’ll see a list of snapshots to choose from. Look through the snapshots and select the one you want with the arrow keys. Finally, press the Enter key to boot the snapshot.
Once you’ve loaded the snapshot, open up a terminal window. Once it is open, enter the snapper rollback command to roll back your system to the currently booted snapshot.
sudo snapper rollback