How to Install Duf on Rockylinux 9
Duf also called "Disk Usage Free utility" is a free and open-source tool written in Golang. It is used to display disk usage of the system in a tabular format. It is an alternative to the df
command and it can be installed on Linux, BSD, Windows, and macOS. It also displays the disk usage details in the JSON output.
In this post, we will show you how to monitor disk usage with the Duf utility on Rocky Linux 9.
Prerequisites
-
A system with Rocky Linux 9 installed and running.
root
access to the system.
Check for System Updates
First, we will update the system to the latest with the following commands,
dnf update
Install Duf
At the time of writing this article, version 0.8.1
was the latest. You can check and download the latest version of .deb
source file from their official repository.
We will download using the wget
command as shown below,
wget https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_amd64.rpm
Output:
[root@server ~]# wget https://github.com/muesli/duf/releases/download/v0.8.1/duf _0.8.1_linux_amd64.rpm
--2022-07-23 22:09:37-- https://github.com/muesli/duf/releases/download/v0.8.1/ duf_0.8.1_linux_amd64.rpm
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset- 2e65be/297165998/75d31bb2-a173-4103-bde3-999725cffca8?X-Amz-Algorithm=AWS4-HMAC- SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220723%2Fus-east-1%2Fs3%2Faws4_ request&X-Amz-Date=20220723T200937Z&X-Amz-Expires=300&X-Amz-Signature=6ce7d22650 d97c8660febb596d6fc16203b915e4c2382988992c114317c32dc6&X-Amz-SignedHeaders=host& actor_id=0&key_id=0&repo_id=297165998&response-content-disposition=attachment%3B %20filename%3Dduf_0.8.1_linux_amd64.rpm&response-content-type=application%2Focte t-stream [following]
--2022-07-23 22:09:37-- https://objects.githubusercontent.com/github-production -release-asset-2e65be/297165998/75d31bb2-a173-4103-bde3-999725cffca8?X-Amz-Algor ithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220723%2Fus-east -1%2Fs3%2Faws4_request&X-Amz-Date=20220723T200937Z&X-Amz-Expires=300&X-Amz-Signa ture=6ce7d22650d97c8660febb596d6fc16203b915e4c2382988992c114317c32dc6&X-Amz-Sign edHeaders=host&actor_id=0&key_id=0&repo_id=297165998&response-content-dispositio n=attachment%3B%20filename%3Dduf_0.8.1_linux_amd64.rpm&response-content-type=app lication%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.1 99.109.133, 185.199.108.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185. 199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 916883 (895K) [application/octet-stream]
Saving to: ‘duf_0.8.1_linux_amd64.rpm’
duf_0.8.1_linux_amd 100%[===================>] 895.39K --.-KB/s in 0.08s
2022-07-23 22:09:37 (11.1 MB/s) - ‘duf_0.8.1_linux_amd64.rpm’ saved [916883/9168
Install the downloaded rpm
source file using the command,
rpm -Uvh duf_0.8.1_linux_amd64.rpm
Output:
```[root@server ~]# rpm -Uvh duf_0.8.1_linux_amd64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:duf-0:0.8.1-1 ################################# [100%]
### Using the Duf Command Utility
We will now try using the `duf` command on the terminal to get disk-related information.
duf
Output:
[root@server ~]# duf ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │ 2 local devices │ ├────────────┬────────┬────────┬────────┬───────────────────────────────┬──────┬────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├────────────┼────────┼────────┼────────┼───────────────────────────────┼──────┼────────────┤ │ / │ 46.5G │ 1.9G │ 42.1G │ [....................] 4.2% │ ext4 │ /dev/vda3 │ │ /boot │ 506.7M │ 221.3M │ 285.4M │ [########............] 43.7% │ xfs │ /dev/vda2 │ ╰────────────┴────────┴────────┴────────┴───────────────────────────────┴──────┴────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │ 4 special devices │ ├─────────────┬────────┬───────┬────────┬───────────────────────────────┬──────────┬────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├─────────────┼────────┼───────┼────────┼───────────────────────────────┼──────────┼────────────┤ │ /dev │ 868.9M │ 0B │ 868.9M │ │ devtmpfs │ devtmpfs │ │ /dev/shm │ 887.5M │ 0B │ 887.5M │ │ tmpfs │ tmpfs │ │ /run │ 355.0M │ 30.1M │ 324.9M │ [#...................] 8.5% │ tmpfs │ tmpfs │ │ /run/user/0 │ 177.5M │ 0B │ 177.5M │ │ tmpfs │ tmpfs │ ╰─────────────┴────────┴───────┴────────┴───────────────────────────────┴──────────┴────────────╯
Next, Find out more `duf` usages and available options that you can use to get started,
duf --help
To display the information about Pseudo, inaccessible, and duplicate file systems, run the following command:
duf -all
Output:
[root@server ~]# duf -all ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 local devices │ ├─────────────────┬────────┬────────┬────────┬───────────────────────────────┬───────────┬────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├─────────────────┼────────┼────────┼────────┼───────────────────────────────┼───────────┼────────────┤ │ / │ 46.5G │ 1.9G │ 42.1G │ [....................] 4.2% │ ext4 │ /dev/vda3 │ │ /boot │ 506.7M │ 221.3M │ 285.4M │ [########............] 43.7% │ xfs │ /dev/vda2 │ │ /sys/fs/selinux │ 0B │ 0B │ 0B │ │ selinuxfs │ selinuxfs │ ╰─────────────────┴────────┴────────┴────────┴───────────────────────────────┴───────────┴────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 19 special devices │ ├──────────────────────────┬────────┬───────┬────────┬───────────────────────────────┬─────────────┬─────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├──────────────────────────┼────────┼───────┼────────┼───────────────────────────────┼─────────────┼─────────────┤ │ /dev │ 868.9M │ 0B │ 868.9M │ │ devtmpfs │ devtmpfs │ │ /dev/hugepages │ 0B │ 0B │ 0B │ │ hugetlbfs │ hugetlbfs │ │ /dev/mqueue │ 0B │ 0B │ 0B │ │ mqueue │ mqueue │ │ /dev/pts │ 0B │ 0B │ 0B │ │ devpts │ devpts │ │ /dev/shm │ 887.5M │ 0B │ 887.5M │ │ tmpfs │ tmpfs │ │ /proc │ 0B │ 0B │ 0B │ │ proc │ proc │ │ /proc/sys/fs/binfmt_misc │ 0B │ 0B │ 0B │ │ autofs │ systemd-1 │ │ /proc/sys/fs/binfmt_misc │ 0B │ 0B │ 0B │ │ binfmt_misc │ binfmt_misc │ │ /run │ 355.0M │ 30.1M │ 324.9M │ [#...................] 8.5% │ tmpfs │ tmpfs │ │ /run/user/0 │ 177.5M │ 0B │ 177.5M │ │ tmpfs │ tmpfs │ │ /sys │ 0B │ 0B │ 0B │ │ sysfs │ sysfs │ │ /sys/fs/bpf │ 0B │ 0B │ 0B │ │ bpf │ none │ │ /sys/fs/cgroup │ 0B │ 0B │ 0B │ │ cgroup2 │ cgroup2 │ │ /sys/fs/fuse/connections │ 0B │ 0B │ 0B │ │ fusectl │ fusectl │ │ /sys/fs/pstore │ 0B │ 0B │ 0B │ │ pstore │ pstore │ │ /sys/kernel/config │ 0B │ 0B │ 0B │ │ configfs │ configfs │ │ /sys/kernel/debug │ 0B │ 0B │ 0B │ │ debugfs │ debugfs │ │ /sys/kernel/security │ 0B │ 0B │ 0B │ │ securityfs │ securityfs │ │ /sys/kernel/tracing │ 0B │ 0B │ 0B │ │ tracefs │ tracefs │ ╰──────────────────────────┴────────┴───────┴────────┴───────────────────────────────┴─────────────┴─────────────╯
Done!