πŸ“¦ Increase Disk Size on OVH Attached Storage

This guide will walk you through safely increasing the size of an attached OVH disk (typically /dev/sda or /home) by resizing the filesystem after extending the volume.


⚠️ Important Notes Before You Begin

  • Ensure you have a backup before performing disk operations.
  • This guide assumes the OVH volume is formatted with EXT4.
  • You will need root access.

πŸ”§ Step 1: Comment Out /home in /etc/fstab

To avoid mounting errors during resizing, temporarily disable auto-mount of /home:

Edit /etc/fstab:

nano /etc/fstab

Find the line like:

UUID=3417e176-6f5a-4cef-9641-27668b37e3ed /home ext4 errors=remount-ro,discard,usrjquota=quota.user,jqfmt=vfsv0 1 1

Comment it out by adding #:

#UUID=3417e176-6f5a-4cef-9641-27668b37e3ed /home ext4 errors=remount-ro,discard,usrjquota=quota.user,jqfmt=vfsv0 1 1

πŸ” Step 2: Run Filesystem Check

Before resizing, perform a forced check:

e2fsck -f /dev/sda

Sample output:

e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda: 2080946/100859904 files (0.1% non-contiguous), 370974139/403439616 blocks

πŸ“ Step 3: Resize the Filesystem

Once the check passes, resize the partition:

resize2fs /dev/sda

Sample output:

resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/sda to 537395200 (4k) blocks.
The filesystem on /dev/sda is now 537395200 blocks long.

πŸ” Step 4: Reboot the Server

Reboot to reload partition table changes:

reboot

βœ… Step 5: Verify Increased Disk Space

After reboot, verify:

df -h

Ensure the size reflects the expanded capacity.


🧩 Optional: Mount /home Again (if required)

If you previously commented out /home, and it’s on a separate partition:

  1. Uncomment the /home entry in /etc/fstab.
  2. Mount it manually:
mount /home

πŸ“ Summary

TaskCommand
Edit fstabnano /etc/fstab
Run filesystem checke2fsck -f /dev/sda
Resize filesystemresize2fs /dev/sda
Reboot systemreboot
Check disk sizedf -h
(Optional) Mount /homemount /home

Here is the XFS version of the guide to increase disk size on OVH attached storage:


πŸ“¦ Increase Disk Size on OVH Attached Storage (XFS Filesystem)

If your server uses an XFS-formatted filesystem (common on AlmaLinux, CentOS 7+, Rocky Linux, CloudLinux 9, etc.), follow this guide to safely expand your disk space after OVH resizes the attached volume.


⚠️ Requirements

  • Root SSH access to your server.
  • Disk resized in OVH control panel.
  • XFS filesystem in use (check with df -T).
  • No LVM setup (guide assumes direct block device like /dev/sdb is mounted to /home).

πŸ“ Step 1: Comment Out /home in /etc/fstab (If Applicable)

If /home is a separate mount point, comment it out before resizing:

nano /etc/fstab

Change this line:

UUID=3417e176-6f5a-4cef-9641-27668b37e3ed /home xfs defaults 0 0

To:

#UUID=3417e176-6f5a-4cef-9641-27668b37e3ed /home xfs defaults 0 0

Save and close.


🧹 Step 2: Unmount the Partition (If Mounted)

Run the following to unmount /home:

umount /home

If it’s busy, use:

fuser -vm /home

Then stop the processes using the partition.


πŸ”Ž Step 3: Check the Partition (Optional for XFS)

Unlike ext4, XFS does not require pre-check (xfs_repair is only needed in case of actual corruption).

You can still check with:

xfs_info /dev/sdb

Adjust /dev/sdb to your actual device name.


πŸ“ Step 4: Grow the Filesystem

Use xfs_growfs to expand the mounted XFS volume.

  1. First remount /home (or target mount point) temporarily:
mount /dev/sdb /home
  1. Then resize it:
xfs_growfs /home

Sample output:

meta-data=/dev/sdb              isize=512    agcount=4, agsize=32768000 blks
...
data blocks changed from 131072000 to 167772160

πŸ” Step 5: Restore /etc/fstab (if needed)

Uncomment the /home entry in /etc/fstab:

nano /etc/fstab

Remove the # in front of the line for /home.


πŸ”„ Step 6: Reboot (Optional)

Reboot to ensure everything mounts correctly:

reboot

βœ… Step 7: Verify Disk Size

After reboot or resizing:

df -hT

Confirm the increased size on /home or /.


πŸ“ Summary

TaskCommand
Unmount /home (if mounted)umount /home
Remount /homemount /dev/sdb /home
Resize XFS partitionxfs_growfs /home
View new sizedf -hT
Optional: Edit fstabnano /etc/fstab

Here’s a complete guide for increasing disk size on OVH attached storage using LVM and XFS, commonly used on modern cPanel and enterprise servers:


πŸ“¦ Increase Disk Size on OVH Attached Storage (LVM + XFS)

This guide assumes the extra OVH disk is attached, detected as a physical device (like /dev/sdb), and part of a Logical Volume (LVM) formatted with XFS (e.g., mounted at /home).


⚠️ Prerequisites

  • βœ… Root SSH access
  • βœ… Disk added via OVH control panel
  • βœ… XFS filesystem in use (df -T)
  • βœ… Volume managed by LVM (lsblk, vgs, lvs)
  • βœ… Backups made before continuing!

🧭 Step 1: Identify Devices and Volumes

Check disk layout:

lsblk

Typical output:

sda      8:0    0 100G  0 disk
β”œβ”€sda1   8:1    0 100G  0 part
β”‚ └─centos-root
sdb      8:16   0 500G  0 disk

You want to work with /dev/sdb.


πŸ’½ Step 2: Create a New Physical Volume

Format the new disk as a physical volume:

pvcreate /dev/sdb

πŸ“š Step 3: Extend the Volume Group

Add the new physical volume to your existing Volume Group (e.g., centos):

vgextend centos /dev/sdb

Verify:

vgs

πŸ“¦ Step 4: Extend the Logical Volume

Let’s assume /home is mounted from a logical volume like /dev/centos/home. You can confirm:

df -hT /home
lvdisplay

Now extend it using all free space:

lvextend -l +100%FREE /dev/centos/home

πŸ“ Step 5: Grow the XFS Filesystem

Finally, resize the filesystem:

xfs_growfs /home

Output should confirm new size applied.


βœ… Step 6: Verify the Result

Check disk usage and confirm /home is larger:

df -hT /home

You can also check the logical volume:

lvdisplay /dev/centos/home

πŸ“ Full Command Summary

lsblk
pvcreate /dev/sdb
vgextend centos /dev/sdb
lvextend -l +100%FREE /dev/centos/home
xfs_growfs /home
df -hT /home

πŸ“Œ Notes

  • Replace centos and /dev/centos/home with your actual VG and LV names if different.
  • If you use ext4, replace xfs_growfs with resize2fs.
Scroll to Top