by Fred on Thu Dec 18, 2008 3:53 pm
gychang and Shane,
Usually you would not be trying to increase the size of the root partition, if your data stores are isolated either in a separate /home partition or in one or more data partitions. Data is the thing that is hard to forecast, which grows and grows and grows. Your program complement can be reasonably forecast and planned for when laying out the partitioning in the beginning. So this would be a rare need.
Having said that, if you need to do what your example demonstrates I would suggest you use the latest stable version of the Gparted live cd iso partitioning program. We need to make a couple more assumptions here to make it complete. We will assume the first 3 partitions are primary partitions with the 10 Gig. being unallocated.
sda1 - swap - 1GB
sda2 - / - 8GB
sda3 - / 20GB
unallocated - 10GB
With Gparted you can shrink or grow partitions. Let's say you wished to add 5 Gig to the root partition. You would add 5 Gig of the unallocated space to sda3. You would then shrink sda3 by 5 Gig. putting the new unallocated space between sda2 and sda3. You would then grow sda2 by the 5 Gig of unallocated space now located between sda2 and sda3. Viola, your root partition is now 5 Gig. larger than when you started.
Please note that if you are using UUIDs, they will have changed on sda2 and sda3, so they will have to be corrected in your /etc/fstab file. Also, don't expect to accomplish this task in 5 or 10 min. The time required to do this depends on how much data you have on sda3, the speed of the hard drive, and the amount of installed RAM.
Fred
Insanity: Doing the same thing over and over and each time expecting a different result.
Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.