0

I upgraded the disk size of my VPS from 20GB to 40GB. I cannot use this newly added 20GB. fdisk -l shows 40GB but du -h shows 20GB!

    root@ubuntu:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           385M  656K  385M   1% /run
/dev/sda1        19G   16G  2.5G  87% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           385M     0  385M   0% /run/user/0


root@ubuntu:~# fdisk -l
Disk /dev/sda: 38.2 GiB, 40961572864 bytes, 80003072 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: 0x7a5a5ba2

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     2048 80003038 80000991 38.2G 83 Linux
3
  • Conflict: /dev/sda1 * 2048 80003038 80000991 38.2G 83 Linux VS. /dev/sda1 19G 16G 2.5G 87% /
    – C2121
    Aug 24 at 9:11
  • The command you are looking for is probably sudo resize2fs /dev/sda1. But first study its man page. Aug 24 at 11:46
  • Right, I've posted your comment as the accepted answer.
    – C2121
    Aug 26 at 15:45
-1

FedonKadifeli's suggestion worked:

The command you are looking for is probably sudo resize2fs /dev/sda1.

1
  • Please improve this answer instead of doing just copy & paste. Edit the answer and explain step by step your experiences, for example. Aug 26 at 15:49

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.