I’m not a heavy user of snaps particularly on the Raspberry Pi 5. I find that installing software with Flatpak is a better solution than snap in most instances even though both are wasteful of disk space. But occasionally it’s useful to use a snap.
After installing a few snaps, df output gets overridden with /dev/loop entries
. Here’s an example.
A snap is a SquashFS file carrying content alongside metadata to tell the system how it should be manipulated.
What’s the easiest remedy to clean up df’s output besides avoiding snaps altogether?
I can exclude squashfs with the -x
flag. And use the -h
option to make the output human readable.
$ df -hx "squashfs"
Another solution is to use an alternative to df. There are quite a few alternatives to df featured in this roundup. My favourite is dysk which can be installed with cargo, Rust’s package manager. First install cargo.
$ sudo apt install cargo
Now let’s try to build dysk with the command:
$ cargo install dysk
dysk fails to build because the version of rustc installed with the Raspberry Pi OS is too old.
It’s suggested re-running cargo install with --locked
.
$ cargo install dysk --locked
That didn’t help.
Let’s remove the old version of rustc and cargo we’ve got.
$ sudo apt remove rust cargo
Let’s install the current version of Rust. Issue the command:
$ curl https://sh.rustup.rs -sSf | sh
Select option 1 by pressing enter.
I’ve now installed the current version of Rust on my Pi 5.
$ rustc --version
Let’s try compiling dysk again.
$ cargo install dysk
Success, dysk is now installed on my system.
Issue the command:
$ dysk
Here’s example output from dysk. In my opinion the output is much neater than with df.
Let’s go the whole hog and use an alias, so I can just type df. I’m going to use the -s label
flag in my alias.
Add the following line to ~/.bashrc
using a text editor such as nano.
alias df='dysk -s label'
Log out of the shell or type: $ source .bashrc
Now when I type df, I get the output.
This article was written on a Raspberry Pi 5 (16GB RAM) provided by SunFounder, a company focused on STEAM education with products like Open-source robots, Arduino & Raspberry Pi Kits, display screens, and other smart devices.
All articles in this series:
Raspberry Pi 5 Series | |
---|---|
Hardware | |
iRasptek Starter Kit | All the kit you need to get started with the Pi 5 |
Pironman 5 Case Review | Transform the Pi 5 into a beautiful desktop mini PC |
Passive Cooling the Pi 5 | Passively cool your Pi 5 the right way. Silent yet cool |
Benchmarking | Benchmarking the Pi 5 against an Intel N100 mini PC |
Overclocking | Let's increase the clock speed of the BCM2712 SoC |
Power Consumption | Compare the power consumption of the Pi 5 with Intel Mini PCs |
Configuration | |
raspi-config | Useful text-based tool to configure the Pi 5 |
PiGro | GUI tool that streamlines the process of managing the Pi 5 |
Increase Swap Memory Size | Increase the swap size from 512MB to 2GB |
ZRAM swapdrive | Simple script to use a ZRAM swapdrive instead of a swapfile |
Software | |
Installing Software | Different ways to install software on the Pi 5 |
df snap pollution | Replace df with dysk |
Many software articles are planned. Stay tuned! |