openSUSE and SLES use the btrfs filesystem by default, with snapper set up to create automatic snapshots. These snapshots are triggered periodically, through system changes made with YaST2 or zypper. While snapshots are useful for system recovery, they can quickly consume disk space, especially in environments with limited storage.
You can disable these automatic snapshots to conserve disk space. This is particularly beneficial in virtual machines where storage is often constrained. Disabling snapshots can be done by modifying snapper configurations and removing specific plugins.
The process involves removing the snapper plugin for zypper, disabling snapper's timeline snapshots, and disabling snapshots created by YaST. These steps will prevent automatic snapshots from taking up unnecessary disk space.
Methods to disable filesystem snapshots in SUSE:
Remove snapper plugin for zypper
Removing the snapper plugin for zypper prevents the automatic creation of snapshots during software installation, removal, or updates. This method is essential for reducing disk space usage associated with frequent system changes managed through zypper.
> sudo zypper remove --no-confirm snapper-zypp-plugin Loading repository data... Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed. Reading installed packages... Resolving package dependencies... The following package is going to be REMOVED: snapper-zypp-plugin 1 package to remove. After the operation, 9.8 KiB will be freed. Continue? [y/n/v/...? shows all options] (y): y (1/1) Removing snapper-zypp-plugin-0.8.3-1.1.noarch ..............................[done]
Disable snapper's timeline snapshots
Disabling snapper's timeline snapshots stops the hourly automatic creation of snapshots, which can rapidly consume disk space. This method is crucial for environments where frequent snapshots are unnecessary and storage is limited.
- List available available snapper configs.
> sudo snapper list-configs [sudo] password for root: Config | Subvolume -------+---------- root | /
- Disable timeline snapshot for specific config.
> sudo snapper --config root set-config "TIMELINE_CREATE=no"
Disable YaST snapshots
Disabling snapshots triggered by YaST stops the creation of filesystem snapshots whenever configuration changes are made. This method helps in conserving disk space, especially in systems where YaST is frequently used for system management.
- Open YaST configuration file using your preferred text editor with root permission.
> sudo vi /etc/sysconfig/yast2
- Search for USE_SNAPPER and set the value to no.
USE_SNAPPER=no
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.