[SOLVED]How to add unallocated space to ext4 root partition

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

[SOLVED]How to add unallocated space to ext4 root partition

Postby Rogviparoc on Sun Apr 21, 2013 1:03 pm

Hello everyone

Would you please consider the following problem: the family PC is using Linux Mint 10 that was installed after Win XP.
The root partition has become too small and I resized the logical partition (hosting my F:/ ("Data") drive under Win XP) and was able to free some 30Gb.

My question may seem stupid but I cannot figure out a way to add this to my ext4 partition; can somebody plesae advise me ?

Many thnaks in advance,

R.

Attached you will find a screenshot of Gparted and the results of running command "sudo blkid", "sudo fdisk -l" and "sudo parted -l print".
Image
Last edited by Rogviparoc on Sun Apr 28, 2013 2:56 am, edited 1 time in total.
Rogviparoc
Level 1
Level 1
 
Posts: 3
Joined: Sun Apr 21, 2013 12:51 pm

Linux Mint is funded by ads and donations.
 

Re: How to add unallocated space to my ext4 root partition

Postby mintybits on Sun Apr 21, 2013 3:33 pm

Hi. Yes, you can use the free space.
First step is to back up any crucial linux data just in case something goes terribly wrong. Best to do the same for Windows.

There are at least 2 ways to do this.

1) The simplest way - resize sda2
Boot a live linux CD and run GParted.
Use GParted to resize sda2, moving its start to the left to use the free space. This operation may take quite a long time so be patient and do not interrupt it or your linux partition will be trashed.
When finished, reboot and confirm linux boots.

2) The safer way, but more complicated - copy sda2, make sure the copy works and then delete the original
Boot a live linux CD and run GParted.
Use GParted to extend the extended partiton sda4 to the right...so that it contains the unallocated space.
Use GParted to copy & paste sda2 into the unallocated space inside the extended partition. The copy will be called sda6.
Change the UUID of sda2 so it is different from sda6. Otherwise Grub will get confused when trying to boot. In a terminal:
Code: Select all
sudo tune2fs -U random /dev/sda2

Now reboot into linux.
Confirm you are booted into the sda6 linux
Code: Select all
mount

Reinstall Grub for good measure
Code: Select all
sudo dpkg-reconfigure grub-pc

Then reboot and confirm all is ok.

Now you can boot live CD and run GParted and delete sda2 and extend the extended partition to the right and then extend sda6 to fill the unallocated space.

Option 2) is only worth the hassle if you haven't got an easy way to restore sda2 if anything goes wrong. This option allows you to change the UUID of sda2 back to what it was and then delete sda6 and have your original set-up. To see the UUIDs for your partitions use
Code: Select all
sudo blkid

To change sda2 UUID to a particular value:
Code: Select all
sudo tune2fs -U <uuid> /dev/sda2
mintybits
Level 5
Level 5
 
Posts: 884
Joined: Fri Jan 27, 2012 5:09 pm

Re: How to add unallocated space to my ext4 root partition

Postby Rogviparoc on Mon Apr 22, 2013 3:00 pm

Thank you very much for the detailed explanation.
I Will give it a try by next week-end (when I have plenty of time to mess things up :wink: )
I will keep you posted on this.
Rogviparoc
Level 1
Level 1
 
Posts: 3
Joined: Sun Apr 21, 2013 12:51 pm

Re: [SOLVED]How to add unallocated space to ext4 root partit

Postby Rogviparoc on Sun Apr 28, 2013 3:08 am

Here is what I did:
- I edited the profiles of the users so they might use backupmint;
- backup of every users data to a portable HDD with backupmint;
- I edited the profiles of the users back to their regular user's profile;
- I used the latest GParted disc to resize the root partition.

Gparted did the job beautifully and there was not a single problem when rebooting.

Image
Now Linux Mint 10 has enough space.

Thank you mintybits. :D
Rogviparoc
Level 1
Level 1
 
Posts: 3
Joined: Sun Apr 21, 2013 12:51 pm


Return to Newbie Questions

Who is online

Users browsing this forum: avtovaz, karlchen, Mute Ant and 32 guests