1 (edited by jlopezinc 2010-08-17 19:23:00)

Topic: [SOLVED] NTFS resize problem

Hello.

I'm not sure how to do some steps from the tutorial, so I decided to open this thread.

Here it goes:

fdisk -l -u

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 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: 0xe62de62d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2          206848   114894847    57344000    7  HPFS/NTFS
/dev/sda3       114894848   152782847    18944000   83  Linux
/dev/sda4       152782848   156301311     1759232    5  Extended
/dev/sda5       152784896   156301311     1758208   82  Linux swap / Solaris

Disk /dev/sdb: 41.2 GB, 41174138880 bytes
255 heads, 63 sectors/track, 5005 cylinders, total 80418240 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: 0x34683468

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63    80389259    40194598+   7  HPFS/NTFS

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

Model: ATA ST380011A (scsi)
Disk /dev/sda: 156301488s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system     Flags
 1      2048s       206847s     204800s     primary   ntfs            boot
 2      206848s     114894847s  114688000s  primary   ntfs
 3      114894848s  152782847s  37888000s   primary   ext4
 4      152782848s  156301311s  3518464s    extended
 5      152784896s  156301311s  3516416s    logical   linux-swap(v1)

Thanks

2

Re: [SOLVED] NTFS resize problem

What is the problem you are experiencing?

Which partition is involved?

What steps led you to the problem?

3

Re: [SOLVED] NTFS resize problem

Resized partition sda2 (wich contains win7) to get space for a linux system (sda3). Resize failed, got the NTFS size problem.

ext4 is ok, but can't mount sda2.

4

Re: [SOLVED] NTFS resize problem

By "got the NTFS size problem" do you mean that you have seen the message "ERROR: Current NTFS volume size is bigger than the device size!"?

If so, then 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-jlopezinc.mbr bs=512 count=1

where sda-jlopezinc.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=sda2-jlopezinc.pbr bs=512 count=1 skip=206848

where sda2-jlopezinc.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: [SOLVED] NTFS resize problem

Yes, exactly. The "ERROR: Current NTFS volume size is bigger than the device size!" message.

Here it is:

MBR
http://www.mediafire.com/download.php?d7uvhhmb4jj1p9y

PBR
http://www.mediafire.com/download.php?axj98ulovyd3h2v

Thank you.

6

Re: [SOLVED] NTFS resize problem

No one to help?

7

Re: [SOLVED] NTFS resize problem

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 156,092,415 sectors:
00000020   00 00 00 00  80 00 80 00  FF C7 4D 09  00 00 00 00
To a new length of 114,687,999 sectors:
00000020   00 00 00 00  80 00 80 00  FF FF D5 06  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: sda2-jlopezinc_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=sda2-jlopezinc_new.pbr of=/dev/sda bs=512 count=1 seek=206848

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.

8

Re: [SOLVED] NTFS resize problem

Ok, that worked fine.

For the record, the OS Win7 that is on sda2 partition could boot right after I made the change. Then, I could fix the errors.

Thank you.

9

Re: [SOLVED] NTFS resize problem

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