1 (edited by dj_mixmaster_2000 2010-12-02 09:05:33)

Topic: trying to grow primary partition - unable to shrink extended parttion

I have a  problem that I cannot find anywhere in the forum. I have found solutions that were close but they do not seem to work out.  I am following the instructions that are stated in this url - http://gparted.sourceforge.net/larry/tips/gfs.htm

I get to the step before the last where the user actually shrinks the whole extended partition after shrinking the logical partition and taking some unused space and transforming it to unallocated space then moving it to the right.  When I attempt to move the beginning of the extended partition to where I want it , to free the unallocated space out of the extended partition, I get an error that prevents me from going further.  Because of this I am unable to grow the main primary NTFS boot partition.  I am using Gparted version 0.7.0-4 on the live bootable CD.Here is the file gparted_details.htm  says:

GParted 0.7.0

Libparted 2.3
Move /dev/sda2 to the right and shrink it from 27.48 GiB to 19.62 GiB  00:00:00    ( ERROR )
        
calibrate /dev/sda2  00:00:00    ( SUCCESS )
        
path: /dev/sda2
start: 20482875
end: 78123007
size: 57640133 (27.48 GiB)
shrink partition from 27.48 GiB to 19.62 GiB  00:00:00    ( ERROR )
        
old start: 20482875
old end: 78123007
old size: 57640133 (27.48 GiB)
libparted messages    ( INFO )
        
Unable to satisfy all constraints on the partition.
Can't have the end before the start! (start sector=36968448 length=0)

========================================



Here is a screenshot:

http://desmond.yfrog.com/Himg718/scaled.php?tn=0&server=718&filename=gpartedscreen.jpg&xsize=640&ysize=640

2

Re: trying to grow primary partition - unable to shrink extended parttion

Something strange certainly seems to be going on here.  In order to try to recreate the problem here, would you be able to provide the following?

1)  The output from the following command:

fdisk -l -u

where one of the options is a lower case "L" and not the number one.


2)  The contents of the sda-dj.out file after running the following command:

sfdisk -d /dev/sda > sda-dj.out

where one of the options is a lower case "L" and not the number one.


This will help me to try to recreate the problem you are experiencing.

3

Re: trying to grow primary partition - unable to shrink extended parttion

here is a screenshot that I took of the output of the cmd fdisk -l -u :

http://desmond.yfrog.com/Himg259/scaled.php?tn=0&server=259&filename=gpartedcmdscreen.jpg&xsize=640&ysize=640





here is the output of the file of the sda-dj.out file:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=       63, size= 20482812, Id= 7, bootable
/dev/sda2 : start= 20482875, size= 57640133, Id= f
/dev/sda3 : start=        0, size=        0, Id= 0
/dev/sda4 : start=        0, size=        0, Id= 0
/dev/sda5 : start= 36968448, size= 41154560, Id= 7

4

Re: trying to grow primary partition - unable to shrink extended parttion

Another thing I forgot to mention:

I may have messed with the partitions with ver. 0.6.2 of the gparted live CD.  I can't remember if I did any edits or not with that version, because I put back everything the way it was at least 3 times using the new edition.   Most of my work was done with the latest 0.7.0-4 edition.  I had trouble booting into the older version because the CD was dirty, so I made a new CD with the newest Gparted edition.

5

Re: trying to grow primary partition - unable to shrink extended parttion

Thanks for the extra info.  I will try to recreate the problem tomorrow.

6

Re: trying to grow primary partition - unable to shrink extended parttion

Unfortunately I have been unable to recreate the problem.

For testing I used the sda-dj.out file you provided and changed "sda" to "sdd" to work with my 160 GB test drive.  I then formatted both sdd1 and sdd5 with the NTFS file system.  Every time I try moving the left edge of the extended partition sd2 to butt up against sdd5, applying the operation succeeds.  This worked for both "align to MiB" and for "align to Cylinder".

Following is the log file from the move using "align to Cylinder"

GParted 0.7.0

Libparted 2.3
Move /dev/sdd2 to the right and shrink it from 27.48 GiB to 19.63 GiB  00:00:00    ( SUCCESS )
         
