netcup Disk Partition Expansion & Clean OS Reinstallation Guide (Debian, Ubuntu, Windows)

Key Facts
  • Partition Expansion Fix: Delete the trailing swap partition before running growpart /dev/vda 1 and resize2fs, then switch to a flexible /swapfile
  • Console Keymap Tip: Default VNC console images often use German QWERTZ (swapping Y and Z); run localectl set-keymap us to switch to US layout
  • KVM Virtio Requirement: Any custom OS or Windows image must include virtio storage and network drivers to boot on netcup KVM hosts
  • Architecture Rule: ARM64 instances (Ampere Altra) strictly require aarch64 images with UEFI boot support
  • Emergency Recovery: SCP Screen (HTML5 VNC) and Rescue Mode let you mount disks or reflash official images anytime
Table of Contents11 sections

Many engineers logging into a freshly deployed netcup VPS or Root Server are surprised when they run df -h: "I ordered a 128 GB or 256 GB server—why does my root filesystem / only show 20 GB?"

In addition, default images sometimes inherit a German QWERTZ console keyboard layout, and power users often prefer installing a minimal upstream Debian/Ubuntu setup or a custom Windows Server instance.

This guide covers non-destructive live partition resizing, fixing the common growpart NOCHANGE swap error, switching console keymaps, and performing clean OS installations via SCP ISO or automated netboot scripts.


1. Non-Destructive Partition Resizing: Reclaiming Unallocated Disk Space#

netcup's automated image deployment templates sometimes create a small base partition (10–20 GB) and leave the remaining disk capacity unallocated at the end of the virtual block device (/dev/vda or /dev/sda).

1. Inspect Your Current Partition Layout#

Run the following commands via SSH:

lsblk
df -h

Typical output on a conservative template:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0  128G  0 disk 
├─vda1 252:1    0   20G  0 part /
└─vda2 252:2    0    2G  0 part [SWAP]

Here, the virtual disk vda is 128 GB, but the root partition vda1 is only 20 GB, and vda2 ([SWAP]) sits directly behind vda1, blocking contiguous expansion!


2. Fixing the growpart NOCHANGE Error Caused by Trailing Swap#

If you run growpart /dev/vda 1 while vda2 sits immediately after vda1, growpart will fail with:

NOCHANGE: partition 1 could only be grown by 0 [fsize=..., end=..., max=...]

Why this happens: A partition can only expand into contiguous free sectors immediately following it. Because vda2 (swap) blocks the path, you must temporarily disable and remove vda2, expand vda1 to 100%, and replace the rigid swap partition with a modern /swapfile.

Safe Live Expansion Procedure (Zero Downtime)#

# 1. Disable active swap
swapoff -a

# 2. Comment out the old swap partition UUID in /etc/fstab so boot never hangs
sed -i.bak '/swap/s/^/#/' /etc/fstab

# 3. Install partition utilities
apt update && apt install -y cloud-guest-utils fdisk parted

# 4. Delete the blocking swap partition (partition 2)
fdisk /dev/vda <<EOF
d
2
w
EOF

# 5. Expand partition 1 into the newly freed contiguous space
growpart /dev/vda 1

# 6. Resize the filesystem online (use resize2fs for ext4, or xfs_growfs / for XFS)
resize2fs /dev/vda1

# 7. Verify that your root filesystem now spans the entire disk
df -h /

Recreate Swap Using a Modern /swapfile#

Instead of carving out a rigid partition at the end of the disk, create a standard Linux swapfile:

# Allocate a 2 GB swapfile with secure permissions
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

# Persist across reboots
echo '/swapfile none swap sw 0 0' >> /etc/fstab

2. Fixing the German Console Keyboard Layout (QWERTZ to US)#

When typing in the SCP HTML5 VNC Console (Screen), you may notice that pressing y outputs z and pressing - outputs /. This happens because the default console keymap is set to German (de).

Switch permanently to the standard US English (us) keyboard layout with one command:

localectl set-keymap us

Or inside a temporary rescue shell:

loadkeys us

3. Clean OS Installation: Custom ISO vs. Automated Netboot (InstallNET.sh)#

Whether you want a pristine upstream Debian 12 / Ubuntu 24.04 installation without vendor customizations or need to run Windows Server, you have two reliable paths on netcup:

  1. Official Way: Mount any custom ISO (Debian netinst, Alpine, Proxmox, FreeBSD, or Windows Server) under Media -> DVD Drive in the SCP Control Panel and complete the setup via the VNC screen.
  2. Automated Netboot Way: Run a community-verified automated netboot script directly from SSH.

Critical Prerequisites Before Reinstalling#

  1. Record Your Static Network Configuration:

Run ip addr and ip route show and save your:

  1. Mandatory KVM virtio Drivers:

netcup uses KVM virtualization with virtio-blk / virtio-scsi storage and virtio-net network interfaces. Any custom OS or Windows image must include virtio drivers, or the server will fail to detect its disk and NIC on boot.

  1. Match Your CPU Architecture:
    • AMD EPYC (x86_64 / amd64): Use standard amd64 images.
    • Ampere Altra (ARM64 / aarch64): Must use arm64 images with UEFI boot support.

1. Automated Clean Debian 12 / Ubuntu 24.04 Installation#

Using the widely audited leitbogioro/Tools netboot installer:

# 1. Install curl and wget
apt update && apt install -y curl wget

# 2. Download the installer script
wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux/InstallNET.sh' && chmod a+x InstallNET.sh

# 3. Boot into an automated clean Debian 12 installation
# Replace YourStrongPassword123! and customize the SSH port if desired
bash InstallNET.sh -debian 12 -pwd 'YourStrongPassword123!' -port 2222

2. Installing Windows Server (With Built-in virtio Drivers)#

While netcup does not ship pre-installed Windows templates, its dedicated-core Root Servers (RS G12.5) run Windows Server smoothly:

# Install Windows Server 2022 (includes KVM virtio storage & network drivers)
bash InstallNET.sh -windows 2022 -lang "en" -pwd 'YourStrongWindowsPass123!'

4. Emergency Recovery: What If a Reinstall Fails to Boot?#

If a custom image or network typo leaves your server unreachable via SSH:

  1. Log in to the Server Control Panel (SCP).
  2. Select your server and navigate to Rescue (Rescue System).
  3. Activate the 64-bit Linux Rescue System and restart the server.
  4. Connect via VNC or the temporary rescue SSH credentials to either:
    • Mount your root filesystem (mount /dev/vda1 /mnt) and fix /etc/network/interfaces or /etc/netplan/; or
    • Go to Media -> Images in SCP and reflash an official netcup Debian/Ubuntu image in under 2 minutes!
Partition Expansiongrowpart FixClean OS InstallWindows ServerKVM VirtioARM64