Score:1

Cannot Use Whole Disk after Disk Upgrade on my VPS

in 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
Score:1
cn flag

You need to resize the filesystem to match the new disk size.

Assuming this is an EXT filesystem then there should be a command called resize2fs that will do it, but this is a potentially dangerous task and is normally best done when booted from a rescue system. Given this is a VPS that is unlikely to be possible so make sure you have a good backup before starting.

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.