Skip to content

Instantly share code, notes, and snippets.

@yorickdowne
Last active March 16, 2025 21:27
Show Gist options
  • Save yorickdowne/0f61c416c0445ebb0ac77b941d4810e0 to your computer and use it in GitHub Desktop.
Save yorickdowne/0f61c416c0445ebb0ac77b941d4810e0 to your computer and use it in GitHub Desktop.
How to resize a netcup VPS disk after contract upgrade

Resizing a netcup VPS disk after upgrading the contract to a bigger one

From the comments, this is possible without rescue mode in Linux.

Identify the root partition / with df -h and lsblk and then run something like the below. This one assumes the root partition is vda3; adjust for yours.

df -h output, this shows /dev/vda3 as the partition for /:

/dev/vda3       2.0T  1.9T   20G 100% /

lsblk output, which verifies that vda3 is the partition for /:

vda    254:0    0    3T  0 disk 
├─vda1 254:1    0    2M  0 part 
├─vda2 254:2    0    1G  0 part /boot
└─vda3 254:3    0    2T  0 part /

Assuming you created a non-root user, first grow partition 3, then resize the file system. If you are logged in as root, don't use sudo.

sudo growpart /dev/vda 3
sudo resize2fs -p /dev/vda3

Original Instructions

If live resize doesn't work for you or you're not running Linux, you can resize in rescue mode.

From Server Control Panel

Boot rescue image

  • Change boot order to network first: Settings -> Boot Order, Save
  • Control -> Shutdown. Use Forced Poweroff if Shutdown doesn't work.
  • Boot into rescue system: Media, "Rescue System" tab, Enable Rescue System. Take note of root pw
  • Control -> Start

Run gparted and resize disk

  • Connect to console: Screen, or from General, click on pic of it
  • Press Enter to get into shell
  • startx
  • Right-click into the empty workspace, choose Applications->Shells->Bash, then run gparted
  • OR, if that does not work, click "Show Keyboard", click "F2", then run gparted
  • Choose to "Fix GPT" by pressing Enter (left mouse click didn't work for me), then resize /dev/sda3 to full disk. You may need to use Tab and arrow keys to navigate so you can choose that partition and then choose to resize. Mouse works sometimes, haven't figured when it does and doesn't.
  • Apply and confirm, wait for gparted to do its work

Boot installed OS

  • Change boot order back to "Hard Disk" first: Settings -> Boot Order, Save
  • Control -> Powercycle
  • SSH into system
  • df -h to verify that GParted did its job
@Lyfhael
Copy link

Lyfhael commented May 31, 2023

Thank you very very much that was helpful !!

@chukwudibarrah
Copy link

chukwudibarrah commented Mar 11, 2024

Thanks for this! In the second section, the only option was to use -->Partition --> Check, then click on the green check mark to apply the changes. Editing to add that I was on Debian 11.

@Tackyou
Copy link

Tackyou commented May 19, 2024

or much easier on your linux server, no rescue mode required:

growpart /dev/vda 3
resize2fs -p /dev/vda3

adjust to your disk name, check with df -h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment