SDB:Disk space

Jump to: navigation, search


Situation

More disk space is needed or desired.

Procedure

You must be logged in as root to make changes to the system partition.

With btrfs, check disk space using:

root # btrfs fi usage /

Snapper

The place to start is checking your snapshots. Very old snapshots will appear to consume a lot of space.

If you have never run a "snapper rollback", then you can't delete snapshot 1 (this is normal). If you have, then you won't be able to delete whatever snapshot you rolled back to. You can check what snapshot that is at the top of the "findmnt" output.

Check how many snapshots you have:

root # snapper list

If for some reason you have dozens or hundreds of snapshots, then the daily cleanup isn't being run.

/etc/cron.daily/suse.de-snapper

It's a bash script you can also run manually, but there are other ways.

With the release of snapper 0.5.3 the cron script was replaced with a systemd timer. The related systemd units are snapper-cleanup.timer and snapper-cleanup.service. The associated config file is /etc/snapper/configs/root and the service calls

/usr/lib/snapper/systemd-helper --cleanup

This can also be called via:

systemctl start snapper-cleanup

Those use the cleanup algorithms, which you can also call individually:

snapper cleanup <algorithm> (number or timeline or empty-pre-post)

You can also delete a specific snapshot manually:

snapper rm <n>

Or delete a range of snapshots:

snapper rm <n1>-<n2>

Phantom snapshots

Occasionally, snapshots not listed by snapper will still exist. Check with:

btrfs subvolume list /

The two reportedly effective methods for removing unlisted snapshots are:

Systemd journal

You can check the size of the journal with:

journalctl --disk-usage

If you don't care about log entries from more than two days ago, you can:

journalctl --rotate
journalctl --vacuum-time=2d

You can also set limits in /etc/systemd/journald.conf

[Journal]
SystemMaxUse=64M

Old kernels

On Tumbleweed old kernels can build up. You can remove them with:

systemctl start purge-kernels

Zypper cache

You can delete the zypper package and/or metadata cache with:

root # zypper clean

Temporary files

There is a systemd timer/service set to run 15 minutes after boot that calls:

root # /usr/bin/systemd-tmpfiles --clean

There are two ways to check if the timer is active:

root # systemctl list-timers

or

root # systemctl status systemd-tmpfiles-clean.timer

See also

Related articles

External links