calibrate /dev/sdd2  00:00:00    ( SUCCESS )
         
path: /dev/sdd2
start: 20482875
end: 78123007
size: 57640133 (27.48 GiB)
move partition to the right and shrink it from 27.48 GiB to 19.63 GiB  00:00:00    ( SUCCESS )
         
old start: 20482875
old end: 78123007
old size: 57640133 (27.48 GiB)
new start: 36966400
new end: 78125055
new size: 41158656 (19.63 GiB)

========================================

There must be something else I am missing.

I noticed from your screen shot that there is an exclamation point beside /dev/sda1.  When you double click on the partition, does it say that you need to run "chkdsk /f" from Windows?

If so, could you boot into Windows to do this?

Also could you retry the resize again using the GParted 0.7.0-4?

7 (edited by dj_mixmaster_2000 2010-12-04 13:02:52)

Re: trying to grow primary partition - unable to shrink extended parttion

Here is the screenshot of that exclamation mark.

http://desmond.yfrog.com/Himg11/scaled.php?tn=0&server=11&filename=gparted2screen.jpg&xsize=640&ysize=640

I knew I had to run chkdsk.  Before I even worked on these partitions, I deleted unimportant data and tmp files, etc.  I took out the page file. I then did a disk defrag on both partitions and ran chkdsk on both partitions. I did not use /f or /r options though. I used the gui in windows Safe Mode and did a right click properties on the drive and went to the tools tab, clicked on check now.. button and checked both boxes . one was for Automatically fix file system errors and the other one was Scan for and attempt recovery of bad sectors.  The two chkdsk scans seemed like they went ok. But I noticed that informational warning window as well.  So I then also used spinrite on level 5 to correct any errors. The spinrite scan did the primary partition, the unallocated space, and the partition with data in it.  it didn't seem like it picked up anything bad.  I don't have any logfiles on the 2 different scans. They did not take too long either.  I have been attempting to resize that extended partition with the new 0.7.0-4 version this whole time.

I accidentally booted into the machine without the Gparted CD in there and the machine went straight into windows and before it went into the login screen, it attempted to do a chkdsk. I stopped it right away, because it stated something about the space on the D: drive; this was after I made the free space and it turned into unallocated space in the middle.

I also noticed the error:
Can't have the end before the start! (start sector=36968448 length=0)

when i shutdown the machine from the gparted live CD, I'll see this message repeatedly thrown out to the screen. what is the significance of this error?

If I do run a chkdsk from Windows, as you requested, or it automatically goes into a chkdsk when I attempt to boot into windows, will things matter if the unallocated space is in the middle like that.  Would I have to put things back to the way they were first, then do the chkdsk. And the informational warning message is for the primary partition, this is something that I never touched.  The only partition I messed with was the extended partition, by shrinking a logical partition to create some unallocated space, then moving the logical partition to the right to have the unallocated space in the middle.

I also forgot to add the fact that I have a registry setting in windows to always clear the virtual memory every time the machine resets or shuts down.  This registry setting was set at install in the answer file created by the program called nlite. I don't know if this has anything to do with my issue , but I just wanted to make sure you guys know.  Also, before I even did the actual windows install, the 2 partitions were setup via Gparted version 0.6.2.  This was the other live CD I had previously. I created the primary partition as NTFS and the Extended partition as NTFS and formatted accordingly with Gparted.  Then the Windows install disc reformatted the primary partition as NTFS and left the second partition as is as NTFS formatted from Gparted.

8

Re: trying to grow primary partition - unable to shrink extended parttion

Hmm... it is possible that the option to overwrite the swap file before shutting down might cause GParted to display the exclamation point beside the first partition.  This should not impact trying to resize the extended partition.

I am still unsure as to what is causing the problem with shrinking the extended partition.  Perhaps you might try shrinking the extended partition but leaving about 8 MiB of space before the start of /dev/sda5?

9

Re: trying to grow primary partition - unable to shrink extended parttion

Ok. that 8 MB trick worked, but I am now having a separate problem. Here is what I got after the 8 MB trick:

http://desmond.yfrog.com/Himg577/scaled.php?tn=0&server=577&filename=gparted3screen.jpg&xsize=640&ysize=640



