Hi Rohit,
>
> I see. Then you will answer this query of mine so that I don't go astray
> in future.
>
OK - I give into blackmail.. Can't stand nice kids going astray !! ;-)
> 1. Does data storage in MBR depend on something like
> format/configuration of HDD? Or is MBR totally out of reach of any
> utility/OS?
MBR is nothing but the first physical sector on your HDD. i.e. Cylinder 0,
Side 0, Sector 1 (Sad but sectors start at 1 - probably the guys who
invented it didn't think in "c" or Assembly !)
Any OS can read & write from any physical device it has access to - unless
the device is read or write protected by means of a physical protection
mechanism. (which means you can happily nuke your entire NTFS partition -
leave alone the MBR - from within Linux !)
Login as root and type in the following command very carefully (dd is a
very dangerous tool !) to make a copy of your MBR (of your hda drive) into
your root directory.
dd if=/dev/hda of=~/bootsec bs=512 count=1
Now you should have a 512 byte file called "bootsec" in your /root
directory. That's a copy of your boot sector. You can view it in hex mode
using the "mc" viewer.
The last 2 bytes of the MBR holds the signature bytes 0x55, 0xAA which
indicates that it's a valid MBR.
The 64 bytes starting at offset 0x1BE hold the partition table (16 bytes
per partition entry)
The area from 0 to 0x1BD is your bootup code. (You can find the source
for this (assembly) in the file first.S in your lilo sources)
You could even modify this file and write it back to your MBR by
interchanging the "if=" and "of=" parameters of the dd command above.
(and end up with an unbootable hard disk ! ;-) )
> > Check if your BIOS had Virus protection enabled at the time of
> > installing Linux. In such a case, it would have been the BIOS that
> > prevented you from writing to the MBR.
>
> Oh that is not the case. My BIOS is _Enabled_ to protect itself from
> viruses but it gives me proper warning in that case and interactively
> allows me to write-to-the-MBR-on-the-fly.
>
Well - don't take these "warnings" too seriously ! They might work only
if the program (that writes to the MBR) uses the BIOS to do the actual
writes. And also, I had a machine a while back which used to simply fail
the write without any warning when installing some operating systems
(Don't recall if it was Linux or NT).
So the moral of the story is : if you're installing an OS which *needs* to
write to the MBR (and you're willing to allow it), always disable the
Virus Protection to be on the safer side and avoid unpredictable results.
Kala
--------------------------------------------------------------------------
LI is all for free speech, but this list was created for a purpose --
to help popularise Linux in India. If your messages are counterproductive
to that purpose, your privileges to submit messages can and will be revoked.