1 (edited by marty650 2010-01-20 00:39:09)

Topic: "SOLVED" Current NTFS volume size is bigger...

Problem is with first partition /dev/sda1 containing Vista

Used the Vista "manage" to downsize from 170GB to 150GB.
Despite disabling swap file, hibernate, error dumps, recover options etc and disk cleanup, not able to shrink further!

Found a forum recommendation for system rescuecd and burnt iso x86-1.3.4 to cd.
Unfortunately, this cd would not load gparted. Tried several methods. Other programs on the cd worked.

Had a cd with only gparted 0.5.0-3  used this to further shrink the vista partition to approx 62.5GB
Seemed to work okay. Did a check for errors after resize finished. Gparted reports everything good.

Now vista won't boot. Tried to fix using vista install dvd but says it cannot fix.  Shows vista partition as 0 MB

GParted now won't touch the partition further with the ERROR: Current NTFS volume size is bigger than the device size!

Unfortunately, did not see the problems people were having otherwise wouldn't have gone there.
The vista partition contains approx 41GB and the remainder of the partition is empty.
So resize was just to shrink unused space.

fdisk -l -u
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xcab10bee

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   131074334    65536143+   7  HPFS/NTFS
/dev/sda2       477186048   542722047    32768000    f  W95 Ext'd (LBA)
/dev/sda3   *   542723958   606678659    31977351    7  HPFS/NTFS
/dev/sda4       606678660   625137344     9229342+   c  W95 FAT32 (LBA)
/dev/sda5       477188096   542722047    32766976    b  W95 FAT32


parted /dev/sda unit s print
Model: ATA WDC WD3200JS-60P (scsi)
Disk /dev/sda: 625142448s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system  Flags
1      2048s       131074334s  131072287s  primary   ntfs
2      477186048s  542722047s  65536000s   extended               lba
5      477188096s  542722047s  65533952s   logical   fat32
3      542723958s  606678659s  63954702s   primary   ntfs         boot
4      606678660s  625137344s  18458685s   primary   fat32        lba


Much appreciated if someone can give specific instructions how to correct the partition table.
What numbers need to be changed?  What program is required to do this? Thank you

2

Re: "SOLVED" Current NTFS volume size is bigger...

Found another posting that was solved. So did the following:

dd if=/dev/sda of=sda-marty650.mbr bs=512 count=1
dd if=/dev/sda of=sda1-marty650.pbr bs=512 count=1 skip=63

Posted at http://www.mediafire.com/?sharekey=5b2d … 26d265f324

Hope this is correct.

3 (edited by gedakc 2010-01-17 22:17:42)

Re: "SOLVED" Current NTFS volume size is bigger...

Hi marty650,

From your fdisk and parted output, it appears that your Vista partition begins on sector 2048, and not 63.  Hence could you please regenerate the sda1-marth650.pbr file using "skip=2048"?

You can capture the NTFS Partition Boot Record in a file with the following command:

NOTE:  Be extra careful to type this command in properly, otherwise loss of data could result.

dd if=/dev/sda of=sda1-marty650.pbr bs=512 count=1 skip=2048

4

Re: "SOLVED" Current NTFS volume size is bigger...

done,  .pbr has newer time stamp, same location, thank you

5

Re: "SOLVED" Current NTFS volume size is bigger...

Hmm... This problem is interesting because it appears different than the others.

From the MBR, the size of the partition is about twice the size of the NTFS volume size as seen in the NTFS PBR:
131,072,287 size in sectors of partition from MBR
63,954,701 size in sectors of NTFS volume from NTFS PBR

Hence in theory the message "ERROR: Current NTFS volume size is bigger than the device size!" should not be displayed for this partition.

Can you try going into GParted again and seeing if there is an exclamation mark beside this partition?
If so would you please check the error message and report back here?
If not, then you should be able to grow the NTFS file system to fit the partition with the menu option "Partition --> Check".

6

Re: "SOLVED" Current NTFS volume size is bigger...

yes there is an exclamation mark beside the partition.  Here is window shot of error  http://www.mediafire.com/i/?cmzkm4zlrym  (uploaded to same folder as pbr and mbr)

7

Re: "SOLVED" Current NTFS volume size is bigger...

Did you perhaps previously have the NTFS volume beginning at sector 63?

If so, then this might be the problem because the NTFS Partition Boot Record you provided indicates that the number of "Hidden Sectors" before the file system is 63.  If this NTFS PBR comes from sector 2048, then we will need to update this number from 63 to 2048.

For example we would need to change the number 63 in the NTFS PBR:
00000010   00 00 00 00  00 F8 00 00  3F 00 FF 00  3F 00 00 00
To the number 2048:
00000010   00 00 00 00  00 F8 00 00  3F 00 FF 00  00 08 00 00

If this is the case then you can either hexedit this value directly, or I can provide an already edited NTFS PBR file based on the one you uploaded.

8

Re: "SOLVED" Current NTFS volume size is bigger...

It's possible previous NTFS volume began at sector 63.
Partition sda3 contains XP which i moved towards the back of the drive before installing the ugly Vista.

