πŸ“˜ Repartitioning a VPS After an Upgrade (OVH)

If you have upgraded your VPS resources (e.g. disk space) but the new space is not showing up, you will likely need to repartition and resize the file system. This guide explains how to do it safely.

⚠️ Warning

Always back up your data before proceeding. This process modifies disk partitions and file systems.


βœ… Step 1: Reboot into Rescue Mode

  1. Go to the OVH Control Panel.
  2. Select your VPS.
  3. Navigate to Rescue Mode and reboot the VPS.
  4. Access your server via the rescue SSH credentials provided by OVH.

βœ… Step 2: Identify Your Disks

lsblk

Look for the upgraded disk (e.g. /dev/sdb1 or /dev/vdb1). Note the parent disk (e.g. /dev/sdb).


βœ… Step 3: Unmount and Check Filesystem

umount /dev/sdb1
e2fsck -yf /dev/sdb1

If the check passes without errors, proceed.


βœ… Step 4: Modify the Partition

Launch fdisk (replace sdb with your actual device):

fdisk -u /dev/sdb

Then follow this sequence:

  • p β†’ Print existing partitions
  • d β†’ Delete the partition (usually 1)
  • n β†’ Create new partition
    • Type: p (primary)
    • Number: 1
    • First sector: default (just press Enter)
    • Last sector: default to use all space (press Enter)
  • a β†’ Make it bootable (optional, if it was originally bootable)
  • w β†’ Write changes and exit

Ignore warnings like:

Partition #1 contains a ext4 signature. Do you want to remove the signature? [Y]es/[N]o:
Type n to not remove it.


βœ… Step 5: Resize Filesystem

For ext4:

resize2fs /dev/sdb1

For XFS (if applicable):

xfs_repair /dev/sdb1
mount /dev/sdb1 /mnt
xfs_growfs /mnt

ℹ️ If you’re unsure whether it’s ext4 or XFS, check with:

blkid /dev/sdb1

βœ… Step 6: Verify

Mount and check the space:

mount /dev/sdb1 /mnt
df -h /mnt

βœ… Step 7: Reboot Normally

Once verified, reboot your VPS back into normal mode using the OVH Control Panel.


βœ… References

Scroll to Top