How do I expand my disk after doing a permanent resize?

April 30, 2017 251 views
Deployment DigitalOcean Storage Arch Linux

Hi, I recently upgraded to the 40GB plan and I just realized that my hard drive space has not increased yet:

dev             999M     0  999M   0% /dev
run            1003M  368K 1003M   1% /run
/dev/vda3        20G   16G  2.7G  86% /
tmpfs          1003M     0 1003M   0% /dev/shm
tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
tmpfs          1003M  2.3M 1001M   1% /tmp
tmpfs           201M     0  201M   0% /run/user/1000

How can I resolve this?

3 Answers

Hi @chenshuiluke
Did you just upgrade CPU+RAM or did you upgrade CPU+RAM+Disk, where the process takes several minutes to complete?
It should expand automatically unless you've modified the partitions manually. But I don't know Arch, so maybe that process is manual.
Can check the DigitalOcean control panel, click the droplet for more information, and it should state the amount of RAM, disk space and region right under the droplet name in the top.

Hi @hansen, I upgraded cpu+ram+disk. It should be noted that my system was originally a Debian system but I used the Arch conversion script to convert it to an arch box. I checked in my control panel and it says it has 40GB.

  • @chenshuiluke Okay, then that's the reason why it didn't do it automatically.

    I would probably use parted to resize. I have no idea if it'll mess up data, so make sure you take a snapshot before messing with partitions.
    http://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/

    • Hey, thanks. I used parted to increase the size to 40GB:

      Number  Start   End     Size    File system  Name      Flags
       1      1049kB  7340kB  6291kB  ext4         DORoot
       2      7340kB  8389kB  1049kB               BIOSBoot  bios_grub
       3      8389kB  40.0GB  40.0GB  ext4         ArchRoot
      
      

      and rebooted, but df -h still says its only 20GB:

      Filesystem      Size  Used Avail Use% Mounted on
      dev             999M     0  999M   0% /dev
      run            1003M  360K 1003M   1% /run
      /dev/vda3        20G   16G  2.7G  86% /
      tmpfs          1003M     0 1003M   0% /dev/shm
      tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
      tmpfs          1003M  2.1M 1001M   1% /tmp
      tmpfs           201M     0  201M   0% /run/user/1000
      

@chenshuiluke

It's possible that the conversion script doesn't play well with the script(s) that DigitalOcean uses as I just test resized a 2GB Droplet to a 4GB Droplet and the disk increase took without any work on my end (other than powering on the Droplet).

Before

root@ubuntu-2gb-nyc2-01:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            993M     0  993M   0% /dev
tmpfs           200M   11M  190M   6% /run
/dev/vda1        39G  2.7G   36G   7% /
tmpfs          1000M     0 1000M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1000M     0 1000M   0% /sys/fs/cgroup
/dev/vda15      105M  3.6M  101M   4% /boot/efi
tmpfs           200M     0  200M   0% /run/user/0

After

root@ubuntu-2gb-nyc2-01:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           396M  5.6M  390M   2% /run
/dev/vda1        58G  2.7G   56G   5% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/vda15      105M  3.6M  101M   4% /boot/efi
tmpfs           396M     0  396M   0% /run/user/0

Parted should work, though I've only used Arch a handful of times in the past, so short of standard tools, such as Parted, it's hard to say what may be causing the issue.

Have another answer? Share your knowledge.