1 (edited by bendare 2011-01-03 23:30:22)

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

Hi guys
Thanks in advance and sorry to fall foul of this, didn't realise there was an issue with the version I used til I used it/ Haven't had a problem with it before.

So the problem is with /dev/sda1. I just shrank a windows partition form about 40GB down to 15GB and deleted another ntfs partition of about 40GB and put linux partitions in the space made.

The version of Gparted I used was 0.4.5 (on a Gentoo livedvd) (although now I have version 0.6.2)

And here are fdisk and parted...

linux-8qfw:/home/... # fdisk -l -u

Disk /dev/sda: 80.1 GB, 80054059008 bytes
255 heads, 63 sectors/track, 9732 cylinders, total 156355584 sectors

Same problem, windows wont boot, gets in a few seconds then crashes.
Gparted doesn't seem to register a difference. 
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: 0x3a393a39

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    30716279    15358108+   7  HPFS/NTFS
/dev/sda2   *    30716280   156344579    62814150    f  W95 Ext'd (LBA)
/dev/sda5        64500975   156344579    45921802+  83  Linux
/dev/sda6        30716406    33784694     1534144+  82  Linux swap / Solaris
/dev/sda7        33784758    64500974    15358108+  83  Linux

Partition table entries are not in disk order
linux-8qfw:/home/... # parted /dev/sda unit s print
Model: ATA MAXTOR 6L080J4 (scsi)
Disk /dev/sda: 156355584s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End         Size        Type      File system     Flags
 1      63s        30716279s   30716217s   primary   ntfs            type=07
 2      30716280s  156344579s  125628300s  extended                  boot, lba, type=0f
 6      30716406s  33784694s   3068289s    logical   linux-swap(v1)  type=82
 7      33784758s  64500974s   30716217s   logical   ext4            type=83
 5      64500975s  156344579s  91843605s   logical   ext4            type=83

I've run through the "Proposition of a tutorial for the NTFS size bug"
http://gparted-forum.surf4.info/viewtopic.php?id=13937

but it hasn't solved the problem.

"dd if=/dev/sda1 of=/home/.../bd.pbr bs=512 count=1 skip=63" gave:

0000000: 0101 0000 0000 0005 1200 0000 0010 1800  ................
0000010: ff01 1f00 0102 0000 0000 0005 2000 0000  ............ ...
0000020: 2002 0000 0010 1800 bf01 1300 0102 0000   ...............
0000030: 0000 0005 2000 0000 2302 0000 0010 1800  .... ...#.......
0000040: a900 1200 0102 0000 0000 0005 2000 0000  ............ ...
0000050: 2102 0000 0010 1400 bf01 1300 0101 0000  !...............
0000060: 0000 0001 0000 0000 0102 0000 0000 0005  ................
0000070: 2000 0000 2002 0000 0101 0000 0000 0005   ... ...........
0000080: 1200 0000 0000 0000 0000 0000 0000 0000  ................
0000090: c790 23f0 7f01 0000 905e 0000 0000 0000  ..#......^......
00000a0: 0001 0000 0100 0484 d000 0000 e000 0000  ................
00000b0: 0000 0000 1400 0000 0200 bc00 0800 0000  ................
00000c0: 0000 1800 ff01 1f00 0102 0000 0000 0005  ................
00000d0: 2000 0000 2002 0000 0013 1400 ff01 1f00   ... ...........
00000e0: 0101 0000 0000 0005 1200 0000 0013 1800  ................
00000f0: ff01 1f00 0102 0000 0000 0005 2000 0000  ............ ...
0000100: 2002 0000 001b 1400 0000 0010 0101 0000   ...............
0000110: 0000 0003 0000 0000 0013 1800 bf01 1300  ................
0000120: 0102 0000 0000 0005 2000 0000 2302 0000  ........ ...#...
0000130: 0013 1800 a900 1200 0102 0000 0000 0005  ................
0000140: 2000 0000 2102 0000 0012 1800 1601 0000   ...!...........
0000150: 0102 0000 0000 0005 2000 0000 2102 0000  ........ ...!...
0000160: 0013 1400 bf01 1300 0101 0000 0000 0001  ................
0000170: 0000 0000 0102 0000 0000 0005 2000 0000  ............ ...
0000180: 2002 0000 0101 0000 0000 0005 1200 0000   ...............
0000190: b28e 2f9b 8001 0000 905f 0000 0000 0000  ../......_......
00001a0: e800 0000 0100 0494 b800 0000 c800 0000  ................
00001b0: 0000 0000 1400 0000 0200 a400 0700 0000  ................
00001c0: 0003 1400 ff01 1f00 0101 0000 0000 0005  ................
00001d0: 1200 0000 0003 1800 ff01 1f00 0102 0000  ................
00001e0: 0000 0005 2000 0000 2002 0000 000b 1400  .... ... .......
00001f0: 0000 0010 0101 0000 0000 0003 0000 0000  ................
0000200: 0a      

And I changed it to:
(using the value of 30716217-1=30716216, hexed=1d4b138, and then reversed and put in the third line "0000020")

