LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Trouble Resizing Extended Partition - Gparted (http://www.linuxquestions.org/questions/linux-general-1/trouble-resizing-extended-partition-gparted-908152/)

natibo 10-14-2011 07:27 AM

Trouble Resizing Extended Partition - Gparted
 
I am having trouble resizing a partition. I have 3 partitions, 3 logical and one extended. I am not very experienced with partitions, but I like to install many different Linux OS's and play around with them. to date, i can only have 3 running in three logical partitions. I thought i understood that I could create extended partitions and have more. To do that I wanted to enlarge the size of by extended partition. Currently there is only one sub-partition in there, the linux swap. I was wondering if I needed to move one of the existing partitions to accomplish this. In order to help, I have attached a link to a snapshot I took when gparted was running.

https://picasaweb.google.com/lh/phot...eat=directlink

onebuck 10-14-2011 10:32 AM

Hi,

Welcome to LQ!

You have left unallocated 366GB space between drives. Your sda3 has 435GB of which 24GB is allocated. If you need to save all this then backup everything first before anything else is performed on the drive. That is if you need to save anything.

If sda3 filesystem is not needed then delete both sda2 and sda3. Then setup allocated space for your extended partition. The 'swap' space can be setup with the 'extended partition or as a primary. Notice below the first three primary partiton allocations then the '/dev/sda4' allocation(extended partition) with the logical(s) within.

I usually setup 'swap' on the second primary but you can place it within the extended as a logical partition.
Quote:

sample disk configuration;
~#fdisk -l

Disk /dev/hda: 122.9 GB, 122942324736 bytes
16 heads, 63 sectors/track, 238216 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 19842 10000336+ 83 Linux
/dev/hda2 19843 23811 2000376 82 Linux swap
/dev/hda3 23812 25796 1000440 83 Linux
/dev/hda4 25797 238216 107059680 5 Extended
/dev/hda5 25797 29765 2000344+ 83 Linux
/dev/hda6 29766 41671 6000592+ 83 Linux
/dev/hda7 41672 47671 3023968+ 83 Linux
/dev/hda8 47672 55609 4000720+ 83 Linux
/dev/hda9 55610 75451 10000336+ 83 Linux
/dev/hda10 75452 95293 10000336+ 83 Linux
/dev/hda11 95294 115135 10000336+ 83 Linux
Quote:

sample cfdisk of same drive;
cfdisk 2.12r

Disk Drive: /dev/hda
Size: 122942324736 bytes, 122.9 GB
Heads: 16 Sectors per Track: 63 Cylinders: 238216

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda1 Boot Primary Linux ext3 [site] 10240.38
hda2 Primary Linux swap 2048.39
hda3 Primary Linux ext3 [root] 1024.46
hda5 Logical Linux ext3 [home] 2048.39
hda6 Logical Linux ext3 [usr] 6144.64
hda7 Logical Linux ext3 [var] 3096.58
hda8 Logical Linux ext3 [tmp] 4096.78
hda9 Logical Linux ext3 [arc1] 10240.38
hda10 Logical Linux ext3 [arc2] 10240.38
hda11 Logical Linux ext3 [arc3] 10240.38
Logical Free Space 63521.62
Sure the above is for a '/dev/hda#' but things are applicable. You do not have too create partitions for other mounts but there are advantages to doing it this way. Of course your allocations will be for your install. Notice the free space at the end of the extended that can be allocated for additional logical partition(s).

You can do moves or copies with Qparted but I find using fdisk provides advantages of knowing the block allocations in case of problems in the future.

syg00 10-14-2011 06:50 PM

*Don't* be playing with partitions from the real system - use a liveCD.
Partitions (included the extended) can only be made larger if they have unallocated space contiguous to them. You have a few options.
- delete the swap and current extended (sda5 and sda2) and create the extended in the current free space. Add the swap back in and fix the fstab. Simple.
- as above, and move the sda3 to the right - will add the 7.8 Gig to the current unallocated.
- move sda3 all the way left to abut sda1. Extend sda2 to use all the (now contiguous) unallocated space. Has the advantage no other adjustments to swap/fstab are needed.

natibo 10-14-2011 07:24 PM

Thanks everyone for your help. I deleted all partitions but sda1 (my main Arch OS) created a 16GB swap on sda2 (2 x RAM) have sda3 for ubuntu and then created an extended partition to install many linux versions.


All times are GMT -5. The time now is 03:59 PM.