sda5 FAT32 contains much of the data on this drive since i decided a few years ago that msft's recovery procedures for NTFS were less than desirable.
sda4 contains the original XP recovery partition.

Tried today to copy partition sda5, just in case things get ugly with pbr restore, to another drive and get error message with no details at time 00:00:01
Message detail is simply  Copy /dev/sda5 to dev/hda (start at 102.99 GiB) 00:00:01 and stops dead.
Does GParted error on copy of another partition if errors are detected anywhere in the partition tables?

i don't know much about Linux but managed to look up the commands to mount either a floppy or usb and get the pbr mbr from commands in the terminal window provided with GParted.

Just downloaded hexedit.
Should i proceed with the value change as you described and then write with
dd if=sda1-marty650-new.pbr  of=/dev/sda bs=512 count=1 seek=2048

9

Re: "SOLVED" Current NTFS volume size is bigger...

Yes, the command would be as you stated.

Regarding making a backup of partitions, you could consider using Clonezilla which is better suited to this purpose.


Since you are planning to proceed with adjusting the value of "Hidden Sectors", here are the directions on how to do this:

To apply the change listed in post #7:

1) Download the new NTFS PBR: sda1-marty650_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-marty650_new.pbr of=/dev/sda bs=512 count=1 seek=2048

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.

10

Re: "SOLVED" Current NTFS volume size is bigger...

uh...was just looking at the second .pbr file i posted yesterday and it already has
00000010   00 00 00 00  00 F8 00 00  3F 00 FF 00  00 08 00 00

Are you looking at the 2nd .pbr file date stamped 01/17/2010 ?

11

Re: "SOLVED" Current NTFS volume size is bigger...

Yes, the file I looked at was dated 01/17/2010.  This file has the number of "Hidden Sectors" incorrectly set to 63.

12

Re: "SOLVED" Current NTFS volume size is bigger...

While you were posting the instruction to change from 63 to 2048, i looked at the .pbr file and it already is 2048!

i have not downloaded your changed .pbr yet!

So why is the change already done in the 2nd .pbr i obtained from the problem disk?

13

Re: "SOLVED" Current NTFS volume size is bigger...

Something definitely seems amiss.  Perhaps the file sharing service is caching a copy of the file somewhere.

You could try reposting both the MBR and PBR files using different names.

14

Re: "SOLVED" Current NTFS volume size is bigger...

deleted both files from mediafire, uploaded both the mbr and pbr files, same folder
http://www.mediafire.com/?sharekey=5b2d … 26d265f324

The file names similar but changed to 650-2

How does that look?

15

Re: "SOLVED" Current NTFS volume size is bigger...

It is good that you were suspicious.  This PBR file is completely different than the one I looked at earlier.  Now the error message matches with the problem.  smile

Since you were trying to shrink the partition, we will decrease the NTFS volume size to fit within the partition.

The change I have made to the file is from a length of 315,496,400 sectors:
00000020   00 00 00 00  80 00 80 00  D0 17 CE 12  00 00 00 00
To a new length of 131,072,286 sectors:
00000020   00 00 00 00  80 00 80 00  1E 01 D0 07  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-marty650-2_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-marty650-2_new.pbr of=/dev/sda bs=512 count=1 seek=2048

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.

16

Re: "SOLVED" Current NTFS volume size is bigger...

Made the changes to pbr.
Used the OEM DVD into command line.  Chkdsk forced a dismount before running.
Ran chkdsk /f /r multiple times, each run took 30-40 minutes.
Only five lost clusters. Vista now recognizes partition as 64000, previously showed 0.

Booted into Vista and scheduled chkdsk run at startup.
So far so good.  Seems to be stable.

gedakc, thank you for your expertise and patience in helping resolve this problem and the many problems appearing in this forum.
This is the first time i have required support from an open source software package and i'm impressed by the available support.

During the last few years i have been leaning towards using open source software whenever the interface and functionality
is equivalent to other available products. Have tried Mandrake and PC-BSD installations a few years ago but don't have the
Linux technical knowledge and time to make it the primary OS.  Want to try ubuntu sometime and see how much things have
improved in the last few years. For now, running the windows that came with the computer and favoring open source
software for everything else, whenever possible.

A few years ago recall using Partition Magic, think it had a very limited side program to display and edit the partition table.

It's been a few years since i've written software.  However, i can recall the most challenging bugs to troubleshoot were:
1. A common library routine that had been working well for years, in certain instances, returned incorrect results
2. The error message displayed by the software was incorrect and the problem was really in another area.

If you are working on this resizing bug and if the preceding comments help you refocus your efforts to find the problem, that's great!

Thanks again for your assistance.

17

Re: "SOLVED" Current NTFS volume size is bigger...

I am glad to read that this problem appears to be solved for your situation.  smile

If the problem is indeed solved, please edit the initial post to prefix the title with "SOLVED".

The next release of GParted (0.5.1) planned for Jan 25, 2010 will include a work around for this resizing problem that will hopefully fix the problem for all varieties of hardware devices and GNU/Linux distributions.