Similar to other operating systems, Linux uses various storage devices, or you can create partitions on one device to create different directory structures. In cloud environments, for example, the system might have two storage devices: the primary disk for the operating system, and an additional disk for user or application data.
This storage configuration is especially useful because if the primary disk is full, then the operating system might lose the ability to write data. When the system cannot write any more data to disk, then users cannot log in to their accounts and any running applications stop responding.
Monitoring storage usage is a good practice. Linux provides many graphical and command-line tools to view storage usage.
To view how much storage space is available on your Linux system, you can use the Disk Usage Analyzer application on the GNOME desktop. Launch the Disk Usage Analyzer application from the .
The Disk Usage Analyzer displays each storage device that is attached to your computer and to your home directory. On the lab computers used in this course, the devices include a hard drive and an optical drive. The disk drive's available space displays on the right side of the window.
The operating system uses disk space for the kernel, packages, and other files. The disk space that is used by the operating system is included in the metrics for the primary disk device. You can view the disk space that is used by your files by clicking .
When displaying the details of a directory or a device, Disk Usage Analyzer lists the directories that use the greatest amount of space in descending order. In the right panel, Disk Usage Analyzer shows an interactive map of the disk usage. The innermost ring of the chart represent directories in your home directory, with subdirectories in the outer rings. The size of the segments in each ring corresponds to the relative size of the directory.
You can click any segment of any ring to move into that directory so that you can see a chart of its contents. Right-click a segment and click to open the location in the Files application. Alternatively, click to remove the directory from the system.
To view the available disk space by using the command line, use the df command with the -h option to make the output human readable.
[user@host ~]$ df -h ~
Filesystem Size Used Avail Use% Mounted on
/dev/vda4 9.4G 4.6G 4.8G 90% /To get a detailed report about which files are using space on your drive, use the du command with the -h option.
[user@host ~]$ du -h ~
...output omitted...
160K /home/user/.../venv/lib/python3.9/site-packages/wsproto
28K /home/user/.../venv/lib/python3.9/site-packages/wsproto-1.1.0.dist-info
38M /home/user/.../venv/lib/python3.9/site-packages
38M /home/user/.../venv/lib/python3.9
38M /home/user/.../venv/lib
51M /home/user/.../venv
51M /home/user/.../pythonProject
51M /home/user/...
42G /home/user
df(1) and du(1) man pages
For more information about storage space in Linux, refer to Linux Tools: du vs. df at https://learn.spidernet.pl/sysadmin/du-vs-df