1 (edited by moleary04 2009-12-12 20:58:09)

Topic: [SOLVED] Current NTFS volume size is bigger than the device size issue

First off, here is my fdisk -l -u output:

Disk /dev/sda: 640.1 GB, 640133946880 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250261615 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xccb8639d

   Device  Boot      Start         End      Blocks   Id   System
/dev/sda1    *          63    83891429    41945683+   7   HPFS/NTFS
/dev/sda2        209728575  1250258624   520265025    7   HPFS/NTFS

This error happended when I tried to shrink my sda1 partition with WinXP to 40 GB and move my Win7 partition, sda2, to the left and expand it with the newly freed space from sda1.  Then I think I made matters worse by trying to resize sda1 to 100GB by shrinking sda2 and moving it to the right.  So now GParted is showing sda1 as 40.00 Gib, a 60.00 Gib unallocated section, then my 496.16 Gib Win 7 partition.  From looking at other posts, I have already created my mbr and pbr files.

http://www.mediafire.com/file/wazydnnmdkx/sda.mbr
http://www.mediafire.com/file/mh1ujgmckm2/sda1.pbr

Can someone look at these and then let me know what I have to do to get my boot partition working again?  Thanks for any assistance with this!

2

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

I should be able to take a look at this tomorrow morning.

Which version of GParted or GParted-Live were you using?

3

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

I am using the 0.5.0-3 version of GParted live.

Thanks for the quick response and thanks for helping me out when you can!

4

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

Since a few different move/resize operations have been undertaken, I think it is safer if we decrease the NTFS volume size to fit within the partition size.

The change I have made to the file is from a length of 195,452,984 sectors:
00000020   00 00 00 00  80 00 80 00  38 60 A6 0B  00 00 00 00
To a new length of 83,891,366 sectors:
00000020   00 00 00 00  80 00 80 00  A6 14 00 05  00 00 00 00

Note:  The NTFS volume size is always 1 sector less than the total number of sectors in the partition table entry because the NTFS backup sector is not considered part of the NTFS volume.

To apply this change:

1) Download the new NTFS PBR: sda1-moleary_new.pbr

2) Load the new NTFS PBR on your hard disk.
NOTE:  Be extra careful when entering the commands.  Data loss could result otherwise.

dd if=sda1-moleary_new.pbr of=/dev/sda bs=512 count=1 seek=63

3) Reboot the computer

4) Check that the file system is recognized in GParted

5) If all seems fine then I would advise booting into Windows and running "chkdsk /f /r" multiple times, until there are no more faults.

I have updated the main post regarding this problem also occurring with GParted Live 0.5.0-3.
WARNING! Problem Resizing File Systems with GParted

5

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

OK, I loaded that file and made some progress, but I'm still getting an exclamation point on my sda2 partition, the one with Win7.  I forgot to mention in my first post that after trying to resize the sda2 partition to fix the sda1 partition earlier, I got an error in GParted on sda2 that says it couldn't read the file system.  The exact error is:

Unable to detect file system! Possible reasons are:
-The file system is damaged
-The file system is unknown to GParted
-There is no file system available (unformatted)

After loading your .pbr file, I booted from my Win7 setup CD and ran chkdsk twice, after the second time is said there were no errors.  So right now, my sda1 partition is fine as I can boot into XP and it works.  My sda2 partition with Win7 is still messed up, because I'm getting that error on it in GParted, and in XP when I try to run chkdsk on it, it says "The type of the file system is RAW. CHKDSK is not available for RAW drives."

Can you also help with this issue?  If so, what files or information do you need from me?  Thanks again for helping me out here and getting one of my partitions up and going!

6

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

Did you happen to save the details log from GParted?  If so that would help tremendously with the problem.

Otherwise we need to somehow find where the second NTFS partition begins.  The TestDisk application might prove very useful in this situation.  The testdisk application is included on GParted Live.

Would you be able to try using testdisk to see what it thinks the partition table should be?
If you want me to review what the testdisk suggests, then do not write any changes to the disk.  Instead post back here with what testdisk reports.

7

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

I didn't think to save the details log since GParted has never given me any issues.

I am currently running through the testdisk application, and right now I'm running a deeper search on my hard drive for partitions.  It found my 2 partitions using the quick search, but when I used testdisk to list files from my sda2 partition, it only listed a few folders and no files, so I might be in trouble here.  Before I searched for partitions, testdisk showed me the current partition structure which showed an error:

Disk /dev/sda - 640GB / 596 GiB - CHS 77825 255 63
Current partition structure:
     Partition          Start         End     Size in sectors

 1 * HPFS - NTFS      0   1  1   5221 254 63    83891367
Error: size boot_sector 1166367185 > partition 1040530050
Invalid NTFS or EXFAT boot
 2 P HPFS - NTFS  13055   0  1  77824 254 63  1040530050
 2 P HPFS - NTFS  13055   0  1  77824 254 63  1040530050

I'm not sure if this helps for not, but I figured I'd post it.  I'll also post again when testdisk finishes its search for partitions.

8

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

OK I got some more info from testdisk, and I was wanting to get your thoughts before I make any changes.  After testdisk went through the deepsearch, it found a couple more partitions.  When I tried to list the files from these, it said there was no filesystem so nothing could be read.  It also gave an error saying that the hard drive seemed to small.  I guess my partition table was saying my hard drive was 656 GiB instead of 596 GiB. So I'm thinking that after I shrunk my sda1 partition to 40 GB, I got the original error.  To try and fix this, I moved my sda2 partition 60GB to the right to make room for sda1 thinking that might fix sda1 with chkdsk.  So that move screwed up things even more, which I think is why its reading as 656 GiB instead of 596 GiB with testdisk.

So anyway, testdisk wants to make my partitions look like this:

Disk /dev/sda - 640GB / 596 GiB - CHS 77825 255 63
Current partition structure:
     Partition          Start         End     Size in sectors

 1 * HPFS - NTFS      0   1  1   5221 254 63    83891367
 2 P HPFS - NTFS   5222   0  1  77824 254 63  1166367195

Should I just write this from testdisk and hope my files are not gone?  Or do you think there is something else to try before doing this with the mbr and pbr?  Thanks.

9

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

In this situation I think it would be good to try writing the output from testdisk.  This should not affect any files on the disk, but instead will only modify the MBR.  If this doesn't work correctly, we can always restore the MBR because we have saved copies of it in this thread smile

After writing the output, I suggest trying to boot into windows and if that succeeds, then run "chkdsk /f /r" on both drive letters and reboot windows a few times.

10

Re: [SOLVED] Current NTFS volume size is bigger than the device size issue

I wrote the testdisk information and everything is fine now after running chkdsk a few times.  All my files are present and now my partitions are set up the way that I want them to be.

Thank you very much gedakc for all your help with this.  This could have been a much greater headache without your assistance.  Your help was much appreciated. big_smile big_smile big_smile