1 (edited by BartholomewIU 2010-05-07 08:58:22)

Topic: [Resolved] NTFS resize problem

Hi all,

I shrink my portable hard disk from a single 500GB ntfs partition to 490GB (not sure is it 490GB as I forget what size I typed). The 490GB partition is moved to right, leaving 10GB at the left hand side.
I get this error after running the program:
Current NTFS volume size is bigger than the device size!

After searching this forum for a while, I know that these info are necessary for recovery (but not sure are they correct):

Result of parted /dev/sdb unit s print:

Model: BUFFALO HD-PEU2 (scsi)
Disk /dev/sdb: 976773167s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End         Size        Type     File system  Flags
1      21494970s  976768064s  955273095s  primary


dd if=/dev/sdb of=sdb-edneymatias.mbr bs=512 count=1
http://www.mediafire.com/file/zmommmzey … matias.mbr

dd if=/dev/sdb of=sdb1-edneymatias.pbr bs=512 count=1 skip=2048
http://www.mediafire.com/file/nmkyd3yzt … matias.pbr


I am new to linux, not sure is it sdb1 as I moved the partition to right and leaving 10GB empty space at the left and not create a partition yet.

Thanks in advance.

2

Re: [Resolved] NTFS resize problem

Which version of GParted did you use?

From the parted output, your partition now begins at sector 21494970.  Hence you will need to use this value to make a copy of 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/sdb of=sdb1-edneymatias.pbr bs=512 count=1 skip=21494970

where sdb1-edneymatias.pbr is the name of the file that will need to be uploaded.

3

Re: [Resolved] NTFS resize problem

Not sure which version, I use the GParted inside the systemrescuecd-x86-1.5.2.iso

Output of
dd if=/dev/sdb of=sdb1-edneymatias.pbr bs=512 count=1 skip=21494970
http://www.mediafire.com/file/twyam3tjn … matias.pbr

4

Re: [Resolved] NTFS resize problem

I am a little concerned that your case involved a move from to the right in addition to the shrink operation.  If you saved the gparted_details.htm log file it might provide us with some more information to know what exactly happened.  In the absence of this log file, we can try proceeding with the usual repair procedure.

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 976,767,992 sectors:
00000020   00 00 00 00  80 00 80 00  F8 4B 38 3A  00 00 00 00
To a new length of 955,273,094 sectors:
00000020   00 00 00 00  80 00 80 00  86 4F F0 38  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: sdb1-edneymatias_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=sdb1-edneymatias_new.pbr of=/dev/sdb bs=512 count=1 seek=21494970

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 (edited by BartholomewIU 2010-05-07 09:01:41)

Re: [Resolved] NTFS resize problem

Problem solved. I get my partition and data back.

I saved the gparted_details.htm, but it is actually saved in memory drive. It gone when I reboot.

Thank you very much smile

6

Re: [Resolved] NTFS resize problem

Glad to hear that the problem is now solved.  smile

Thanks also for editing the initial post and prefixing the title with "SOLVED".

7

Re: [Resolved] NTFS resize problem

(Thread moved to the Live Media section)

*** It is highly recommended to backup any important files before doing resize/move operations. ***