hpr4348 :: Resizing the root partition on a PC
What happened when I hastily resized the root partition on my DEL Optiplex PC.
Hosted by MrX on Wednesday, 2025-04-02 is flagged as Explicit and is released under a CC-BY-SA license.
linux, GParted.
(Be the first).
Listen in ogg,
opus,
or mp3 format. Play now:
Duration: 00:09:59
Download the transcription and
subtitles.
general.
Background
It all happened when I noticed that a disk space monitor sitting in the top right hand side on my Gnome desktop was red.
On inspection I discovered that my root filesystem was 87% full.
The root partition was only 37GB in size which meant there was less than 4GB of space left.
When I thought back I remembered that my PC was running a bit slower than usual and that that the lack of space in the root partition could have been to blame.
I had some tasks that I wanted to complete and thought I’d better do something about the lack of space before it became an even bigger problem.
What happened
As per usual all this happened when I was short of time and I was in a bit of a hurry.
- Lesson one don’t do this sort of thing when your in a bit of a hurry.
Because I was in a hurry I didn’t spend time doing a complete backup.
- Lesson two do a backup.
My plan was to get some space back by shrinking my home partition leaving some empty space to allow me to increase the size of my root partition.
For speed and ease I decided to use Gparted as I have used this many times in the past.
Wikipedia article about Gparted
It’s not a good idea to try and resize and or move a mounted filesystem so a bootable live version of Gparted would be a good idea. The reason for this is that if you run Gparted from your normal Linux OS and the OS decides to write something to the disk while Gparted is also trying to write or move things on the disk then as you could imagine very bad things could and probably would happen.
I knew I had an old bootable live CDROM with Gparted on it as I had used this many times in the past though not for a few years. As I was short on time I thought this would be the quickest way to get the job done.
I booted up the live CD and setup the various operations such as shrinking the home partitions, moving it to the right to leave space for the root partition then finally increasing the size of the almost full root partition.
What I didn’t notice at the time is that there was a tiny explanation mark on at least one of the partitions. I probably missed this because I was in a hurry.
- Lesson three don’t rush things and be on the lookout for any error messages.
When I clicked the green tick button to carry out the operations it briefly seemed to start and almost instantly stopped saying that there were errors and that the operation was unsuccessful and something about unsupported 64 bit filesystems. At this point I thought / hoped that nothing had actually happened. My guess was that the old live Gparted distribution I was using didn’t support Ext4 though I could be completely wrong on this.
- Lesson four don’t use old versions of Gparted particularly when performing operations on modern filesystems.
Wikipedia article about the Ext4 filesystem
I removed the Gparted bootable CD and rebooted my PC. At this point I got lots of errors scrolling up the screen
I then got a message I’ve never see before from memory I think it said Journaling
It then said something about pass 1 pass 2 pass 3 and continued all the way to 5.
Then it talked about recovering data blocks.
At this point I got very nervous. I had all sorts of fears going through my head. I imagined I may have lost all the contents of my hard-rive. The whole experience was very scary.
I let it complete all operations and eventually my Ubuntu operating system came up and seemed okay.
I rebooted the PC and this time it booted correctly with no error messages and everting was okay.
I have often seen things said about Journaling filesystems and how good they are though until this point I had never seen any real examples of them repairing a filesystem.
Both my root and home partitions were EXT 4 and thankfully EXT 4 supports Journaling which I believe on this occasion saved me from a great deal of pain.
- Lesson five it might be a good idea to use Journaling filesystems.
Wikipdeai article about Journaling filesystems
This still left me with the original problem in that I had little free space on my root filesystems.
This time I decided to take my time and break the task up into smaller chunks and not to do it in one go.
First I downloaded the newest Live distribution version of Gparted
I performed the checksum test to make sure the download was successful with no errors.
The next day I tried to write it to a CD-ROM something I haven’t done for a very long time.
I initially couldn’t understand why I couldn’t click on the write button then I looked at my blank CD-ROM using the UBUNTU GNOME DISKS application. It reported that the disk was read only.
I did a bit of goggling and came across a post saying that they had come across this and that they solved this by installing the CD-ROM writing application Brasero.
Wikipedia article about Brasero )
Installing Brasero solved the problem and allowed me to write the image file to CD-ROM. I was actually surprised that it wasn’t installed as I’ve used this application in the past. Just goes to show how long it’s been since I’ve written anything to CD-ROM!
I booted the CD-ROM to check that Gparted worked and didn’t see any explanation marks on any of my partitions. I was short on time and didn’t want to rush things so decided to stop at this point.
Later on I popped the live bootable Gparted CD-ROM running version 1.6.0.3 AMD 64 version into my PC and booted it up.
Everything seemed okay and there were no errors showing.
I took my home partition SDA6 and shrunk it down by about 20 GB and then shifted it 20 GB to the right to the end of the disk.
This left a 20 GB gap at the end of my root partition.
I then increased the size of my root partition SDA5 by approximately 20 GB to fill the empty space.
It took Gparted about one hour and 40 minutes to complete all the operations.
The root partition is now reporting 61% full rather than 86% full.
The root partition is now approximately 53 GB in size with 31 GB used. 22 GB is now free which is a bit more comfortable.
Picture 1 Is a screenshot of GParted showing the new sizes of my root and home partitions.
I removed the GParted CD from my CD-ROM drive and rebooted the PC to thankfully find all was well and no errors reported.
Conclusion
My PC is now running more smoothly.
All I can say after all this is that I consider myself very lucky this time and I hope I learned some valuable lessons along the way.