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 ?

  • 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? – Oscalation Feb 25 '16 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? – Oscalation Feb 25 '16 at 20:51
  • is blkid or lsblk the best, or something like fdisk -l ? – Oscalation Feb 25 '16 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. – sudodus Feb 1 at 9:18
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.

  • @Oscalation- If this answered your question, good practice to mark as *answered to preclude others revisiting a resolved issue. Thanks- T – F1Linux Feb 7 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.