Page 1 of 1

why i damaged my file system ?

Posted: Thu Jan 25, 2007 12:39 pm
by mohammed
i used a program to copy the boot sector to the drive D but it formated the drive and it deleted the file system too i knew that because the windows showed a message "this drive hasn't been formated".....how can i copy the boot sector to the drive without damaging the file system.. any way i am not going to loose my data again :(

Posted: Thu Jan 25, 2007 12:51 pm
by nick8325
Well, Windows stores some information about the file system on the boot sector...so you need to copy your boot sector into some other place that doesn't have data on (a floppy disk, for example) and try from there...

Anyway, all your data should still be there on D: (as long as you haven't copied anything else onto there!), you just need to somehow put the original boot sector back. I searched on Google quickly and found instructions to repair the boot sector. Apparently you should boot from the Windows install CD and enter the recovery console (one of the very first screens asks you to press "R" to enter the recovery console, if I remember correctly), and type FIXBOOT D:.

EDIT: if you don't have a Windows CD, you can download floppy disks from http://support.microsoft.com/kb/310994/en-us. This is assuming you're using Windows 2000/XP or something like that, but there's probably a similar program for 9x.

Posted: Thu Jan 25, 2007 2:33 pm
by Mikae
If you want to replace file system boot code with your own code, you have to be carefull and do not change filesystem parameters. Format and offsets to filesystem parameters are filesystem specific.

Which filesystem you damaged? You can repair it manually. For FAT32 this may help:
Another feature on FAT32 volumes that is not present on FAT16/FAT12 is the BPB_BkBootSec field. FAT16/FAT12 volumes can be totally lost if the contents of sector 0 of the volume are overwritten or sector 0 goes bad and cannot be read. This is a “single point of failure” for FAT16 and FAT12 volumes. The BPB_BkBootSec field reduces the severity of this problem for FAT32 volumes, because starting at that sector number on the volume—6—there is a backup copy of the boot sector information including the volume’s BPB.

In the case where the sector 0 information has been accidentally overwritten, all a disk repair utility has to do is restore the boot sector(s) from the backup copy. In the case where sector 0 goes bad, this allows the volume to be mounted so that the user can access data before replacing the disk.
For NTFS I noticed, that something looks like boot sector is placed into the last sector of NTFS partition, but I don't know exactly what is it...

Posted: Thu Jan 25, 2007 2:44 pm
by Candy
Mikae wrote:For NTFS I noticed, that something looks like boot sector is placed into the last sector of NTFS partition, but I don't know exactly what is it...
That should be an exact copy. Can't tell you where but I did read an NTFS spec some time ago, it included this as a detail. That was intended to prevent people from overwriting the first N sectors and losing the backup (which is an issue with fat32 - even if you're quick at interrupting a disk overwrite program you've still lost both backups of the boot sector).

A hint for the OP: You're overwriting either the boot sector or the MBR of the disk. If you overwrite the MBR, do not overwrite the partition table and the boot signature (55 AA) at the end. If you overwrite a boot sector of a FAT partition, don't overwrite the BPB (note that the FAT32 BPB is larger than a 16/12 one).

Posted: Fri Jan 26, 2007 9:23 am
by Pype.Clicker
:roll: Oh, the good old days where we had Tim Robinson waving his "Use GRUB" banner all over the place ...

Posted: Fri Jan 26, 2007 4:38 pm
by JackScott
This certainly seems a good case for using GRUB.

Though, if nobody developed their own bootloader, there would be nobody to do future development of GRUB.

Posted: Fri Jan 26, 2007 4:42 pm
by Alboin
Yayyak wrote:Though, if nobody developed their own bootloader, there would be nobody to do future development of GRUB.
I think most os'es here use GRUB legacy which isn't actively developed anymore anyway. (With GRUB 2 being more of an os itself.)

Posted: Sat Jan 27, 2007 2:00 pm
by mohammed
well,i will use GRUB :)
about the drive: thanks about the formula to fix the filesystem but i formated the drive already :(