Ubuntu show wrong disk sizes, how to solve it?

7,024

Solution 1

It looks like that you have made raid1 (mirror) between partitions on your SSD and HDD. This is not best practice, since it more or less restricts performance to that of the slowest disk.

You can see that /boot, / and [ SWAP ] is defined on partitions on both /dev/sda and /dev/sdb.

sdb       8:16   1 238.4G  0 disk
├─sdb2    8:18   1   512M  0 part
│ └─md1   9:1    0 511.4M  0 raid1 /boot
├─sdb3    8:19   1 229.9G  0 part
│ └─md2   9:2    0 229.8G  0 raid1 /
└─sdb1    8:17   1     8G  0 part
  └─md0   9:0    0     8G  0 raid1 [SWAP]
sda       8:0    1   2.7T  0 disk
├─sda2    8:2    1   512M  0 part
│ └─md1   9:1    0 511.4M  0 raid1 /boot
├─sda3    8:3    1 229.9G  0 part
│ └─md2   9:2    0 229.8G  0 raid1 /
└─sda1    8:1    1     8G  0 part
  └─md0   9:0    0     8G  0 raid1 [SWAP]

I would recommend that you reinstall Ubuntu using only SSD for /boot, / and SWAP. If you really want a raid1/mirror setup, you should buy one more 240 GB SSD, so you mirror between similar type and size disks.

Anyway, if you take a look at your disks with gparted (or fdisk -l) you should see a huge unallocated amount of data on /dev/sda.

Solution 2

The reason why your "3,0 TB" drive (sda) shows up as 2.7T is most likely due to different units being used.

The size is probably about 2.7 Tebibyte, which is approximately the same as 3.0 TB.

You can read about it here: https://en.wikipedia.org/wiki/Tebibyte

Solution 3

lsblk shows all disk partitions, while df -lh only shows your mounted partitions.

Share:
7,024
Lex Thoonen
Author by

Lex Thoonen

Updated on September 18, 2022

Comments

  • Lex Thoonen
    Lex Thoonen over 1 year

    I have a server with these characteristics:

    CPU: Intel Core i7-2600
    PLUSRAID Controller 4-Port SATA PCI-E - Adaptec 5405
    One each, SATA SSD, 240 GB
    Two each, SATA HDDs, 3.0 TB Enterprise
    Two each, 8 GB DDR3 RAM

    I installed Ubuntu on it, but it shows the space such as this, far less than the true capacity:

    root@ns1 /boot # lsblk
    NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    sdb       8:16   1 238.4G  0 disk
    ├─sdb2    8:18   1   512M  0 part
    │ └─md1   9:1    0 511.4M  0 raid1 /boot
    ├─sdb3    8:19   1 229.9G  0 part
    │ └─md2   9:2    0 229.8G  0 raid1 /
    └─sdb1    8:17   1     8G  0 part
      └─md0   9:0    0     8G  0 raid1 [SWAP]
    sda       8:0    1   2.7T  0 disk
    ├─sda2    8:2    1   512M  0 part
    │ └─md1   9:1    0 511.4M  0 raid1 /boot
    ├─sda3    8:3    1 229.9G  0 part
    │ └─md2   9:2    0 229.8G  0 raid1 /
    └─sda1    8:1    1     8G  0 part
      └─md0   9:0    0     8G  0 raid1 [SWAP]
    

    and

    root@ns1 /boot # df -lh
    Filesystem      Size  Used Avail Use% Mounted on
    udev            7.8G     0  7.8G   0% /dev
    tmpfs           1.6G  5.3M  1.6G   1% /run
    /dev/md2        226G   17G  198G   8% /
    tmpfs           7.8G     0  7.8G   0% /dev/shm
    tmpfs           5.0M     0  5.0M   0% /run/lock
    tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
    /dev/md1        488M  176M  287M  38% /boot
    tmpfs           1.6G     0  1.6G   0% /run/user/0
    
    

    I don't seem to be using all the space available on the sda disk at all, the two 3 terabytes disks.

    What am I doing wrong?

    Thanks!

  • Lex Thoonen
    Lex Thoonen almost 5 years
    Thank you, but still, it seems like this I only have access to 230 GB, it would be nice if I could use the 2.7 TB
  • Terrance
    Terrance almost 5 years
    @LexThoonen You do have access to 240GB. Run dmesg | grep blocks in a terminal and you will see something like [ 3.989812] sd 4:0:0:0: [sde] 468862128 512-byte logical blocks: (240 GB/224 GiB) which shows that you are seeing the GiB of the drive and not the GB. The 3TB drive shows up like [ 3.462108] sd 10:0:0:0: [sdb] 732566645 4096-byte logical blocks: (3.00 TB/2.73 TiB)
  • Soren A
    Soren A almost 5 years
    Don't do that .. sda2 seems to be a part of a raid1 (mirror) ...
  • BeastOfCaerbannog
    BeastOfCaerbannog almost 5 years
    You are right. I removed the example.
  • Richie Frame
    Richie Frame almost 5 years
    It also looks like sda is a hardware raid mirror, in addition to THAT being a mirror of sdb.