A tutorial on using GPartedaka Gnome Partition Editor.
Here I will use a VM (SLES 10 Sp4, no LVM) to expand the root “/” partition, currently installed on /dev/sda2
First… What is GParted? It is a tool built on a mini linux kernel you boot into (similar to another favorite tool of mine: clonezilla) that you can use to expand partitions.
Since the advent of using LVM, especially on linux, expanding a raw partition is a diminishing need. But for those that take care of legacy systems pre-LVM (e.g. Suse Linux Enterprise 10) or that just have systems installed without LVM, this definitely comes in handy.
(SIDE NOTE: If you have LVM, I have various LVM tutorials, e.g. reducing LVM disk size, adding hard drives and LVM on linux, and extending root partition with LVM)
Okay, let’s move on!
Here is a photo tutorial on using GParted!
GParted is a third party tool that will resize your partitions. No warranties!! So back up your data whether you copy files off or you clone your VM or clonezilla your server. Make sure you have a backup!
THAT BEING SAID …
anecdotally speaking I’ve used gparted mostly on VMs, probably 20 or 30 times, and on physical servers about 3 or 4 times (explained more at the end) and have not lost data
Using “fdisk -l” and “df -h” to see the current partitioning
In my VM, I will expand the disk from 8gig to 12gig
Load in my GParted .iso
Connect my VM CD drive
Reboot your VM
VM (or your server) will reboot into GParted
Choose default keymap1h>
Choose language (default for my US English)
Choose default mode (choice 0)
Choose the partition to resize (/dev/sda2), then click “Resize/Move”
Two Methods: 1) You can drag the slider on top, or 2) put in the actual number resize below
This is what it looks like after resize
Confirm and Click “Apply”
When finished, click “Close”
DOUBLE-CLICK (not Single-Click) on “Exit” in upper left
Choose “Reboot” and “OK”
Do Not Press “ENTER” yet, need to eject disc first
In VM, uncheck both boxes on top to “Eject” cd
Now press “ENTER” to reboot
Machine is rebooting
Using “fdisk -l” and “df -h” to see the new partitioning. Re-size already done. Note, no resize2fs needed or extending the partition needed as you would when extending an LVM.