$ sudo journalctl -u systemd-journald | tail -n 5
-- Reboot --
Jan 04 16:48:07 x systemd-journald: Journal started
Jan 04 16:48:07 x systemd-journald: Runtime journal (/run/log/journal/ef635a010d284bc38d762d2b9f0e65ac) is 8.0M, max 158.0M, 150.0M free.
Jan 04 16:48:07 x systemd-journald: Time spent on flushing to /var is 177.349ms for 1008 entries.
Jan 04 16:48:07 x systemd-journald: System journal (/var/log/journal/ef635a010d284bc38d762d2b9f0e65ac) is 4.0G, max 4.0G, 0B free.
也可以透過 du 或 journal --disk-usage 指令看目前使用的空間，像我這台主機就被佔用了 4GB ：
$ du -d 0 -h /var/log/journal/
$ sudo journalctl --disk-usage
Archived and active journals take up 4.0G in the file system.
When doing labs / playing with ZFS on Linux, ZFS pool may creates a few partitions on each drive, we may want to erase all the playground partition table to start from scratch again(though it may not be required), if we have many drives like more than 10, and we want to erase them all, it’ll take a while to finish the job.
Here is a rapid method to do it, using the non-interactive command sgdisk from package gdisk – the GPT fdisk text-mode partitioning tool, with parameter -Z or -o (both work in my case):
$ sudo sgdisk -Z /dev/sda
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.
$ sudo sgdisk -o /dev/sdb
The operation has completed successfully.
According to the help message, by specifing parameters -Z, it’ll zap (destroy) the GPT and MBR data structures and exit, and by specifing parameters -o, it’ll clear out all partition data. This includes GPT header data, all partition definitions, and the protective MBR.
Because the command sgdisk is non-interactive, so we can simply integrate the whole massive partition clean up job with shell scripts, for example: