background

I upgraded my VPS from netcup, the server disk grows from 30 gb to 120 gb. And it’s not automatically added to you current using partition. The default disk has now a bigger size, but you need to manually resize your using partition.

to see your current partition with command:

➜  ~ sudo lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom
vda    254:0    0  120G  0 disk
├─vda1 254:1    0    2M  0 part
├─vda2 254:2    0    1G  0 part /boot
└─vda3 254:3    0   29G  0 part /

you see the total size of vda is 120G, while the existing partitions only used around 30G. My target is to enlarge the partition vda3 to 120G.

regarding the instructions from netcup, the current manual is not updated and it’s showing a wrong way to start the GParted software. Where in the past you can directly start the GParted software in Media -> DVD Drive, now you need to attach the right DVD to your system and restart the server with the right boot order.

steps to do

the basic idea is to reboot your VPS with the attached DVD inserted software: GParted, then in that software you can change your partition size easily.

  1. attach the DVD with GParted: go to the media -> dvd drive section in netcup scp web-interface, choose GParted Live CD xxx xxx is version. and click attach DVD
  2. change the server boot order: check the option set boot mode to DVD? in previous step, you can also go to the settings panel on the left menu and change the boot order there, just make sure the order in settings -> Boot Order is now with DVD-Rom at first
  3. restart the server: go to control on the left menu and click Powercycle
  4. wait a moment for the GParted software to start and go to the Screen on the left menu
  5. set up keyboard and language configurations. Now you have the web-interface to the server and if it’s started with the DVD, now it should show an old fashioned page to let you select your keyboard and language configurations. Just read the instruction and choose your preferences.
  6. use GParted to resize your partition: in the GUI now you can see your current partitions
    1. if it’s stuck trying to search for the partition, but showing you below a notification about found extra storage bla bla and you should optimize it bla bla, just click optimize or yes, and then your partitions will show up.
    2. choose and click your partition, for example here dev/vda2, and click partition on the top menu, then click Resize/Move gpart1
    3. now you can edit your storage with clear numbers: just enter your wished number into the new size sections and click the Resize/Move button, confirm one more time and you are done. gpart2
  7. clear up: now you need to detach the DVD in Media and change your boot order back to Hard Drive at first. Then you can restart your server again.

result

If you logged into your system, you can check the new partition is now available:

➜  ~ sudo lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom
vda    254:0    0  120G  0 disk
├─vda1 254:1    0    2M  0 part
├─vda2 254:2    0    1G  0 part /boot
└─vda3 254:3    0  119G  0 part /