Snapper Rollback on Arch Linux

2 min read 4 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

  1. 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.
  2. 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.
  3. Installing Basic Packages:

    • Install necessary packages like Vim, EFI boot manager, dhcpcd, etc.
    • Set up the file system table based on the mounted partitions.
  4. 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.
  5. Installing Snapper:

    • Install Snapper and snap-pac (Pacman hook for snapshots).
    • Install sudo and base-devel for building Snapper rollback from AUR.
  6. Configuring Snapper:

    • Create a configuration file for Snapper.
    • Remove the existing .snapshots folder if it exists.
  7. 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.
  8. 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.
  9. Advanced Configuration:

    • Customize Snapper rollback configuration files as needed.
    • Explore booting into snapshots using packages like grub-btrfs and snap-pac-grub.
  10. 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.