bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: my NTFS disk broken by Grub Legacy


From: Olle Bergkvist
Subject: Re: my NTFS disk broken by Grub Legacy
Date: Fri, 2 Feb 2007 14:59:33 +0100 (CET)

Hello again.

I'm sorry i was a bit mad last time. I understand that Grub is working, and Supergrubdisk is working too. It was me who made a mistake. Or two.

Anyway, did a little research myself within linux and were able to fix it.

Scott Leerssen wrote

>NT stores a copy of its boot block in the last sector of the boot partition, so you may be able to get >your NTFS back by booting a windows recovery CD.

That was the solution! Thanks a lot Scott.

So I used the "dd" command to read and write to the disk.

But first i used "fdisk" to get the dimensions of the partition.

   sudo fdisk -l /dev/hda

and fdisk listed my partitons and the exact positions of the first and last sector of each partition.

Then something similar to this: (i dont remember)

   sudo dd if=/dev/hda of=/mnt/hda2/sect.txt skip=NUMBER count=1

where NUMBER was the position on the hard disk where the partition ended.

And then i changed NUMBER some dozens of times, and when the text file looked good (contained the words NTFS and NTLDR and "Press any key to restart") i did:

   sudo dd if=/mnt/hda2/sect.txt of=/dev/hda1

Note that digit "1"  in hda1, it is extremely important (Otherwise it would mess up the partition table or MBR)

The story should have ended here. The file system was working perfectly. But i could not boot Windows yet, since i had used Super Grub Disk in a really crazy (wrong) way which had turned my partition into a FAT32.

Then i turned to another computer. I downloaded DD for Windows ( http://www.chrysocome.net/dd ). And saved the first 100 sectors of the hard disk to a text file , and emailed it to my inbox.

Booted linux, downloaded the text file, and used DD to write the very first sectors of the file to /dev/hda1.

Used a Hex editor and copied the very first sectors, which seemed to contain the bootloader, and i stopped at a lot of null bytes.

Then, the Windows bootloader worked. But the file system was broken, and i could not run Windows.

Worked in a hex editor comparing the file from the other computer, and a file from this computer (created by DD) . There was a very small difference between them in the first sector. So i left the sectors from the other computer on the disk, but i copied back the original file with the first sector. (The sector as it was on this computer.) 

So at last, i had the first sectors as they were in that other computer, but the very first sector from this computer.

Done!

I feel kind of proud of myself by now ;)

Thanks to all of you who have helped me.
Let's hope that this story can help someone else in trouble...

Bye

//Olle



Stava rätt! Stava lätt! Yahoo! Mails stavkontroll tar hand om tryckfelen och mycket mer! Få den på http://se.mail.yahoo.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]