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


  • 149 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

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