1 (edited by cereal 2010-07-31 01:25:24)

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

Hi guys

I used gParted (don't remember the version) to make room for Archlinux on the new partition (sda9).
Ok, it works fine. I could install arch and stuff on sda9, but now the sda5 doesn't works.

I've seen that here you can solve the problem, so here i am.
Can you help me please? I'd really appreciate it.

PS: Sorry for my bad english.
PS2: sorry x2, this topic should be posted in Gparted Support forum, not here... But i suppose it's the same....

--------------


cereal@myhost ~]$ sudo fdisk -l -u

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x93bc93bc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    61432559    30716248+   7  HPFS/NTFS
/dev/sda2        61432621   312580095   125573737+   f  W95 Ext'd (LBA)
/dev/sda5        61432623   262839464   100703421    7  HPFS/NTFS
/dev/sda6       283322368   302854143     9765888   83  Linux
/dev/sda7       302856192   303853567      498688   82  Linux swap / Solaris
/dev/sda8       303855616   312580095     4362240   83  Linux
/dev/sda9       262839528   283322339    10241406   83  Linux

------------------------------


[cereal@myhost ~]$ sudo parted /dev/sda unit s print

Model: ATA WDC WD1600AABS-6 (scsi)
Disk /dev/sda: 312581808s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system     Flags
1      63s         61432559s   61432497s   primary   ntfs            boot
2      61432621s   312580095s  251147475s  extended                  lba
5      61432623s   262839464s  201406842s  logical   ntfs
9      262839528s  283322339s  20482812s   logical   ext4
6      283322368s  302854143s  19531776s   logical   ext4
7      302856192s  303853567s  997376s     logical   linux-swap(v1)
8      303855616s  312580095s  8724480s    logical   ext4


------------------------------

Gparted Says:

Check and repair file system (ntfs) on /dev/sda5  00:00:00    ( ERROR )
       
calibrate /dev/sda5  00:00:00    ( SUCCESS )
       
path: /dev/sda5
start: 61432623
end: 262839464
size: 201406842 (96.04 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:00    ( ERROR )
       
ntfsresize -P -i -f -v /dev/sda5
       
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sda5
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 113607528960 bytes (113608 MB)
Current device size: 103120303104 bytes (103121 MB)
ERROR: Current NTFS volume size is bigger than the device size!
Corrupt partition table or incorrect device partitioning?

2

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

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-cereal.mbr bs=512 count=1

where sda-cereal.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-cereal.pbr bs=512 count=1 skip=61432623

where sda5-cereal.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.

3 (edited by cereal 2010-07-30 05:36:55)

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

Hi gedakc, thanks for reply.

As you requested, here they are:

MBR: http://www.mediafire.com/file/fuabocd11 … cereal.mbr
PBR: http://www.mediafire.com/file/j6tdfqvo6 … cereal.pbr

4

Re: [SOLVED] 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 221,889,704 sectors:
00000020   00 00 00 00  80 00 80 00  A8 C4 39 0D  00 00 00 00
To a new length of 201,406,842 sectors:
00000020   00 00 00 00  80 00 80 00  79 39 01 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-cereal_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-cereal_new.pbr of=/dev/sda bs=512 count=1 seek=61432623

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.

5

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

Wow! It worked just perfect!
Thanks a lot big_smile