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

Re: Recovering the original boot sector



On Sat, 5 Jun 1999 18:53:38 -0500 (CDT), Jor-el <jorel@ibm.net> wrote:

>	When I purchased my PC, it came with Win95 preloaded. After
>installing linux on it, lilo did back up the original bootsector and
>stored it in /boot, but over the past two years, and after a couple of
>Linux reinstalls, I lost the original bootsector (blush). Now, I am
>planning to reorganize my Win95 partition again, and I need to recover the
>original bootsector.

  From your description I take it that when you say bootsector you
actually mean master boot record.  They are not the same.  The master
boot record is the very first sector of the harddisk, containing the
partition table; a bootsector is the very first sector of a partition,
(possibly) containing the partition boot code.

  What reorganization do you plan for your W95 partition, and why would
you want to recover the original MBR for it?  The partition table is not
altered by LILO, and that's the only thing W95 cares about.  LILO
doesn't change the W95 bootsector.

>	They did say that 'fdisk /MBR' would recreate the original
>bootsector. So here is what I propose to do :

  The (undocumented) MS-DOS command "fdisk /mbr" restores the original
MS-DOS MBR software, but leaves the partition table as it is.
Effectively, it gets rid of LILO.  Is this what you want?  If so, you
may also want to use (DOS or Linux) fdisk to set the active flag to the
partition you want to boot.

>1.  Take backups of th existing bootsector. Create Linux bootdisk.

  Both are always a wise thing to do.

>2.  Run 'fdisk /MBR' from within Win95. This should wipe out my existing
>partition table in the MBR (first 512 bytes).

  Your partition table will not be altered, just the MBR software
(wiping out LILO instead).

>3.  Reboot using my Linux boot disk. Now create a copy of the old (backed
>up) bootsector (file A).
>4.  do 'dd if=/dev/hda of=/boot/B bs=446 count=1'
>5.  do 'dd if=/boot/B of=/boot/A bs=446 count=1'

  All this is redundant, and probably doesn't do what you think it does
anyway.

  HTH,
  Gertjan.

-- 
Gertjan Klein <gklein@xs4all.nl>
The Boot Control home page: http://www.xs4all.nl/~gklein/bcpage.html


Reply to: