The Lazy Admin Blog

Home  /  CentOS • VMware  /  CentOS : Resize EXT4 Partition

CentOS : Resize EXT4 Partition

March 12, 2017 CentOS, VMware Leave a Comment

Hi All,

In this guide We will show how to resize an EXT4 partition using GParted & a VMware virtual machine.
GParted is a free partition editor for graphically managing your disk partitions.

Important Notes:

-During the process of increasing the disk, your server will need to be brought down.

-Increasing disk has the potential to cause a lot of damage. It’s very important to make a backup of your server, if you are using a virtual machine, make sure to take a snapshot before starting the process.

-The snapshot must be taken after increasing the disk, otherwise you will not be able to increase the disk until it has been removed

Download the GParted live CD ISO file from here

Ok, Let’s begin!

From our server let’s take a look on our disk file system:

Run the command:

df -h

We can see that our /home partition is in 100% Use! The /dev/sdb1 is associated to /dev/sdb. (We will configure the sdb device)

From the command:

fdisk -l

Make sure your device listed as “Linux” and it has the ID of 83. The 83 hex code shows that it is a Linux native partition.

We have the following details:

  1. We need to increase the /dev/sdb device
  2. Our /dev/sdb device had the ID of 83 hex code.
  3. The /dev/sdb device size is: 118GB
  4. The /dev/sdb device is in the second place on the list ( As shown from df -h command)

First, We need to increase the allocated disk space on the VM from the Vcenter\Vsphere Client

Before editing the VM, poweroff the VM gracefully.

Right clicking the virtual machine -> Edit Settings:

We have 4 Hard disks, From the above details we can know which hard disk we need to modify.

  • We know that our Hard disk size is 118 GB.
  • We know that /dev/sdb device is in the second place in the list from the df -h command.

So we will pick the second Hard disk that has 120 GB & is located in the second place.

You can see I added 40 GB to the hard disk:

Now we need to boot with the GParted disk:

Go to Option tab ->  Advanced -> Boot Options -> Check box: Force BIOS Setup

The next time the virtual machine boots, we will access into the BIOS setup screen.

We have to take a snapshot for a backup just in case of a failure:

Right click on VM -> Snapshot -> Take Snapshot

After the snapshot has been created, Power on the machine, you will access the BIOS setup screen.

Go the Boot tab and make sure the CD-Rom Drive at first in the order:

Now connect the GParted ISO:

After connecting the CD, save the configuration and exit (F12 in most cases)

Once the virtual machine has powered on and you have booted to the CD, Gparted menu will show up.

Press enter to boot into GParted Live (Default Settings).

 

Configuring console-data: accepted the defaults by pressing enter:

Select language, pressing Enter defaults to English:

Enter default option 0, to work with the GUI:

In the top-right corner, you can see all the hard disk devices available:

Choose our device (/dev/sdb):

We can now see that unallocated space:

Select /dev/sdb1 and click “Resize/Move” :

Drag the black arrow of /dev/sdb1 all the way to the end of the unallocated space and click the Resize/Move button:

Now click “Apply”

Accept the warning message, as we took a snapshot 😉

This may take a while….:

Completed! :

We just need to reboot the virtual machine:

Once the operating system has booted you can confirm that the disk space has expanded correctly:

fdisk -l

df -h

**  Don’t forget delete the Snapshot! :

Right click VM -> Snapshot -> Snapshot Manager… :

Delete:

Good Luck!

Previous Article
Next Article

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search Our Blog

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
Apache
CentOS
CloudLinux
cPanel
Emails
ESXI
iSCSI
JetBackup
Linux
Litespeed
MySQL
NGINX
Oracle
Reduxio
Security
SSL
Uncategorized
VMware
Wordpress
XEN

Tags

apache aspx backup bash CentOS cloudlinux cPanel CXS Emails freetds google htaccess IMAP InnoDB iscsi JetBackup Libmodsecurity litespeed modsec modsecurity mssql MySQL netapp nginx odbc Oracle php php.ini phpselector rsync ssh ssmtp systemd threads VMFS WHM Wordpress xenserver

Popular Posts

  • Convert JetBackup to cPanel structure October 6, 2022
  • How To Install & Configure a Galera Cluster with MariaDB on Centos 7 February 6, 2018
  • Allow a cPanel server to run a VHOST from multiple IP addresses April 3, 2018
  • rsync without prompting for password October 10, 2022

Recent Posts

  • Understanding Why More Threads Can Sometimes Slow Down Performance October 9, 2024
  • Set up a new systemd service May 18, 2024
  • Bash Arrays November 7, 2023
  • rsync without prompting for password October 10, 2022

Recent Comments

  • Sven on rsync without prompting for password
  • TheLazyAdmin on rsync without prompting for password
  • Sven on rsync without prompting for password
  • TheLazyAdmin on Convert JetBackup to cPanel structure
  • Chris on Convert JetBackup to cPanel structure
Privacy Policy • Contact