Snapper Rollback on Arch Linux
2 min read
8 months ago
Published on Apr 21, 2024
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
How to Set Up Snapper Rollback on Arch Linux
-
Partitioning the Disk:
- Use
fdisk -l
to list the partitions on/dev/sda
. - Use
fdisk
to partition the disk. Create an EFI partition (around 300MB) and a main partition for the system. - Format the EFI partition as FAT32 and the main partition as Btrfs.
- Use
-
Creating Sub-volumes:
- Mount Btrfs as root. By default, Btrfs has sub-volumes for root, home, and snapshots.
- Create additional sub-volumes as needed (e.g., for
/var/log
). - Mount the sub-volumes and the EFI partition.
-
Installing Basic Packages:
- Install necessary packages like Vim, EFI boot manager, dhcpcd, etc.
- Set up the file system table based on the mounted partitions.
-
Basic Configuration:
- Configure language settings, localization, etc., following the Arch Linux installation guide.
- Create the initial ramdisk environment, set a root password, and install GRUB.
-
Installing Snapper:
- Install Snapper and snap-pac (Pacman hook for snapshots).
- Install sudo and base-devel for building Snapper rollback from AUR.
-
Configuring Snapper:
- Create a configuration file for Snapper.
- Remove the existing
.snapshots
folder if it exists.
-
Setting Up Snapper Rollback:
- Create a new user and add it to the
wheel
group. - Edit the sudoers file to allow users in the
wheel
group to run sudo commands. - Download Snapper rollback from AUR, extract it, and install the package.
- Create a new user and add it to the
-
Testing Snapper Rollback:
- List all snapshots with
Snapper list
. - Test the rollback by installing a package, creating a snapshot, and rolling back to the previous state.
- List all snapshots with
-
Advanced Configuration:
- Customize Snapper rollback configuration files as needed.
- Explore booting into snapshots using packages like
grub-btrfs
andsnap-pac-grub
.
-
Final Steps:
- Reboot the system to ensure the changes are applied.
- Verify that the rollback process is working correctly by testing it with different snapshots.
By following these steps, you can set up and utilize Snapper rollback on your Arch Linux system to easily revert to a previously working state in case of system issues.