Here is the gparted details from that action:

GParted 0.7.0

Libparted 2.3
Move /dev/sda2 to the right and shrink it from 27.48 GiB to 19.63 GiB  00:00:01    ( SUCCESS )
        
calibrate /dev/sda2  00:00:00    ( SUCCESS )
        
path: /dev/sda2
start: 20482875
end: 78123007
size: 57640133 (27.48 GiB)
shrink partition from 27.48 GiB to 19.63 GiB  00:00:01    ( SUCCESS )
        
old start: 20482875
old end: 78123007
old size: 57640133 (27.48 GiB)
new start: 36952064
new end: 78123007
new size: 41170944 (19.63 GiB)

========================================


Then when I attempted to grow the primary partition I came across an error. Here are the gparted details file info:

GParted 0.7.0

Libparted 2.3
Grow /dev/sda1 from 9.77 GiB to 17.62 GiB  00:00:05    ( ERROR )
        
calibrate /dev/sda1  00:00:00    ( SUCCESS )
        
path: /dev/sda1
start: 63
end: 20482874
size: 20482812 (9.77 GiB)
check file system on /dev/sda1 for errors and (if possible) fix them  00:00:05    ( ERROR )
        
ntfsresize -P -i -f -v /dev/sda1
        
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 10487198208 bytes (10488 MB)
Current device size: 10487199744 bytes (10488 MB)
Checking for bad sectors ...
Bad cluster: 0x17d783 - 0x17d783 (1)
Bad cluster: 0x1818ea - 0x1818ea (1)
ERROR: This software has detected that the disk has at least 2 bad sectors.
****************************************************************************
* WARNING: The disk has bad sector. This means physical damage on the disk *
* surface caused by deterioration, manufacturing faults or other reason. *
* The reliability of the disk may stay stable or degrade fast. We suggest *
* making a full backup urgently by running 'ntfsclone --rescue ...' then *
* run 'chkdsk /f /r' on Windows and rebooot it TWICE! Then you can resize *
* NTFS safely by additionally using the --bad-sectors option of ntfsresize.*
****************************************************************************

========================================




Do I have to format that 8 MB free space into something else? I remember seeing an 8 MB space before I started doing all these actions; so I know it is sort of important, but I don't know exactly how.  The 8 MB space disappeared when I started these actions.

What should I do next?

10

Re: trying to grow primary partition - unable to shrink extended parttion

dj_mixmaster_2000 wrote:

Do I have to format that 8 MB free space into something else?

I remember seeing an 8 MB space before I started doing all these actions; so I know it is sort of important, but I don't know exactly how.  The 8 MB space disappeared when I started these actions.

You can leave the 8 MiB of space unallocated with no problems.  If you want you could try to shink the extended partition a little further going step by step by 1 MiB less each time.

dj_mixmaster_2000 wrote:

What should I do next?

Unfortunately it looks like the disk has at least 2 bad sectors on it. GParted is currently unable to work around bad sectors.  You might try using the command line, fdisk, and ntfsresize with the bad clusters option, though this requires much more thought and caution.   This method is described in the following post:
Howto: Use ntfsresize+fdisk to resize a partition with bad sectors

11

Re: trying to grow primary partition - unable to shrink extended parttion

Can you use the terminal given in the Gparted Bootup disc to do the given instructions?  I just wanted to make sure that it has all the commands I will need to use.

12

Re: trying to grow primary partition - unable to shrink extended parttion

Yes, you should be able to use the GParted Live boot disc.  smile

13

Re: trying to grow primary partition - unable to shrink extended parttion

For reference for those googling "Unable to satisfy all constraints on the partition", the tip about leaving a little space at the start doesn't just apply for attempts to shrink the extended partition.  I was attempting to grow the extended partition (to the right) and ran into the same thing.  The extended partition was a bit cramped for space, so I had to shrink and move a few partitions inside to create room.  When the extended partition got a little bit of space at the start, I could grow it to the right and carry on with what I was trying to do.

This seems like an obscure-enough problem that perhaps there should be a bit of a UI warning or better feedback when this happens?