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

Result:

Disk /dev/sdb: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00051eb3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    52426752    26212352+  83  Linux

Step 2 – Checking the File System

Check the file system with:

# e2fsck -f -C0 /dev/sda1

Result:

e2fsck 1.42.5 (29-Jul-2012)
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/sdb1: 26283/1638400 files (5.6% non-contiguous), 283813/6553088 blocks

Step 3 – Resizing the File System

Resize the file system with:

# resize2fs /dev/sda1

Result:

resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sda1 to 24999680 (4k) blocks.
The filesystem on /dev/sda1 is now 24999680 blocks long.

Reboot and check if the disk is larger.

  • 149 Users Found This Useful
Was this answer helpful?

Related Articles

How to Configure Static IP Address on CentOS 7

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

How to Install XRDP Server (Remote Desktop) on Debian 11/12

1. Update and Upgrade Debian 11/12 apt update && sudo apt upgrade -y   2. Install the...

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 Configure Static IP address on Ubuntu 20.04

1. From the home page of your HayHost client area, click "SERVICES".   2. In the My Products...

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...