1 (edited by slobes 2009-12-17 20:33:18)

Topic: PROBLEM: Attempted to resize Windows 7 NTFS Partition

Hi gedakc,

I have the exact same problem, only with a slightly different scenario. I tried shrinking my Windows 7 volume (sda1) to make room for a new 50gb ntfs partition. The new partition (sda2) sized correctly, but I now am receiving the "corrupt partition table or incorrect device partitioning. I really need to get this fixed ASAP as this is a work computer, is there any way you can help me get the same information IDOC provided you with?

When I pull up the information for the corrupt partition I show the following:

Device name: /dev/sda1
Status: Not mounted
Label: System
UUID: DC68B16E68B14852

First Sector: 63
Last Sector: 520120439
Total Sectors: 520120377

NTFS Volume Version 3.1
Cluster Size: 4096 bytes

Current Volume Size: 298100560384 bytes (298101 MB)
Current Device Size: 266301633024 bytes (266302 MB)

Error: Current NTFS volume size is bigger than the device size!


When I attempt to create the .pbr file, I use skip=520120440 as that is where my second partition starts. When I do this, I get "cannot skip: Invalid argument".....

Also, how do I get these files uploaded once they have been compiled? I am not very Linux-savvy.


Would this be something Partition Magic could correct?

Thanks a lot!

2

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

Thank you slobes for creating a new post for your situation.  I have taken the liberty of deleting your other posts which you added to the end of other resizing situations.

Each situation is unique so that is why the fix for one instance will not work in another.  smile


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 /dev/sda unit s print

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

where sda-slobes.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=sda1-slobes.pbr bs=512 count=1 skip=63

where sda1-slobes.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

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

fdisk -l -u

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   520120439   260060188+    7  HPFS/NTFS
/dev/sda2       520120440   625137344    52508452+    7  HPFS/NTFS

4

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

Sorry - I am having a heck of a time trying to move these files off the computer so that I can upload them to you.

Is there any way I can move them to a USB flash drive? It looks like your gparted disc has mounted it (I can see it in gparted), but how do I get the files I've created through NANO along with the PBR and MBR files from their saved location to the drive?

5

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

after running parted /dev/sda unit s print I got the output

Model: ATA WDC WD3200BEKT-2 (scsi)
Disk /dev/sda: 625142448s
Sector Size (logical/physical): 512B/512B
Partition Table: msdos
Number      Start                End                    Size             Type     File System    Flags
1                 63s          520120439s     520120377s     primary       ntfs           boot
2         520120440s    625137344s   105016905s    primary       ntfs

6

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

MBR
http://www.mediafire.com/file/kntez3jt2 … slobes.mbr

PBR
http://www.mediafire.com/file/2nyjthztx … slobes.pbr

7

Re: PROBLEM: Attempted to resize Windows 7 NTFS Partition

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 582,227,656 sectors:
00000020   00 00 00 00  80 00 80 00  C8 16 B4 22  00 00 00 00
To a new length of 520,120,376 sectors:
00000020   00 00 00 00  80 00 80 00  38 68 00 1F  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-slobes_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-slobes_new.pbr of=/dev/sda bs=512 count=1 seek=63

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.