Score:0

Cannot Use Whole Disk after Disk Upgrade

br flag

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
br flag
Conflict: `/dev/sda1 * 2048 80003038 80000991 38.2G 83 Linux` VS. `/dev/sda1 19G 16G 2.5G 87% /`
FedKad avatar
cn flag
The command you are looking for is probably `sudo resize2fs /dev/sda1`. But first study its `man` page.
br flag
Right, I've posted your comment as the accepted answer.
Score:-1
br flag

FedonKadifeli's suggestion worked:

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

FedKad avatar
cn flag
Please improve this answer instead of doing just copy & paste. [Edit] the answer and explain step by step your experiences, for example.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.