1 (edited by kolyawe 2010-05-05 20:43:48)

Topic: [SOLVED] gparted ntfs resize bug (shrink)

Hello all,

After hours of looking for a way to solve my ntfs resize issue, I finally find this forum which seems to have a solution (as seen here : http://gparted-forum.surf4.info/viewtopic.php?id=13937)

I got a new hard drive 160Gbytes with Win XP installed on it, and I wanted to make some free space to put Ubuntu 10.04.
I used gparted and wanted to shrink the ntfs partition. Everything appeared to run fine until I restarted the computer and I got the blue screen coming from Windows (UNMOUNTABLE ....).

Finally, I went in Gparted again (the one provided with Knoppix) and it appeared that I have the following error : "current ntfs volume size bigger than device size"

parted /dev/sda unit s print gives the following :

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

Number  Start    End         Size        Type     File system  Flags
 1      63s      240974s     240912s     primary  fat16
 2      240975s  148729769s  148488795s  primary  ntfs         boot

and fdisk -u -l gives the following return :

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
Disk identifier: 0x90ec90ec

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63      240974      120456   de  Dell Utility
/dev/sda2   *      240975   148729769    74244397+   7  HPFS/NTFS

here is the file containing PBR from /dev/sda
I am not sure of what to change in the file as in this case, my partition is /dev/sda2

May someone help me to put the right change in the PBR that I have uploaded here :
http://www.mediafire.com/?2tmmngjmhhy

I hope you can help me !

Regards,

Nicolas - kolyawe

2 (edited by gedakc 2010-05-05 19:42:14)

Re: [SOLVED] gparted ntfs resize bug (shrink)

Which version of GParted did you use?

Next we will need a copy of the NTFS Partition Boot Record.

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

where sda1-kolyawe.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 kolyawe 2010-05-05 21:46:44)

Re: [SOLVED] gparted ntfs resize bug (shrink)

gedakc wrote:

Which version of GParted did you use?

Next we will need a copy of the NTFS Partition Boot Record.

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

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

Thank you for your help, this is great.

So here is the file containing the current pbr...

http://www.mediafire.com/file/baywwddvm … olyawe.pbr

what was missing is my dd command is the skip=240975 parameters, so I guess my magic hexa code would be something like 8D9C25A which should be 0E C3 D9 08 in stead of the current number 68DD9D12 ? right ?


Edit kolyawe :
- gparted release 0.5.1 provided with Knoppix 6.2.1
- magic hexa number is 8D9C25A (5A C2 D9 08 in the good PBR file) and not the one I provided first in my reply
- I think that it could be good to add something in the tutorial proposition, for people having not one but two or even more partitions on the same disks.

i solved the problem !
Thanks to gedakc , I had the right information !
Best regards.

4

Re: [SOLVED] gparted ntfs resize bug (shrink)

I am glad to hear that you were able to solve the problem.  smile

5 (edited by jennyfer99 2013-06-24 02:46:26)

Re: [SOLVED] gparted ntfs resize bug (shrink)

That was a problem of mine My Local Cause too, so thank you for solution  wink