4

I am using df -h to get my disk space and the results are:

Filesystem     Size       Used     Avail  Use%   Mounted on
udev            2.0G       4.0K     2.0G   1%     /dev
tmpfs           396M       436K     395M   1%     /run
/dev/vda1       59G        3.6G     53G    7%     /
none            4.0K       0        4.0K   0%     /sys/fs/cgroup
none            5.0M       0        5.0M   0%     /run/lock
none            2.0G       12K      2.0G   1%     /run/shm
none            100M       12K      100M   1%     /run/user

and when I use sudo fdisk -l | grep Disk , I get:

Disk /dev/vda: 64.4 GB, 64424509440 bytes
Disk /dev/sda: 107.4 GB, 107374182400 bytes

Why doesn't df -h doesn't show space on /dev/sda? How can I see my total Disk space?

Melebius
  • 11,750

2 Answers2

10

df only cares about (mounted) filesystem, not any raw disk/partition.

If you follow the standard procedure to make a raw disk available to be used by userspace processes i.e. partition the device /dev/sda, and then format them using desired filesystem, and mount the filesystems, then the filesystems would obviously be shown by df.

heemayl
  • 93,925
0

To know the total disk space you could do something like this:

dmesg | grep sda

On my system it prints several lines. The interesting one is:

[19266.419331] sd 0:0:0:0: [sda] 272629760 512-byte logical blocks: (139 GB/130 GiB)

In this case, the size is 139 GB.

tejus
  • 1