0

I'm trying to find the full disk space of my whole disk. I used the df command and typed df -h and I saw my disk which is called sda however df only shows me the first partition for my sda disk which is sda1,

It shows the the available space and used space for sda1 but it does not show the unused/free disk space, why is this the case, why does it not show me my unused space and only my used primary partition from where my Debian machine is installed (sda1)?

However when i used a command such as cfdisk it showed me that I had '356GB' free but on df it does not show, so I'm pretty confused as to why it only shows sda1 and not the full information for my whole disk and not just one partition.

  • 2
    df will only ever show you free/used space on mounted partitions/filesystems. – Kusalananda Apr 27 at 18:01
  • How many partitions do you have? Try fdisk -l and post the output. df will only show disk usage of mounted partitions as said by @Kusalananda. – Abinash Dash Apr 27 at 18:29
2

History has made it so that df shows information about mounted filesystems.

And if you think about it, it all that makes sense. Some things that makes anything else hard:

  • there is no one-to-one relation between partitions and filesystems, you might have things like LVM
  • there might be other OS'es that have an opinion on what is on the disks
  • disks doesn't have to be local to be mounted

Of course you can define that you only care about certain things, but then you end up with a tool that someone will wonder why is the way it is, just like you wondered about df in this question.

0

df command shown partition mounted in your os . You can find Configuration file system mount in /etc/fstab . Your partition is unmounted For checking all partion please use :

lsblk

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.