1 (edited by localhorst 2010-10-27 20:58:05)

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

hello,

I was trying to Shrink /dev/sda2 from 416.69 GiB to 390.62 GiB when the problem occurred.
After that i got 2 partitions (before there was only sda2, now sda5 is there too)

GParted 0.6.2

libparted : 2.3

fdisk -l -u

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x55475547

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    81913855    40955904   83  Linux
/dev/sda2        81915496   955787174   436935839+   5  Extended
/dev/sda5        81915498   901113855   409599179    7  HPFS/NTFS
parted /dev/sda unit s print
Model: ATA SAMSUNG HD501LJ (scsi)
Disk /dev/sda: 976773168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End         Size        Type      File system  Flags
 1      2048s      81913855s   81911808s   primary   ext4         boot
 2      81915496s  955787174s  873871679s  extended
 5      81915498s  901113855s  819198358s  logical   ntfs
dd if=/dev/sda of=sda.mbr bs=512 count
dd if=/dev/sda of=sda_sda2.pbr bs=512 count=1 skip=87915496
dd if=/dev/sda of=sda_sda5.pbr bs=512 count=1 skip=81915498
http://www.filefactory.com/file/b4000aa/n/sda.mbr
http://www.filefactory.com/file/b4000b0/n/sda_sda2.pbr
http://www.filefactory.com/file/b4000b2/n/sda_sda5.pbr

there are very important things on it from about 6 years~ i would be very grateful if someone could help me!

thanks

2

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

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 873,871,672 sectors:
00000020   00 00 00 00  80 00 80 00  38 39 16 34  00 00 00 00
To a new length of 819,198,357 sectors:
00000020   00 00 00 00  80 00 80 00  95 F9 D3 30  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: sda5-localhorst_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=sda5-localhorst_new.pbr of=/dev/sda bs=512 count=1 seek=81915498

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.

3

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

hey,

thank you very very much!
It worked out of the box

i can access my data again smile

but i don't understand why you changed "from a length of 873,871,672 sectors:", not "873871679" ?

nice support from you.

thanks

4

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

'Glad to hear you are up and running again.  smile

localhorst wrote:

but i don't understand why you changed "from a length of 873,871,672 sectors:", not "873871679" ?

If I recall correctly, the length in the NTFS Partition Boot Record from sda_sda5.pbr indicated a size of 873,871,672 sectors.  The backup sector is stored after this size, and is not included as part of the size in the PBR.  This backup sector might have had a few empty sectors behind it.

If this problem is solved, then you can help other users by editing your initial post and prefixing the title with "SOLVED".