1 (edited by TwinMOS 2009-09-14 00:38:47)

Topic: [HELP] Vista NTFS ntfsresize goes wrong

Hello...

As you can see Im a noob here. Im looking for some expert help!...

Im working to migrate from VISTA to FC 11 on my LAPTOP, SAMSUNG R70.

Everything goes right until I use the ntfsresize linux command, to resize my old VISTA partition at minimal space until use ntfsclone with gzip to backup, to an USB drive teh whole partition in case of need later.

I first backup my working mbr using dd, and the partition layout using dd as well.

Here are the original working dd image files for MBR and LAYOUT:

http://www.mediafire.com/file/mayznzzkd … up-sda.mbr
http://www.mediafire.com/file/mitnuynnjcf/backup-sda.sf

Ok..so, after that I use ntfsresize -i to know the new size to enter to be acepted for sda1 (NTFS), after use -n -s to test without writing and after NO ERRORS, apply the new size with ntfsresize as well. the old sda1 partition was about:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=     2048, size=305281147, Id= 7
/dev/sda2 : start=305283195, size=   409600, Id=83, bootable
/dev/sda3 : start=305692795, size= 85022720, Id=8e
/dev/sda4 : start=        0, size=        0, Id= 0

The new size to sda1 I have tried to give was +55100M, after ntfsresize snd process I have used fdisk to delete sda1, create sda1 again with start on 1 and end on +55100M and mark as primary 1 (sda1) and type (07) NTFS, check with "p" and write. Until here NO ERRORS!!...

So I go to restart to boot form the new VISTA RESIZED partition, BUT!!! no way!!! boot was impossible!!! black screen...

Again I boot from GRUB to FC11 and check with gparted, and here come my surprise, gparted tell me WARNING!!!!... for NTFS on sda1...

GPARTED:

First sector:     63
Last Sector:     305283194
Total sectors:    305283132
sda1:

WARNING:
$MFT has invalid magic.
ntfs_mft_load(): failed.
Failed to load $MFT: Input/output error.
Failed to mount '/dev/sda1': input/output error.
NTFS is inconsistent. Run chkdsk /f on Windows the reboot it TWICE!

Ok, but there is now way to reboot from WINDOWS...

ACTUAL fdisk -l :

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x26fc0fa9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       19003   152641566    7  HPFS/NTFS
/dev/sda2   *       19004       19029      204800   83  Linux
/dev/sda3           19029       24321    42511360   8e  Linux LVM


Any advice or help to recover the NTFS partition from here?.....

I hope so!!!

Please help me with that...since I'm not sure how to proceed.

Thank you so much.:D

EDIT ADD Testdisk deepscan results:

http://i26.tinypic.com/1zel82b.png

more info:

I have tried parted with this output info:

Model: ATA FUJITSU MHY2200B (scsi)
Disk /dev/sda: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type     File system  Flags
1      32.3kB  156GB  156GB   primary  ntfs             
2      156GB   157GB  210MB   primary  ext3         boot
3      157GB   200GB  43.5GB  primary               lvm 

(parted) check 1                                                         
Warning: Partition 1 is 156GB, but the file system is 200GB.             
Ignore/Cancel? I
Error: The file system is bigger than its volume!                         
Ignore/Cancel? I                                                         
No Implementation: Support for opening ntfs file systems is not implemented yet.

(parted)   

How could be the system bigger than the volume?...why this occur?....

2

Re: [HELP] Vista NTFS ntfsresize goes wrong

Hello TwinMOS,

it's rather clear, what you did ( good documentation !).  I refer to your "testdisk" deepscan results to explain, what happened. The main fault was, that you did not only shrink sda1, but move its lower border (from sector 2,048 to 63 ). Vista obviously needs value 2,048 for proper function, I can't explain why, but it's my experience. The result is, that the new Master Boot Record indicates, that the whole space up to sda2 ( the Fedora boot partition ) is used for the first primary partition (2048 - 63= 1985 sectors more than the original Vista partition had). This is plausible, but wrong, since the resizing really happened, see below. "testdisk" finds with its first (highlighted) line an incomplete Partition Boot Record at sector 63 and generously offers the whole disk as its size (390,716,802 sect.=> 186.3 GiB).

The second line shows - IMHO - the truth : the left border was not moved, but the partition resized to 107,617,387 sect. => 51.3 GiB.

The third line shows the former state as documented in your MBR backup. There are obviuosly traces on your harddisk, which still refer to the former partitioning.

Since due to your backuped  MBR, second primary partition is "flagged" bootable, I assume, that you use(d) a Linux Boot Manager to start Vista, too. Could you please show, the menu script for its boot item ?

My suggestion is, to adapt MBR to the state in "testdisks" second line and to "check" the new state with "GParted" for a valid NTFS partition.

Please keep in mind, that Vista as an operating system NEEDS a rather huge amount of free space on its partition to be able to work. "ntfsresize" does NOT respect this in any way. So it might be impossible to boot from it ! But if you grow it to an appropriate size in the case, you want to reinstall it, it may work again. BUT NO WARRANTY !

Why did you NOT use "Clonezilla" to get a compact image ???

Regards
cmdr

3

Re: [HELP] Vista NTFS ntfsresize goes wrong

Thank you cmdr !!! you guys Rocks!!!

Yes, think to clone from Clonezilla before,but later I read somewhere that clonentfs will give me a much smaller and optimized NTFS image, so I postpone the clonezilla job, wrong decision now...to late!

I have read your solution but not sure how to proceed...

Is safe to use testdisk to restore the NTFS partition to state #2 ?...How to adpat the mbr to the correct sheme?....

Will help if I post the GRUB.conf?... Is that the "menu script" that you ask for?...

I must use 63 or 2.048 as start sector for the correct sda1 partition table?...

I think I follow you, the whole error sits on start sector 2.048... and need to change this to 63.

Please shoot me some last advice on how to proceed safely  to accomplish the recovery process...

cmdr, Thank you!!

Kind regards,

TwinMOS

4

Re: [HELP] Vista NTFS ntfsresize goes wrong

Hello TwinMOS,

TwinMOS wrote:

Is safe to use testdisk to restore the NTFS partition to state #2 ?...How to adpat the mbr to the correct sheme?....

Yes, in principle. The only thing, that "testdisk" needs to do, is adapting the MBR to the suggested proper start sector and the appropriate size. If it fails, my assumption was wrong, but we have a second chance.

TwinMOS wrote:

Will help if I post the GRUB.conf?... Is that the "menu script" that you ask for?...

Since I now know, that you use "Grub", "menu.lst" would be the file, I needed. If there is no "menu.lst" in Root folder"/" or "/boot" or "/boot/grub", then you might find another ...lst -file.

TwinMos wrote:

I must use 63 or 2.048 as start sector for the correct sda1 partition table?...

I think I follow you, the whole error sits on start sector 2.048... and need to change this to 63.

No, this is not correct. Let me clarify it.  Windows (Vista) only needs one sector as MBR (first sector). The rest of the boot code is located in Partition Boot Record (PBR) and needs a few sectors more there. But you use "Grub". It has its own MBR code and always uses a few additional sectors more (adjacent to first sector). But none of these structures fill 63 or 2048 sectors as a whole. If first sector holds a valid partition table and the appropriate boot code, your harddisk will boot, regardless if 62, 31 or 1999 zero Byte sectors follow. But PBR must exactly know, how many "Hidden sectors" (63 or 2048) preceed, or - which is the same - its own absolute sector address. This might be a pitfall, when resizing.

Regards
cmdr