2

When I run blkid I get

/dev/vda1   ...etc
/dev/vda2   ...etc

However, when I run df -h I do not see the second drive. I only see

/dev/vda1  ...etc 
/devtmpfs   ...etc 

Is this because df only shows file systems that are mounted, and the vda2 drive is not mounted? Can you help me understand the difference between the two and why df -h doesnt show the second drive vda2 ?

4
  • forgive me for a dumb question but, are you saying that, or the man page is insinuating that, since the drive is not mounted it has no name? Commented Feb 25, 2016 at 20:34
  • what is the prefered, or easiest method to list either all file systems, or something to show filesystems that are not mounted? Commented Feb 25, 2016 at 20:51
  • is blkid or lsblk the best, or something like fdisk -l ? Commented Feb 25, 2016 at 20:52
  • 1. df shows only mounted file systems; 2. Different tools are 'best' for different purposes, maybe you will find lsblk best for this particular purpose (to list all file systems and show if they are mounted). It will show all drives and partitions, not only those with file systems, but also a swap partition, an extended partition, and a partition that is not yet formatted. Commented Feb 1, 2019 at 9:18

2 Answers 2

2

From the relevant man pages:

"blkid - locate/print block device attributes"

"df - report file system disk space usage"

So df tells you about disk space usage of the filesystems on those block devices.

In response to your supplementary comments on your question, it's not that either is "best" per se, they are different tools.

1
  • @Oscalation- If this answered your question, good practice to mark as *answered to preclude others revisiting a resolved issue. Thanks- T Commented Feb 7, 2019 at 13:54
0

In short

  • df shows the mounted file systems and details about them
  • blkid shows the block devices (drives, partitions) that are found and details about them
  • lsblk can give you a good overview of both

    sudo lsblk -fm  # in a wide terminal window
    

or, if your terminal window is not wide enough, for example only 80 columns

    sudo lsblk -f
    sudo lsblk -m

or, if you want to skip some details,

    sudo lsblk -o model,name,size,fstype,label,mountpoint

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.