How to Resize EXT Partition on Cloud Server

Step 1 – Preparations

Check the current partition table (it should look similar to this, depending on the model):

#fdisk -l /dev/sda

Step 2 – Checking the File System (optional)

Check the file system with:

# e2fsck -f -C0 /dev/sda2

Step 3 – Resizing the File System

Resize the file system with:

# echo 1 > /sys/block/sda/device/rescan && growpart /dev/sda 2 && partx -u /dev/sda && lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/sda2 

In case of LVM

# echo 1 >/sys/block/sda/device/rescan && growpart /dev/sda 2 && partx -u /dev/sda && pvresize /dev/sda2 && lvextend -r /dev/ubuntu-vg/ubuntu-lv /dev/sda2

 

Check if the disk is larger.

df -h


  • 9800 Users Found This Useful
Was this answer helpful?

Related Articles

How to buy a Virtual Server In HayHost

1. Go to the HayHost client area and click "Order New Services" in the bottom left corner....

How to Connect to Your Server via RDP on Windows 7

1. Օn your computer, access the "Start" menu, search for "Remote Desktop Connection" then click...

How to Connect to Linux Server via SSH on Windows

1. On your personal computer, navigate to the "Start" menu and type "cmd".   2. Type your IP...

How to Connect from one Linux Server to Another Using SSH

SSH is a secure way to connect to a Linux device remotely. This guide will provide you with the...

How to Configure Static IP Configuration on Windows 10

1. From the home page of your HayHost client area, click "SERVICES".   2. Select the server...