why i damaged my file system ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mohammed
Member
Member
Posts: 93
Joined: Mon Jan 30, 2006 12:00 am
Location: Mansoura, Egypt

why i damaged my file system ?

Post 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 :(
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post 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.
Mikae
Member
Member
Posts: 94
Joined: Sun Jul 30, 2006 1:08 pm

Post 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...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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).
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Post by Pype.Clicker »

:roll: Oh, the good old days where we had Tim Robinson waving his "Use GRUB" banner all over the place ...
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Post 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.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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.)
C8H10N4O2 | #446691 | Trust the nodes.
mohammed
Member
Member
Posts: 93
Joined: Mon Jan 30, 2006 12:00 am
Location: Mansoura, Egypt

Post by mohammed »

well,i will use GRUB :)
about the drive: thanks about the formula to fix the filesystem but i formated the drive already :(
Post Reply