1 (edited by _stranger_ 2011-05-29 18:29:12)

Topic: [SOLVED] Cannot expand partition/use all unallocated space

Hello,

I tried to expand my primary partition (sda1) so I shrink my largest partition (sda5) and move it to the right:
http://img33.imageshack.us/img33/1839/feh001752000001gparted.jpg

after that I moved my extended partition (sda2) to the left so my unallocated space is to the sda1:
http://img204.imageshack.us/img204/3760/feh001861000001gparted.jpg

but when I hit the apply button I get error:
http://img705.imageshack.us/img705/853/feh002332000001gparted.jpg

Am I doing something wrong?

After that I said ok... never mind... I will just take back everything like it was. I will expand sda5 to that unallocated space... but, when I try that I get 1,67 MiB of unallocated space!
http://img171.imageshack.us/img171/2024/feh002660000001gparted.jpg

Why I cannot use all unallocated space?

2

Re: [SOLVED] Cannot expand partition/use all unallocated space

You might try using "align to cylinder" if that is how your drive was originally set up.

If your first partition begins on sector 63, then it is cylinder aligned.

3

Re: [SOLVED] Cannot expand partition/use all unallocated space

If I use "align to cylinder" its even worse. I get 2 small unallocated spaces.
One before and one after sda5.

When I try to expand sda1:
http://img193.imageshack.us/img193/8956/feh002119000001gparted.th.jpg

When I try to expand sda5:
http://img810.imageshack.us/img810/6169/feh003676000001gparted.th.jpg

4

Re: [SOLVED] Cannot expand partition/use all unallocated space

There are 3 rounding options in late GParted versions: round to cylinder, round to MiB, no round at all.
Which of them did you initially used?
Furthermore, unallocated spaces of 1.67MiB are really small parts. Graphics show them pretty big, but they are small: Mib, not GiB.
1 cylinder is about 8 MiB.

53370880 sectors seems to be the start of /dev/sda2 in the second image.
You can try to resize the partitions by one at the time (without scheduling sevaral operations).
If the problem persists, you could provide the output of the command
sudo fdisk -lu
in the terminal. This ouput gives partition details in a sector number format, that is more precise than the default cylinder format.
All these small "unallocated" seem to be related to the rounding options.
Perhaps you don't have the initial partition details kept after these resizing operations (unless you didn't apply any change).

I'd like to remind the need of the backup. Exprerienced users and professionals do it always. smile

*** It is highly recommended to backup any important files before doing resize/move operations. ***

5

Re: [SOLVED] Cannot expand partition/use all unallocated space

If the extra unallocated space is really bothering you, you might consider growing the prior partition to use the unallocated space.  That way you will not need to move the start of any partitions with perhaps the exception of the extended partition.

6

Re: [SOLVED] Cannot expand partition/use all unallocated space

class413 wrote:

There are 3 rounding options in late GParted versions: round to cylinder, round to MiB, no round at all.
Which of them did you initially used?
Furthermore, unallocated spaces of 1.67MiB are really small parts. Graphics show them pretty big, but they are small: Mib, not GiB.
1 cylinder is about 8 MiB.

Initially I have used MiB. I know that 1,67 MiB is really small but It’s just annoying, nothing more. I like clean partition tables smile

class413 wrote:

53370880 sectors seems to be the start of /dev/sda2 in the second image.
You can try to resize the partitions by one at the time (without scheduling sevaral operations).

I was thinking about that but I am afraid that I will get stuck with those small chunks of unallocated space.

gedakc wrote:

If the extra unallocated space is really bothering you, you might consider growing the prior partition to use the unallocated space.  That way you will not need to move the start of any partitions with perhaps the exception of the extended partition.

That was my intention in first place but like I said in my first post, for some reason I cannot move extended partition (sda2) to the right (picture 3) in order to move unallocated space next to primary partition (sda1) to expand it.

7 (edited by class413 2011-05-24 21:56:39)

Re: [SOLVED] Cannot expand partition/use all unallocated space

If you didn't apply any operation, the hard drive partitions must retain the initial size and location.
It seems that late mswindows use the MiB partition borders, instead of cylinders that was the previous/legacy preference.
In the case of extended/logical partitions, the sectors located in the same disk track as the extended boot record (the first sector of the extended partition) can't be part of any logical partition. This means that in the round-to-cylinder model there are 62 unused sectors between the extended boot record and the first logical partition. So, more precision is needed in the partition size. 0.01GiB is something like 20972 disk sectors.
That's why I recommended
sudo fdisk  -lu

*** It is highly recommended to backup any important files before doing resize/move operations. ***

8

Re: [SOLVED] Cannot expand partition/use all unallocated space

Here is output from "fdisk -lu":

http://img545.imageshack.us/img545/5296/feh002509000001fdisk.jpg

btw... thank you guys for helping me smile

9

Re: [SOLVED] Cannot expand partition/use all unallocated space

I'm affraid there is a problem with the hard drive geometry.
The 2nd line "16 heads, 63 sectors, etc" is what we call the disk geometry. It is in reality something from the first hard drive era in the IBM PC (early 1980's ) for the MFM type hard drives. Unfortunately it remains even now, in the era of the 2-3TB hard drives. The operating systems since 2000 don't take it seriously into account, but it could cause problems to the BIOS access to the hard drive (i.e. some bootloaders, including the win xp bootloader) and perhaps some hard drive tools.
Usual value for hard drives is 255 heads, and sometimes 240 heads. However, the value 16 heads is given here, and the start sectors of the partitions are in fact located in x16 multiple positions (the first partition is an exception).

If you are interrested on these "geometry" questions, you can give a look at this article, or do a google search for "C/H/S disk geometry".


You could try to move the start of /dev/sda2 so that it goes at 16128 sectors before the start of /dev/sda5, with "round to nothing".
This is multiple of 16, and is larger that 255x63, that is the cylinder size in the 255-head geometry.
This means that you have to increase the "empty space before" value by 3464800 sectors, with no change in the space after value.
The new start sector will be 53354752.
After this, the system doesn't have to show anything changed, because the filesystems remain all the same. You can verify if anything works as previously.
If the error message persists, try to reduce the empty space before value.

In a second step, you can grow the /dev/sda1 ntfs partition, always with round to nothing. Then, you can try to move the right border of the partition only, to take the unallocated space. It shouldn't be very long to complete.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

10

Re: [SOLVED] Cannot expand partition/use all unallocated space

It worked!! smile

I have just used “round to nothing” and managed to move /dev/sda2 to the right but I didn’t use anything else. I must be honest and say I was trying to do like class413 said but I didn’t know how to move partition at some exact location given in sectors big_smile
So, after couple of unsuccessful attempts I was about to give up and I said let me try just “round to nothing” since I used other two options but I have never tried “round to nothing”… I don’t know why… maybe because of this “nothing”… it sounds like it will do nothing smile)) 
And there it was… SUCCESS! smile

Thank you guys a lot.

P.S.
Do you want me to mark this topic as solved?

11

Re: [SOLVED] Cannot expand partition/use all unallocated space

If the problem is solved for you, then yes please to edit the initial post and prefix "SOLVED" in front of the title.  This can help other users searching with similar problems.