1

I have a dedicated server with Ubuntu Server 18.04 (256 RAM, 2x 240 GB SSD) and here's how the disk space allocation looks now:

Filesystem      Size  Used Avail Use% Mounted on
udev            126G     0  126G   0% /dev
tmpfs            26G  1.7M   26G   1% /run
/dev/md2        219G  145G   64G  70% /
tmpfs           126G   12K  126G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           126G     0  126G   0% /sys/fs/cgroup
/dev/loop0       90M   90M     0 100% /snap/core/7917
/dev/loop1      8.7M  8.7M     0 100% /snap/canonical-livepatch/88
/dev/md1        487M  146M  312M  32% /boot
tmpfs            26G     0   26G   0% /run/user/1000
Disk /dev/loop0: 89.1 MiB, 93454336 bytes, 182528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 8.5 MiB, 8941568 bytes, 17464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe5bc9ccf

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         4096   1050623   1046528   511M fd Linux raid autodetect
/dev/sda2         1050624 467808255 466757632 222.6G fd Linux raid autodetect
/dev/sda3       467808256 468854783   1046528   511M 82 Linux swap / Solaris


Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd0864b40

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         4096   1050623   1046528   511M fd Linux raid autodetect
/dev/sdb2         1050624 467808255 466757632 222.6G fd Linux raid autodetect
/dev/sdb3       467808256 468854783   1046528   511M 82 Linux swap / Solaris


Disk /dev/md1: 511 MiB, 535756800 bytes, 1046400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/md2: 222.6 GiB, 238979842048 bytes, 466757504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I got a little bit confused by the fact that device names shown by df -h don't match the ones in fdisk -l. Currently, I have access only to 1 SSD (/dev/md2) and I don't understand what the second SSD is used for and if (and how) it's possible to use disk space on it.

1

2 Answers 2

2

You are using a RAID1 system with two mirrored hard drives (sda and sdb). Where fdisk -l shows you the real physical disks and their partitions, df -h shows you the raid devices and partitions as they are used by the system.

I.e. /dev/md1 is made up from /dev/sda1 and /dev/sdb1 which both have the same contents. If either drive fails the data is secure on the other one.

To get more details about the raid device, use mdadm (assuming is was done by that):

mdadm --detail /dev/md1
1
  • 1
    Or the command cat /proc/mdstat will show more detail to the Metadisk RAID drives.
    – Terrance
    Nov 4, 2019 at 14:09
0

According to man df:

If  no file name is given, the space available on all
currently mounted file systems is shown. 

And in man fdisk:

-l, --list
    List the partition tables for the specified devices and then exit. If  no  devices are given, 
those mentioned in /proc/partitions (if that file exists) are used.

So the difference is tha df shows mounted systems while fdisk -l (with no arguments) shows the partitions listed in /proc/partitions

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .