1

Topic: Current NTFS volume size is bigger than device size

Hello

Due to upgrading to Windows 7 I had to increase my sda1 XP partition and to shrink my logical sda5 DATA partition. I started GParted to shrink sda5: 11 GB.
GPated gives the following error

ntfsresize v2.0.0.0 (libnfts 10.0.0.)
device name /dev/sda5
NTFSvolume version 3.1
cluster size 4096 bytes
current volume size    1212627181568 bytes (121628 MB)
current device size 110099431424  (110100 MB)
Error:
Current NTFS volume size is bigger than device size

Corrupt partition table or incorrect device partioning ?
Unable to read the content of the file system !
Because of this some operations may be unavaillable

I did use the GParted which came with Ubuntu 10.10
Can anybody help me , since I need some special data from that partition which was not yet back-uped
regards
Gijs

2

Re: Current NTFS volume size is bigger than device size

This problem is definitely fixable, and your data should not be at risk.

Details about the problem can be found at the following link:
WARNING! Problem Resizing File Systems with GParted

If you are keen to repair the problem yourself then refer to the following link:
Proposition of a tutorial for the NTFS size bug

If you would like help to resolve this issue, then would you be able to provide the output from the following two commands?

fdisk -l -u

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

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

From there I can provide the instructions on how to capture the files necessary to make the repair of the NTFS Partition Boot Record.

3

Re: Current NTFS volume size is bigger than device size

It's to diificult and too much risk for me to do it myself. So I send you de results of the commands and hope you can help me

ubuntu@ubuntu:~$ sudo fdisk -l -u

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 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: 0xe1a6e1a6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    81915434    40957686    7  HPFS/NTFS
/dev/sda2   *    81915496   398267414   158175959+   f  W95 Ext'd (LBA)
/dev/sda5        81915498   296953449   107518976    7  HPFS/NTFS
/dev/sda6       319484718   344064104    12289693+  83  Linux
/dev/sda7       344064168   357735419     6835626   83  Linux
/dev/sda8       357735483   360450404     1357461   82  Linux swap / Solaris
/dev/sda9       360450468   362554919     1052226   82  Linux swap / Solaris
/dev/sda10      362554983   376836704     7140861   83  Linux
/dev/sda11      376836768   398267414    10715323+  83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
1 heads, 63 sectors/track, 15504336 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: 0x2450603a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63   976768127   488384032+   7  HPFS/NTFS
ubuntu@ubuntu:~$


ubuntu@ubuntu:~$ sudo parted /dev/sda unit s print
Model: ATA Maxtor 6L200S0 (scsi)
Disk /dev/sda: 398297088s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system     Flags
1      63s         81915434s   81915372s   primary   ntfs
2      81915496s   398267414s  316351919s  extended                  boot, lba
5      81915498s   296953449s  215037952s  logical   ntfs
6      319484718s  344064104s  24579387s   logical   ext4
7      344064168s  357735419s  13671252s   logical   ext4
8      357735483s  360450404s  2714922s    logical   linux-swap(v1)
9      360450468s  362554919s  2104452s    logical   linux-swap(v1)
10      362554983s  376836704s  14281722s   logical   ext4
11      376836768s  398267414s  21430647s   logical   ext4

ubuntu@ubuntu:~$

sda5: is the corrupted partition

I hope you can help me
Gijs

4

Re: Current NTFS volume size is bigger than device size

Next we will need copies of the Master Boot Record and the NTFS Partition Boot Record.

You can capture the Master 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=sda-gijs.mbr bs=512 count=1

where sda-gijs.mbr is the name of the file that will need to be uploaded.


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=sda5-gijs.pbr bs=512 count=1 skip=81915498

where sda5-gijs.pbr is the name of the file that will need to be uploaded.


Then upload these files to a media sharing site, such as mediafire, and post the link to these files in this forum post.

5

Re: Current NTFS volume size is bigger than device size

Hello

Here are the links to the pbr and the mbr

http://www.mediafire.com/file/eeyme4cmp … a-gijs.mbr
http://www.mediafire.com/file/5yxqpe3my … a-gijs.pbr

Success

6

Re: Current NTFS volume size is bigger than 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 237,553,091 sectors:
00000020   00 00 00 00  80 00 80 00  C3 C5 28 0E  00 00 00 00
To a new length of 215,037,951 sectors:
00000020   00 00 00 00  80 00 80 00  FF 37 D1 0C  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-gijs_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-gijs_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.

7 (edited by Gijs 2010-10-31 20:22:19)

Re: Current NTFS volume size is bigger than device size

YES YES !!! It works again smile smile smile

I had to  run chkdsk /f /r only once since there where no errors at all
Thanks a lot I'm very happy.


I still have a couple of question.
In GParted I can see that sda5: is smaller, but the part of 11GB I liked to add to de XP (C: ) partition is following  sda5 instead of preceding sda5.  Can I use GParted to move it 11GB to the right or do I encounter the same error if I do so ?

After that I like to extend sda1: the XP partiton with the 11 GB. Can I also do that without any risk ?

Or can I better backup the DATA of SDA5: delete that partion, extend sda1:  and after that create a new logical sda5: partition and restore the data back in sda5:

regards

Gijs

8

Re: Current NTFS volume size is bigger than device size

Gijs wrote:

I still have a couple of question.
In GParted I can see that sda5: is smaller, but the part of 11GB I liked to add to de XP (C: ) partition is following  sda5 instead of preceding sda5.  Can I use GParted to move it 11GB to the right or do I encounter the same error if I do so ?

Yes, you should be able to move sda5 to the right.  Normally you should not encounter the error you experienced, but I can not guarantee that you won't.  If you do we can always fix it.

Gijs wrote:

After that I like to extend sda1: the XP partition with the 11 GB. Can I also do that without any risk ?

You will need to move the left edge of the extended partition sda2 to the right first.  After that you can grow sda1 to use the free space.  There is always some risk, so I would advise you to make backups of your data in case anything goes seriously wrong.  Problems can happen due to bugs in the software, hardware failure, or power outages.


Gijs wrote:

Or can I better backup the DATA of SDA5: delete that partion, extend sda1:  and after that create a new logical sda5: partition and restore the data back in sda5:

The best way is probably to try moving the partition first.  The backup is always a great idea, especially if anything goes wrong while moving the partition.

If you delete sda5, then all of your logical partitions will be renumbered (minus 1 from each partition numbered higher than 5).  Hence I would recommend against deleting sda5.

9

Re: Current NTFS volume size is bigger than device size

I still own you all an answer to the last proposal.
I decided to buy another (bigger) disk and avoided in that way another possible failure
Thanks for all the help
regards
Gijs