[Super beginner's guide in 3 minutes] Done! Check disk usage

Hello!
I'm Inoue, a Persian cat from Beyond Co., Ltd.'s Shikoku office.

To put it simply, as an MSP, I frequently use the command " df "
to check and manage disk capacity while troubleshooting issues on a daily basis.
A lot of data is left on the disk every day, so
if left unattended, the disk will fill up.
I'll introduce how to use the " df

df command

Check your disk usage

# df Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 485716 0 485716 0% /dev tmpfs 503624 0 503624 0% /dev/shm tmpfs 503624 392 503232 1% /run tmpfs 503624 0 503624 0% /sys/fs/cgroup /dev/xvda1 8376300 2864700 5511600 35% / tmpfs 100728 0 100728 0% /run/user/1000

If you don't add any options, it will look like this:

-h option

# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 475M 0 475M 0% /dev tmpfs 492M 0 492M 0% /dev/shm tmpfs 492M 392K 492M 1% /run tmpfs 492M 0 492M 0% /sys/fs/cgroup /dev/xvda1 8.0G 2.8G 5.3G 35% /tmpfs 99M 0 99M 0% /run/user/1000

displays in K, M, and G units , so you can see at a glance where you are using the most.

-a option

# df -ah Filesystem Size Used Avail Use% Mounted on sysfs 0 0 0 - /sys proc 0 0 0 - /proc devtmpfs 475M 0 475M 0% /dev securityfs 0 0 0 - /sys/kernel/security tmpfs 492M 0 492M 0% /dev/shm devpts 0 0 0 - /dev/pts tmpfs 492M 392K 492M 1% /run tmpfs 492M 0 492M 0% /sys/fs/cgroup cgroup 0 0 0 - /sys/fs/cgroup/systemd pstore 0 0 0 - /sys/fs/pstore cgroup 0 0 0 - /sys/fs/cgroup/devices cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio cgroup 0 0 0 - /sys/fs/cgroup/freezer cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct cgroup 0 0 0 - /sys/fs/cgroup/memory cgroup 0 0 0 - /sys/fs/cgroup/pids cgroup 0 0 0 - /sys/fs/cgroup/perf_event cgroup 0 0 0 - /sys/fs/cgroup/blkio cgroup 0 0 0 - /sys/fs/cgroup/hugetlb cgroup 0 0 0 - /sys/fs/cgroup/cpuset /dev/xvda1 8.0G 2.8G 5.3G 35% / systemd-1 - - - - /proc/sys/fs/binfmt_misc debugfs 0 0 0 - /sys/kernel/debug mqueue 0 0 0 - /dev/mqueue hugetlbfs 0 0 0 - /dev/hugepages sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs tmpfs 99M 0 99M 0% /run/user/1000 binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc

All disk space is displayed

-T option

# df -Th Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 475M 0 475M 0% /dev tmpfs tmpfs 492M 0 492M 0% /dev/shm tmpfs tmpfs 492M 392K 492M 1% /run tmpfs tmpfs 492M 0 492M 0% /sys/fs/cgroup /dev/xvda1 xfs 8.0G 2.8G 5.3G 35% / tmpfs tmpfs 99M 0 99M 0% /run/user/1000

Displays the file type.
You can check the mounted device.

-i option

# df -i Filesystem Inodes IUsed IFree IUse% Mounted on devtmpfs 121429 281 121148 1% /dev tmpfs 125906 1 125905 1% /dev/shm tmpfs 125906 346 125560 1% /run tmpfs 125906 16 125890 1% /sys/fs/cgroup /dev/xvda1 4193216 46429 4146787 2% / tmpfs 125906 1 125905 1% /run/user/1000

Shows inode usage

■ Specify a directory

# df haruka Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8376300 2881132 5495168 35% /

The capacity of "xvda1" where the haruka directory is stored is displayed

summary

It's a commonly used command that's practically essential for MSPs.
This time, we've introduced some options to help you master the
" df It's important to regularly monitor your disk usage and free space.
If your disk becomes full,
you'll encounter problems like being unable to update or save logs.
Therefore, it's important to regularly check and organize your disk space to prevent issues from occurring!

I will continue to try and error and
write blogs about my favorite commands and commands that I personally want to understand better.

Growing every day, progressing every day.
I have to update myself every day!!!
Thank you for reading to the end.

If you found this article useful, please click [Like]!
0
Loading...
0 votes, average: 0.00 / 10
1,080
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Ayaka Inoue

I'm a member of the System Solutions Department.
I joined Beyond as one of the founding members of the Shikoku office. I jumped into the IT industry with no experience.
As part of the education team, I create curriculum and conduct training for new graduates, mid-career hires, and existing members.
My main job is server operation and maintenance.
Above all, I care about our customers' content.
I'm also a member of the Web Content Division and YouTube team.