title: how do i setup snapshots in tumbleweed for btrfs
source: https://www.perplexity.ai/search/66fe3825-77cf-4769-8278-5de3f7250695?login-source=oneTapThread&login-new=false
author:
- "[[Perplexity AI]]"
published:
created: 2025-03-20
description: Setting up snapshots in openSUSE Tumbleweed for Btrfs is relatively straightforward, as Snapper is integrated into the system by default. Here's how to set it...
tags:
- btrfs
- Backup
- Computer
- Help
[
OSTechNix
Create Btrfs Snapshots With Snapper In openSUSE - OSTechNix
[
reddit.com
Possible to take Btrfs snapshot of the /home subvolume in ... - Reddit
youtube
Unlock the Power of openSUSE Btrfs & Snapper - YouTube
+5
sources
Setting up snapshots in openSUSE Tumbleweed for Btrfs is relatively straightforward, as Snapper is integrated into the system by default. Here's how to set it up and use it effectively:
By default, openSUSE Tumbleweed formats your hard drive with the Btrfs filesystem and sets up Snapper for the root filesystem5. This means you already have a basic snapshot configuration for your root directory.
bashsudo snapper list-configs
bashsudo snapper create-config /home
bashsudo snapper create --desc "Snapshot description"
bashsudo snapper list
bashsudo snapper status 1..2
To optimize Snapper's performance and disk usage:
bashsudo nano /etc/snapper/configs/root
To set up snapshots for other subvolumes like /home:
bashsudo btrfs subvolume list /
bashsudo snapper -c home create-config /home
Remember to regularly perform Btrfs maintenance tasks like balancing and scrubbing to ensure optimal filesystem performance6.
sudo snapper list-configs [sudo] password for root: Config │ Subvolume ───────┼────────── garyrust@unlimited:~> sudo snapper list The config 'root' does not exist. Likely snapper is not configured. See 'man snapper' for further instructions. garyrust@unlimited:~> sudo btrfs subvolume list / ID 256 gen 770 top level 5 path @ ID 257 gen 770 top level 256 path var ID 258 gen 700 top level 256 path usr/local ID 259 gen 697 top level 256 path srv ID 260 gen 724 top level 256 path root ID 261 gen 666 top level 256 path opt ID 262 gen 770 top level 256 path home ID 263 gen 35 top level 256 path boot/grub2/x86_64-efi ID 264 gen 697 top level 256 path boot/grub2/i386-pc garyrust@unlimited:~>
youtube
Unlock the Power of openSUSE Btrfs & Snapper - YouTube
[
manual.siduction.org
Btrfs and Snapper - Siduction Manual
[
OSTechNix
Create Btrfs Snapshots With Snapper In openSUSE - OSTechNix
+5
sources
Based on the output provided, it appears that Snapper is not configured on your openSUSE Tumbleweed system. However, your system is using Btrfs with several subvolumes. Here's how you can set up Snapper for Btrfs snapshots:
bashsudo snapper create-config /
bashsudo snapper list-configs
bashsudo systemctl enable --now snapper-timeline.timer
sudo systemctl enable --now snapper-cleanup.timer
bashsudo snapper -c home create-config /home
bashsudo snapper list
Remember to adjust Snapper's configuration files in /etc/snapper/configs/ to set appropriate limits on the number of snapshots to keep, to prevent excessive disk usage13.
After setting up Snapper, you can use it to create, manage, and restore snapshots of your Btrfs subvolumes, providing an additional layer of data protection and system recovery options136.
sudo snapper create-config /var [sudo] password for root: Creating config failed (config already exists). garyrust@unlimited:~> sudo snapper list-configs Config │ Subvolume ───────┼────────── root │ / garyrust@unlimited:~>
youtube
Unlock the Power of openSUSE Btrfs & Snapper - YouTube
[
forums.opensuse
BTRFS Subvolumes and snapper - openSUSE Forums
[
OSTechNix
Create Btrfs Snapshots With Snapper In openSUSE - OSTechNix
+5
sources
The error indicates that Snapper is already configured for the /var
subvolume. To proceed, you can verify and manage the existing configuration instead of creating a new one. Here's what you can do:
bashsudo snapper list-configs
This will show all existing configurations, including the one for /var
.
/var
If Snapper is already configured for /var
, you can create, list, and manage snapshots using the following commands:
bashsudo snapper -c var create --desc "Manual snapshot for /var"
bashsudo snapper -c var list
bashsudo snapper -c var undochange <snapshot_id>
Replace <snapshot_id>
with the ID of the snapshot you want to restore.
If needed, you can modify the Snapper configuration for /var
by editing its configuration file:
bashsudo nano /etc/snapper/configs/var
Adjust parameters like TIMELINE_LIMIT_HOURLY
, TIMELINE_LIMIT_DAILY
, etc., to control how many snapshots are retained.
If you suspect issues with the current configuration and want to recreate it:
bashsudo snapper delete-config var
bashsudo snapper create-config /var
This process ensures proper setup and management of snapshots for /var
.
sudo snapper create-config /var Creating config failed (config already exists) here is my fstab. UUID=a1793935-e1da-43b4-948d-d2856237f92e / btrfs defaults 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /var btrfs subvol=/@/var 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /usr/local btrfs subvol=/@/usr/local 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /srv btrfs subvol=/@/srv 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /root btrfs subvol=/@/root 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /opt btrfs subvol=/@/opt 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /home btrfs subvol=/@/home 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /boot/grub2/x86_64-efi btrfs subvol=/@/boot/grub2/x86_64-efi 0 0 UUID=a1793935-e1da-43b4-948d-d2856237f92e /boot/grub2/i386-pc btrfs subvol=/@/boot/grub2/i386-pc 0 0 UUID=5E21-21AD /boot/efi vfat utf8 0 2
[
Oracle Help Center
Automating File System Snapshots With the Snapper Utility
[
unix.stackexchange
How to configure snapper for home (restore snapper config)
[
manual.siduction.org
Btrfs and Snapper - Siduction Manual
+5
sources
The error occurs because your /var
is configured as a nested subvolume under the root Btrfs subvolume (@/var
). Here's how to resolve this:
/var
path in fstab uses subvol=/@/var
, making it a nested subvolume under the root (@
)bashsudo snapper delete-config var
bashsudo mv /var /var.old
sudo btrfs subvolume create /var
sudo cp -a /var.old/* /var/
sudo rm -rf /var.old
bashUUID=... /var btrfs subvol=/@/var 0 0
To:
bashUUID=... /var btrfs subvol=/var,noatime,compress=zstd 0 0
bashsudo snapper -c var create-config /var
After these changes:
bashsudo snapper list-configs # Should now show 'var' config
sudo btrfs subvolume list / # Should show /var as top-level subvolume
Important: Ensure you have backups before modifying subvolume structures. The cp -a
command preserves permissions and attributes during migration.
Related
How can I rename an existing Snapper configuration
What should I do if the Snapper configuration file is corrupted
How do I list all the Snapper configurations on my system
Can I automate the creation of Snapper configurations for multiple subvolumes
How do I revert to a previous snapshot using Snapper