I need to free disk space on a OpenSUSE Leap 15.4 server.
I notice I have a .snapshot
directory at system's root:
srv-abc:~ # ll -h /
total 0
drwxr-x--- 1 root root 36 Sep 14 2021 .snapshots
drwxr-xr-x 1 root root 1.8K Jan 26 13:50 bin
drwxr-xr-x 1 root root 1.2K Jan 26 13:58 boot
drwxr-xr-x 17 root root 4.0K Mar 19 22:54 dev
drwxr-xr-x 1 root root 5.0K Mar 19 22:54 etc
drwxr-xr-x 1 root root 44 Mar 15 2022 home
drwxr-xr-x 1 root root 100 Jan 26 13:15 lib
drwxr-xr-x 1 root root 3.0K Jan 26 13:52 lib64
drwxr-xr-x 1 root root 0 Mar 15 2022 mnt
drwxr-xr-x 1 root root 22 Mar 15 2022 opt
dr-xr-xr-x 245 root root 0 Mar 1 16:28 proc
drwx------ 1 root root 370 Mar 20 17:03 root
drwxr-xr-x 40 root root 1.1K Mar 19 00:00 run
drwxr-xr-x 1 root root 4.1K Jan 26 13:52 sbin
drwxr-xr-x 1 root root 0 Mar 15 2022 selinux
drwxr-xr-x 1 root root 84 Mar 1 16:29 srv
dr-xr-xr-x 13 root root 0 Mar 1 16:28 sys
drwxrwxrwt 1 root root 123K Mar 20 17:15 tmp
drwxr-xr-x 1 root root 110 Mar 15 2022 usr
drwxr-xr-x 1 root root 120 Jan 26 13:50 var
srv-abc:~ # du -sh /.snapshots
3.4G /.snapshots
I first thought about a snapper activity that would create snapshots but this option is disabled (USE_SNAPPER=no
in /etc/sysconfig/yast2
file) and filesystem is not BTRFS.
srv-abc:~ # df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 8.0K 4.0M 1% /dev
tmpfs 985M 0 985M 0% /dev/shm
tmpfs 394M 26M 369M 7% /run
tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup
/dev/sda2 14G 13G 574M 96% /
/dev/sda2 14G 13G 574M 96% /.snapshots
/dev/sda2 14G 13G 574M 96% /boot/grub2/x86_64-efi
/dev/sda2 14G 13G 574M 96% /boot/grub2/i386-pc
/dev/sda2 14G 13G 574M 96% /opt
/dev/sda2 14G 13G 574M 96% /home
/dev/sda2 14G 13G 574M 96% /var
/dev/sda2 14G 13G 574M 96% /usr/local
/dev/sda2 14G 13G 574M 96% /srv
/dev/sda2 14G 13G 574M 96% /tmp
/dev/sda2 14G 13G 574M 96% /root
//srv-file.domain.fr/Procedures 3.1T 2.8T 348G 90% /srv/www/htdocs/public/files
tmpfs 197M 0 197M 0% /run/user/1001
Is this .snapshot
directory necessary and can I confidently remove/empty it?
-- EDIT --
The filesystem is indeed BTRFS:
srv-abc:~ # mount
/dev/sda2 on /.snapshots type btrfs (rw,relatime,space_cache,subvolid=267,subvol=/@/.snapshots)
/dev/sda2 on /boot/grub2/x86_64-efi type btrfs (rw,relatime,space_cache,subvolid=265,subvol=/@/boot/grub2/x86_64-efi)
/dev/sda2 on /boot/grub2/i386-pc type btrfs (rw,relatime,space_cache,subvolid=266,subvol=/@/boot/grub2/i386-pc)
/dev/sda2 on /opt type btrfs (rw,relatime,space_cache,subvolid=263,subvol=/@/opt)
/dev/sda2 on /home type btrfs (rw,relatime,space_cache,subvolid=264,subvol=/@/home)
/dev/sda2 on /var type btrfs (rw,relatime,space_cache,subvolid=258,subvol=/@/var)
/dev/sda2 on /usr/local type btrfs (rw,relatime,space_cache,subvolid=259,subvol=/@/usr/local)
/dev/sda2 on /srv type btrfs (rw,relatime,space_cache,subvolid=261,subvol=/@/srv)
/dev/sda2 on /tmp type btrfs (rw,relatime,space_cache,subvolid=260,subvol=/@/tmp)
/dev/sda2 on /root type btrfs (rw,relatime,space_cache,subvolid=262,subvol=/@/root)
Here is the snapper's snapshots list:
srv-abc:~ # snapper -c root list
# | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata
---+--------+-------+--------------------------+------+------------+---------+------------------------------------+---------
0 | single | | | root | | | current |
1* | single | | Fri Oct 12 14:13:54 2018 | root | 3.29 GiB | | premier système de fichiers racine |
Can I remove snapshot ID 1* safely?