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:
- Uncomment the
/home
entry in/etc/fstab
. - Mount it manually:
mount /home
π Summary
Task | Command |
---|---|
Edit fstab | nano /etc/fstab |
Run filesystem check | e2fsck -f /dev/sda |
Resize filesystem | resize2fs /dev/sda |
Reboot system | reboot |
Check disk size | df -h |
(Optional) Mount /home | mount /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.
- First remount
/home
(or target mount point) temporarily:
mount /dev/sdb /home
- 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
Task | Command |
---|---|
Unmount /home (if mounted) | umount /home |
Remount /home | mount /dev/sdb /home |
Resize XFS partition | xfs_growfs /home |
View new size | df -hT |
Optional: Edit fstab | nano /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
, replacexfs_growfs
withresize2fs
.