{"id":12542,"date":"2025-11-18T01:01:00","date_gmt":"2025-11-18T06:01:00","guid":{"rendered":"https:\/\/www.both.org\/?p=12542"},"modified":"2026-01-02T21:31:56","modified_gmt":"2026-01-03T02:31:56","slug":"commands-i-use-to-explore-linux-filesystems","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=12542","title":{"rendered":"Commands I use to explore Linux filesystems"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"12542\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>As a SysAdmin, I need to manage the <a href=\"https:\/\/www.both.org\/?p=3157\" data-type=\"link\" data-id=\"https:\/\/www.both.org\/?p=3157\" target=\"_blank\" rel=\"noreferrer noopener\">filesystems<\/a> on the hosts in my home lab. There&#8217;s usually little to do, but when there is it can be interesting. For the most part it&#8217;s just a bit of monitoring to ensure that none of the filesystems are getting close to that 80% full mark at which performance tends to suffer. When that happens I need to expand the logical volume and the filesystem on it. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disk space<\/h2>\n\n\n\n<p>I currently use Logical Volume Management (LVM) with EXT4 filesystems on each volume. This has been my standard setup since LVM became available on Fedora. It&#8217;s really made managing disk space easier because space can be added on-the-fly while the system is running with no interruption to the tasks being performed by the system. <\/p>\n\n\n\n<p>But that&#8217;s a different part of the story. First we need to determine which filesystems are filling up. This article is about that.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The df command<\/h3>\n\n\n\n<p>The ancient and venerable <strong>df<\/strong> command provides a simple but good overview of the structure and usage of the storage space on a Linux system. Figure 1 shows the results of this command on my primary workstation, which has a complex storage setup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>df<\/strong>\nFilesystem                     1K-blocks      Used Available Use% Mounted on\n\/dev\/mapper\/vg01-root           10218772   1595728   8082372  17% \/\n\/dev\/mapper\/vg01-usr            61611872  34385092  24148564  59% \/usr\ndevtmpfs                        32699832        44  32699788   1% \/dev\ntmpfs                           32745276        12  32745264   1% \/dev\/shm\nefivarfs                             128       110        14  90% \/sys\/firmware\/efi\/efivars\ntmpfs                           13098112      2492  13095620   1% \/run\ntmpfs                               1024         0      1024   0% \/run\/credentials\/systemd-journald.service\n\/dev\/nvme1n1p2                   5074592    659084   4136980  14% \/boot\n\/dev\/nvme1n1p1                   5232640     19776   5212864   1% \/boot\/efi\n\/dev\/mapper\/vg02-home          256920004  60070852 183725568  25% \/home\n\/dev\/mapper\/vg01-tmp            15178696   2271596  12130028  16% \/tmp\n\/dev\/mapper\/vg01-var            51290592   3875932  44776836   8% \/var\n\/dev\/mapper\/vg03-Virtual       960306656 584697028 333980640  64% \/Virtual\n\/dev\/mapper\/vg01-ansible        15375304    220484  14352004   2% \/home\/dboth\/development\/ansible\n\/dev\/mapper\/vg04-VMArchives    824572824 281697720 500915680  36% \/VMArchives\n\/dev\/mapper\/vg04-stuff         256920004 114328504 129467916  47% \/stuff\ntmpfs                            6549052       208   6548844   1% \/run\/user\/1000\ndboth@bunkerhill:\/var\/Pictures 479537840  18701076 436404124   5% \/home\/dboth\/Pictures\ntmpfs                            6549052       208   6548844   1% \/run\/user\/0<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 1: The plain <strong>df<\/strong> command provides insight into the storage on Linux systems.<\/p>\n\n\n\n<p>The left-most column shows the filesystem name or its device special file in the \/dev directory. This command also displays the total space on the filesystem, how much is used, and how much is still available. The last column is the mountpoint for the filesystem.<\/p>\n\n\n\n<p>You can see in Figure 1 the list of mounted filesystems, some of which are temporary filesystems that exist only in RAM. You can also see the LVM structure which shows four volume groups and the logical volumes extant on each. You can also see that the \/boot and \/boot\/efi filesystems are not part of the LVM structure because they need to be on a standard Linux partition to be able to boot. <\/p>\n\n\n\n<p>The <strong>df<\/strong> command displays usage data in 1K blocks, but you can use the -h option which displays the data in human readable form as in Figure 2. The data is shown in GB or MB as appropFigure 5: The <strong>df<\/strong> command showing only the EXT4 filesystems.riate for the order of magnitude.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>df -h<\/strong>\nFilesystem                      Size  Used Avail Use% Mounted on\n\/dev\/mapper\/vg01-root           9.8G  1.6G  7.8G  17% \/\n\/dev\/mapper\/vg01-usr             59G   33G   23G  59% \/usr\ndevtmpfs                         32G   44K   32G   1% \/dev\ntmpfs                            32G   12K   32G   1% \/dev\/shm\nefivarfs                        128K  110K   14K  90% \/sys\/firmware\/efi\/efivars\ntmpfs                            13G  2.5M   13G   1% \/run\ntmpfs                           1.0M     0  1.0M   0% \/run\/credentials\/systemd-journald.service\n\/dev\/nvme1n1p2                  4.9G  644M  4.0G  14% \/boot\n\/dev\/nvme1n1p1                  5.0G   20M  5.0G   1% \/boot\/efi\n\/dev\/mapper\/vg02-home           246G   58G  176G  25% \/home\n\/dev\/mapper\/vg01-tmp             15G  2.2G   12G  16% \/tmp\n\/dev\/mapper\/vg01-var             49G  3.7G   43G   8% \/var\n\/dev\/mapper\/vg03-Virtual        916G  558G  319G  64% \/Virtual\n\/dev\/mapper\/vg01-ansible         15G  216M   14G   2% \/home\/dboth\/development\/ansible\n\/dev\/mapper\/vg04-VMArchives     787G  269G  478G  36% \/VMArchives\n\/dev\/mapper\/vg04-stuff          246G  110G  124G  47% \/stuff\ntmpfs                           6.3G  208K  6.3G   1% \/run\/user\/1000\ndboth@bunkerhill:\/var\/Pictures  458G   18G  417G   5% \/home\/dboth\/Pictures\ntmpfs                           6.3G  208K  6.3G   1% \/run\/user\/0<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 2: The <strong>df<\/strong> command showing data in human readable form.<\/p>\n\n\n\n<p>The most important option I use  is -i, which displays the total number of <a href=\"https:\/\/www.both.org\/?p=3105\" data-type=\"link\" data-id=\"https:\/\/www.both.org\/?p=3105\" target=\"_blank\" rel=\"noreferrer noopener\">inodes<\/a> and those used and available, as in Figure 3. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>df -ih<\/strong>\nFilesystem                     Inodes IUsed IFree IUse% Mounted on\n\/dev\/mapper\/vg01-root            640K   21K  620K    4% \/\n\/dev\/mapper\/vg01-usr             3.8M  1.1M  2.7M   30% \/usr\ndevtmpfs                         7.8M  1.2K  7.8M    1% \/dev\ntmpfs                            7.9M     5  7.9M    1% \/dev\/shm\nefivarfs                            0     0     0     - \/sys\/firmware\/efi\/efivars\ntmpfs                            800K  2.0K  799K    1% \/run\ntmpfs                            1.0K     2  1022    1% \/run\/credentials\/systemd-journald.service\n\/dev\/nvme1n1p2                   320K   124  320K    1% \/boot\n\/dev\/nvme1n1p1                      0     0     0     - \/boot\/efi\n\/dev\/mapper\/vg02-home             16M  358K   16M    3% \/home\n\/dev\/mapper\/vg01-tmp             960K    80  960K    1% \/tmp\n\/dev\/mapper\/vg01-var             3.2M  7.5K  3.2M    1% \/var\n\/dev\/mapper\/vg03-Virtual          59M   230   59M    1% \/Virtual\n\/dev\/mapper\/vg01-ansible         960K   41K  920K    5% \/home\/dboth\/development\/ansible\n\/dev\/mapper\/vg04-VMArchives       50M   200   50M    1% \/VMArchives\n\/dev\/mapper\/vg04-stuff            16M   906   16M    1% \/stuff\ntmpfs                            1.6M   180  1.6M    1% \/run\/user\/1000\ndboth@bunkerhill:\/var\/Pictures    30M  6.8K   30M    1% \/home\/dboth\/Pictures\ntmpfs                            1.6M   140  1.6M    1% \/run\/user\/0<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 3: The <strong>df<\/strong> command showing the number of inodes and their usage.<\/p>\n\n\n\n<p>Inodes are important because they store much of the metadata for each file including the locations of its data on the storage device. Every file in an EXT filesystem has at least one inode and large files can have several. If all the inodes are in use, say for a large number of small files, no new files can be created even if there are plenty of free data blocks on the filesystem. Fortunately the default number of inodes allocated when the filesystem is created is excellent for most use cases. But not all.<\/p>\n\n\n\n<p>Figure 3 shows that only a small percentage of inodes are used on my workstation.<\/p>\n\n\n\n<p>The <strong>df<\/strong> command has other interesting options such as &#8211; &#8211; total, which prints totals at the bottom of the listing, and -T which displays the file type for each filesystem. Figure 4 shows both of these options.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>df -hT --total<\/strong>\nFilesystem                     Type        Size  Used Avail Use% Mounted on\n\/dev\/mapper\/vg01-root          ext4        9.8G  1.6G  7.8G  17% \/\n\/dev\/mapper\/vg01-usr           ext4         59G   33G   23G  59% \/usr\ndevtmpfs                       devtmpfs     32G   44K   32G   1% \/dev\ntmpfs                          tmpfs        32G   12K   32G   1% \/dev\/shm\nefivarfs                       efivarfs    128K  110K   14K  90% \/sys\/firmware\/efi\/efivars\ntmpfs                          tmpfs        13G  2.5M   13G   1% \/run\ntmpfs                          tmpfs       1.0M     0  1.0M   0% \/run\/credentials\/systemd-journald.service\n\/dev\/nvme1n1p2                 ext4        4.9G  644M  4.0G  14% \/boot\n\/dev\/nvme1n1p1                 vfat        5.0G   20M  5.0G   1% \/boot\/efi\n\/dev\/mapper\/vg02-home          ext4        246G   58G  176G  25% \/home\n\/dev\/mapper\/vg01-tmp           ext4         15G  2.2G   12G  16% \/tmp\n\/dev\/mapper\/vg01-var           ext4         49G  3.7G   43G   8% \/var\n\/dev\/mapper\/vg03-Virtual       ext4        916G  558G  319G  64% \/Virtual\n\/dev\/mapper\/vg01-ansible       ext4         15G  216M   14G   2% \/home\/dboth\/development\/ansible\n\/dev\/mapper\/vg04-VMArchives    ext4        787G  269G  478G  36% \/VMArchives\n\/dev\/mapper\/vg04-stuff         ext4        246G  110G  124G  47% \/stuff\ntmpfs                          tmpfs       6.3G  208K  6.3G   1% \/run\/user\/1000\ndboth@bunkerhill:\/var\/Pictures fuse.sshfs  458G   18G  417G   5% \/home\/dboth\/Pictures\ntmpfs                          tmpfs       6.3G  208K  6.3G   1% \/run\/user\/0\ntotal                          -           2.9T  1.1T  1.7T  39% -<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 4: The df command can be used to show the filesystem type along with totals.<\/p>\n\n\n\n<p>We can also use the -t option to display only the filesystems of a specific type such as EXT4. Most of the time this makes more sense than showing the virtual (temporary) filesystems and even the vfat and EFI filesystems. Figure 5 illustrates that this gives a more accurate picture of the usable storage space on the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>df -ht ext4 --total<\/strong>\nFilesystem                   Size  Used Avail Use% Mounted on\n\/dev\/mapper\/vg01-root        9.8G  1.6G  7.8G  17% \/\n\/dev\/mapper\/vg01-usr          59G   33G   23G  59% \/usr\n\/dev\/nvme1n1p2               4.9G  644M  4.0G  14% \/boot\n\/dev\/mapper\/vg02-home        246G   58G  176G  25% \/home\n\/dev\/mapper\/vg01-tmp          15G  2.2G   12G  16% \/tmp\n\/dev\/mapper\/vg01-var          49G  3.7G   43G   8% \/var\n\/dev\/mapper\/vg03-Virtual     916G  558G  319G  64% \/Virtual\n\/dev\/mapper\/vg01-ansible      15G  216M   14G   2% \/home\/dboth\/development\/ansible\n\/dev\/mapper\/vg04-VMArchives  787G  269G  478G  36% \/VMArchives\n\/dev\/mapper\/vg04-stuff       246G  110G  124G  47% \/stuff\ntotal                        2.3T  1.1T  1.2T  47% -<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 5: The <strong>df<\/strong> command showing only the EXT4 filesystems.<\/p>\n\n\n\n<p>Note that the <strong>df<\/strong> command shows only the filesystems that are mounted. Unmounted filesystems are ignored.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The dfc command<\/h3>\n\n\n\n<p>The relatively new <strong>dfc<\/strong> command shows much the same data as the df command, but also displays a simple graph to visualize the free vs used space on each filesystem. Figure 6 shows that it also allows you to use -t to specify the filesystem type to display, -T to display the filesystem type,  and -s to display usage sums on the bottom line.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>dfc -sTt ext4<\/strong>\nFILESYSTEM               TYPE       (=) USED      FREE (-)  %USED AVAILABLE  TOTAL MOUNTED ON\n\/dev\/mapper\/vg01-root    ext4       &#91;=====---------------]  20.9%      7.7G   9.7G \/\n\/dev\/mapper\/vg01-usr     ext4       &#91;=============-------]  61.0%     22.9G  58.8G \/usr\n\/dev\/nvme1n1p2           ext4       &#91;====----------------]  18.5%      3.9G   4.8G \/boot\n\/dev\/mapper\/vg02-home    ext4       &#91;======--------------]  28.5%    175.2G 245.0G \/home\n\/dev\/mapper\/vg01-tmp     ext4       &#91;=====---------------]  20.1%     11.6G  14.5G \/tmp\n\/dev\/mapper\/vg01-var     ext4       &#91;===-----------------]  12.7%     42.7G  48.9G \/var\n\/dev\/mapper\/vg03-Virtual ext4       &#91;==============------]  65.2%    318.5G 915.8G \/Virtual\n\/dev\/mapper\/vg01-ansible ext4       &#91;==------------------]   6.7%     13.7G  14.7G +oth\/development\/ansible\n+\/mapper\/vg04-VMArchives ext4       &#91;========------------]  39.3%    477.7G 786.4G \/VMArchives\n\/dev\/mapper\/vg04-stuff   ext4       &#91;==========----------]  49.6%    123.5G 245.0G \/stuff\nSUM:                                &#91;=========-----------]  44.1%      1.2T   2.3T<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 6: The dfc command displays a graph to help visualize free vs used space.<\/p>\n\n\n\n<p>On a color terminal, the <strong>dfc<\/strong> command displays the data in color. Options allow you to sort the output by filesystem type, name, or mount point; show inode information; to export the data in different formats such as JSON, CSV, HTML, text, and tex; to print the mount options for each filesystem; to display only local filesystems. Read the man page for details of these options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The duf command<\/h3>\n\n\n\n<p>The <strong>duf<\/strong> command, takes <strong>dfc<\/strong> even further with its advanced formatting. The results of the <strong>duf<\/strong> command with no options on my primary workstation are shown in Figure 7.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter is-resized\"><a href=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-01.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1140\" height=\"1030\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-01.png\" alt=\"\" class=\"wp-image-10329\" style=\"width:956px;height:auto\"\/><\/a><figcaption class=\"wp-element-caption\">Figure 7: The duf command displays disk usage statistics in a well defined and easily readable format. Click to enlarge.<\/figcaption><\/figure>\n\n\n\n<p>This cool and relatively new command displays storage statistics in tables that separate the storage device types into local, fuse (User space file storage), and special devices. Each type has it\u2019s own characteristics and use cases, so separating them in this manner makes sense.<\/p>\n\n\n\n<p>The local devices are logical volumes and partitions that provide the normal storage locations for our systems whether running or powered off. The fuse devices are usually remote storage. On my system the \/home\/dboth\/Pictures device is an SSHFS (SSH FileSystem) device that is on a remote system, the bunkerhill host in this case.<\/p>\n\n\n\n<p>The special devices are usually virtual filesystems that the host uses for tracking and managing every part of the running system. The common ones I think about are \/proc and \/sys.<\/p>\n\n\n\n<p>Like the <strong>df<\/strong> and <strong>dfc<\/strong> commands, the <strong>duf<\/strong> command has several options designed to allow you to filter the storage devices and filesystem types, such as EXT4 or VFAT, so that you only see the ones you are interested in. On the opposite extreme, when used with the <strong>-all<\/strong> option it shows devices that are normally not displayed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The lsblk command<\/h3>\n\n\n\n<p>I like the <strong>lsblk<\/strong> command because it provides much the same information as the df-style commands, and it also displays the hierarchical structure of the filesystems on your computer in a tree format. The other reason I like this tool so much, is that it not only displays mounted filesystems, it also displays the unmounted ones.  As you can see in Figure 8, this can help visualization of all the storage on your system no matter its mount state. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>lsblk<\/strong>\nNAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsda                      8:0    0 931.5G  0 disk\n\u2514\u2500vg03-Virtual         252:6    0 931.5G  0 lvm  \/Virtual\nsdb                      8:16   0   2.7T  0 disk\n\u251c\u2500vg04-stuff           252:8    0   250G  0 lvm  \/stuff\n\u2514\u2500vg04-VMArchives      252:9    0   800G  0 lvm  \/VMArchives\nsdc                      8:32   0   3.6T  0 disk\n\u2514\u2500sdc1                   8:33   0   3.6T  0 part\n  \u2514\u2500vg_Backups-Backups 252:7    0   3.6T  0 lvm\nsdd                      8:48   0   3.6T  0 disk\n\u2514\u2500sdd1                   8:49   0   3.6T  0 part\nsde                      8:64   0 465.1G  0 disk\n\u2514\u2500sde1                   8:65   0 465.1G  0 part\nsr0                     11:0    1  1024M  0 rom\nsr1                     11:1    1   668M  0 rom\nzram0                  251:0    0     8G  0 disk &#91;SWAP]\nnvme0n1                259:0    0 476.9G  0 disk\n\u2514\u2500vg02-home            252:2    0   250G  0 lvm  \/home\nnvme1n1                259:1    0 476.9G  0 disk\n\u251c\u2500nvme1n1p1            259:2    0     5G  0 part \/boot\/efi\n\u251c\u2500nvme1n1p2            259:3    0     5G  0 part \/boot\n\u2514\u2500nvme1n1p3            259:4    0 466.9G  0 part\n  \u251c\u2500vg01-root          252:0    0    10G  0 lvm  \/\n  \u251c\u2500vg01-usr           252:1    0    60G  0 lvm  \/usr\n  \u251c\u2500vg01-var           252:3    0    50G  0 lvm  \/var\n  \u251c\u2500vg01-tmp           252:4    0    15G  0 lvm  \/tmp\n  \u2514\u2500vg01-ansible       252:5    0    15G  0 lvm  \/home\/dboth\/development\/ansible<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 8: The <strong>lsblk<\/strong> command shows both mounted and unmounted filesystems.<\/p>\n\n\n\n<p>This command defaults to display of human readable sizes, the storage device as a whole in addition to the partitions and volumes on it, and the disk type. This is the only tool that shows this level of detail, and it makes the relationships between the devices and the device metastructures clearer than any of the others.<\/p>\n\n\n\n<p>The <strong>lsblk<\/strong> command also has numerous options for formatting the content of the displayed data such as ASCII or JSON. Other options allow display of different columns and to provide a simple list in a format similar to the <strong>df<\/strong>-like tools. You can also use <strong>lsblk -H<\/strong> to list all 71 of the available columns of data. There&#8217;s a huge amount of data available with this tool. <\/p>\n\n\n\n<p>Read the man page to get a full picture of the capabilities of this tool. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">BtrFS filesystems<\/h2>\n\n\n\n<p>So far, I&#8217;ve discussed my systems, on which I prefer an LVM and EXT4 filesystem configuration. But BtrFS is different. Although I typically <a href=\"https:\/\/www.both.org\/?p=8150\" data-type=\"link\" data-id=\"https:\/\/www.both.org\/?p=8150\" target=\"_blank\" rel=\"noreferrer noopener\">don&#8217;t use BtrFS<\/a>, It&#8217;s now the default for Fedora installations. In fact, it&#8217;s the only option for all Fedora installation images except the <a href=\"https:\/\/fedoraproject.org\/en\/server\/\" data-type=\"link\" data-id=\"https:\/\/fedoraproject.org\/en\/server\/\" target=\"_blank\" rel=\"noreferrer noopener\">Server Edition<\/a>, so we should be familiar with how that looks. <\/p>\n\n\n\n<p>I&#8217;ll use one of my VMs which uses the default filesystem configuration. It&#8217;s much simpler than my workstation, but you&#8217;ll see how a BtrFS filesystem looks. Figure 9 illustrates the results of the <strong>dfc<\/strong> command. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># dfc -T\nFILESYSTEM TYPE     (=) USED      FREE (-)  %USED AVAILABLE  TOTAL MOUNTED ON\n\/dev\/sda3  btrfs    &#91;=-------------------]   3.4%    239.6G 248.0G \/\ndevtmpfs   devtmpfs &#91;--------------------]   0.0%      5.9G   5.9G \/dev\ntmpfs      tmpfs    &#91;--------------------]   0.0%      6.0G   6.0G \/dev\/shm\ntmpfs      tmpfs    &#91;=-------------------]   0.0%      2.4G   2.4G \/run\ntmpfs      tmpfs    &#91;--------------------]   0.0%      1.0M   1.0M +ystemd-journald.service\ntmpfs      tmpfs    &#91;=-------------------]   0.0%      6.0G   6.0G \/tmp\n\/dev\/sda3  btrfs    &#91;=-------------------]   3.4%    239.6G 248.0G \/home\n\/dev\/sda2  ext4     &#91;=======-------------]  32.1%      1.3G   1.9G \/boot\ntmpfs      tmpfs    &#91;=-------------------]   0.0%      1.2G   1.2G \/run\/user\/980\ntmpfs      tmpfs    &#91;=-------------------]   0.0%      1.2G   1.2G \/run\/user\/0<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 9: Using the <strong>dfc<\/strong> command to look at a system with a BtrFS filesystem.<\/p>\n\n\n\n<p>Let&#8217;s get rid of the temp filesystems so we can see the EXT4 and BtrFS filesystems more easily. Multiple filesystem types can be listed, separated by commas.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>dfc -Tt ext4,btrfs<\/strong>\nFILESYSTEM TYPE     (=) USED      FRlsblkEE (-)  %USED AVAILABLE  TOTAL MOUNTED ON\n\/dev\/sda3  btrfs    &#91;=-------------------]   3.4%    239.6G 248.0G \/\n\/dev\/sda3  btrfs    &#91;=-------------------]   3.4%    239.6G 248.0G \/home\n\/dev\/sda2  ext4     &#91;=======-------------]  32.1%      1.3G   1.9G \/boot<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 10: Filtering only EXT4 and BtrFS filesystems.<\/p>\n\n\n\n<p>This makes it easy to see that the BtrFS filesystem is used for both root (\/) and \/home. Note that both have exactly the same total space as well as that of used and available. That tells us that both are subvolumes of the BtrFS volume on \/dev\/sda3.  <\/p>\n\n\n\n<p>That&#8217;s even more clear when we use <strong>lsblk<\/strong> in Figure 10. It lists all subvolumes under the same branch of the tree.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># <strong>lsblk<\/strong>\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsda      8:0    0  250G  0 disk\n\u251c\u2500sda1   8:1    0    1M  0 part\n\u251c\u2500sda2   8:2    0    2G  0 part \/boot\n\u2514\u2500sda3   8:3    0  248G  0 part \/home\n                                \/\nsr0     11:0    1 1024M  0 rom\nzram0  251:0    0    8G  0 disk &#91;SWAP]<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center has-small-font-size\">Figure 10: The lsblk utility clearly shows that the \/ and \/home directories are subvolumes of the BtrFS filesystem on \/dev\/sda3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parting thoughts<\/h2>\n\n\n\n<p>Knowing the way your data storage devices are configured and structured makes troubleshooting easier. The four tools we looked at in this article all provide important information that lets you build a picture of your storage devices. <\/p>\n\n\n\n<p>I prefer <strong>lsblk<\/strong> for its use of the tree structure to help visualization. But it doesn&#8217;t display disk usage without a bit of work, so I use <strong>dfc<\/strong> or <strong>duf<\/strong> for that. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a SysAdmin, I need to manage the filesystems on the hosts in my home lab. There&rsquo;s usually<\/p>\n","protected":false},"author":2,"featured_media":12550,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[100,890,169,5],"tags":[104,873,874,876,875,91,877],"class_list":["post-12542","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line","category-ext4","category-filesystems","category-linux","tag-command-line","tag-df","tag-dfc","tag-du","tag-dub","tag-linux","tag-lsblk"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/12542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12542"}],"version-history":[{"count":36,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/12542\/revisions"}],"predecessor-version":[{"id":12580,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/12542\/revisions\/12580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/12550"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}