0000000: 0101 0000 0000 0005 1200 0000 0010 1800  ................
0000010: ff01 1f00 0102 0000 0000 0005 2000 0000  ............ ...
0000020: 2002 0000 0010 1800 38b1 d401 0102 0000   .......8.......
0000030: 0000 0005 2000 0000 2302 0000 0010 1800  .... ...#.......
0000040: a900 1200 0102 0000 0000 0005 2000 0000  ............ ...
0000050: 2102 0000 0010 1400 bf01 1300 0101 0000  !...............
0000060: 0000 0001 0000 0000 0102 0000 0000 0005  ................
0000070: 2000 0000 2002 0000 0101 0000 0000 0005   ... ...........
0000080: 1200 0000 0000 0000 0000 0000 0000 0000  ................
0000090: c790 23f0 7f01 0000 905e 0000 0000 0000  ..#......^......
00000a0: 0001 0000 0100 0484 d000 0000 e000 0000  ................
00000b0: 0000 0000 1400 0000 0200 bc00 0800 0000  ................
00000c0: 0000 1800 ff01 1f00 0102 0000 0000 0005  ................
00000d0: 2000 0000 2002 0000 0013 1400 ff01 1f00   ... ...........
00000e0: 0101 0000 0000 0005 1200 0000 0013 1800  ................
00000f0: ff01 1f00 0102 0000 0000 0005 2000 0000  ............ ...
0000100: 2002 0000 001b 1400 0000 0010 0101 0000   ...............
0000110: 0000 0003 0000 0000 0013 1800 bf01 1300  ................
0000120: 0102 0000 0000 0005 2000 0000 2302 0000  ........ ...#...
0000130: 0013 1800 a900 1200 0102 0000 0000 0005  ................
0000140: 2000 0000 2102 0000 0012 1800 1601 0000   ...!...........
0000150: 0102 0000 0000 0005 2000 0000 2102 0000  ........ ...!...
0000160: 0013 1400 bf01 1300 0101 0000 0000 0001  ................
0000170: 0000 0000 0102 0000 0000 0005 2000 0000  ............ ...
0000180: 2002 0000 0101 0000 0000 0005 1200 0000   ...............
0000190: b28e 2f9b 8001 0000 905f 0000 0000 0000  ../......_......
00001a0: e800 0000 0100 0494 b800 0000 c800 0000  ................
00001b0: 0000 0000 1400 0000 0200 a400 0700 0000  ................
00001c0: 0003 1400 ff01 1f00 0101 0000 0000 0005  ................
00001d0: 1200 0000 0003 1800 ff01 1f00 0102 0000  ................
00001e0: 0000 0005 2000 0000 2002 0000 000b 1400  .... ... .......
00001f0: 0000 0010 0101 0000 0000 0003 0000 0000  ................
0000200: 0a    

and put it back with:
"dd if=/home/.../bd.pbr of=/dev/sda1 bs=512 count=1 seek=63"

Please say if any more info is needed.
Any help would be appreciated. Cheers.
Ben

2

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

This situation certainly seems different because the data at sector 63 does not look at all like an NTFS Partition Boot Record.

Did you shrink the sda1 partition from the right hand side, or from the left hand side?

What does GParted indicate when you select the partition and choose the menu entry "Partition --> Information"?

Did you save a copy of the gparted_details.htm log file after performing the resize?  If so can you post it here?

3

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

Thanks so much for getting back quickly.

gedakc wrote:

Did you shrink the sda1 partition from the right hand side, or from the left hand side?

What does GParted indicate when you select the partition and choose the menu entry "Partition --> Information"?

Did you save a copy of the gparted_details.htm log file after performing the resize?  If so can you post it here?

1. I shrank from the right I believe, it was always the first thing on the drive. I don't know if I made it alter the left-hand end of it all when I asked it to fill the space available to it (as in i tried to take out any space before and after)

2. Gparted says...
it gives some volume information, ntfs, 14.65 Gb, first sector 63, last sector 30716279, total sectors 30716217...

then the warning:

ntfsresize v1.13.1 (libntfs 9:0:0)
Device name ...sda1
Cluster size 4096 bytes
Current volume size: 41940664832 bytes
Current device size: 15726703104 bytes
Error: Current NTFS volume size is begger than the device size!
Corrupt partition table or incorrect device partitioning?

Unable to read the contents of this file system!
Because of this some operations may be unavailable.

The following list of software packages is required for ntfs file support : ntfsprogs

I do have that last software package.

I'm sorry but I didn't record the log when I did it, and like I said it was on a livedvd so it wasn't saved to the hard drive.

4

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

Since GParted sees the partition correctly I think there might have been a mistake made when you tried to capture the NTFS PBR.  Can you try to re-capture the NTFS PBR?

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-bendare.pbr bs=512 count=1 skip=63

where sda1-bendare.pbr is the name of the file that will need to be uploaded.

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

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

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

5

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

gedakc wrote:

I think there might have been a mistake made when you tried to capture the NTFS PBR...

I think (well i know) that you were right. I also thought something wasn't quite right because the hex-number i was replacing in the pbr didn't match the size of the original partition.
I used the command you just gave and checked the file, the 3rd column of the third line matched the old value of the volume size. I wrote it back using the instructions from the tutorial and then checked gparted's readings. It now gave a matching volume and device size and told me to run chkdisk /f, etc.
So I'm currently doing that and we'll see what happens.
Thanks a lot, all down to my human error.
Ben

6

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

Looks good to me.
"chkdsk /r" fixed a problem or two and have rebooted windows a couple of times and all seems peachy.
Once again, thank you!
All the best.

7

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

'Glad to hear that you were able to resolve the problem.  smile

And thank you also for editing the initial post to prefix "SOLVED" in front of the title.  This can help other users searching for solutions to problems.