Where, Is, The, Stupid, MBR
This is all I need to know, where does the MBR install? BIOS? Does it automatically install to hda, no matter which HD Linux is on? HELP! Please, only reply if you have a definite answer, I've gotten enough "I think..."s on this, :).
|
the master boot record (or MBR) is the very first thing written in the first sector of a hard drive ... the master boot program is followed by the partition table itself, and both are stored in the master boot sector. the BIOS executes this master boot program, which examines the partition table, looking for the location of the active partition on the drive, and then turns to the first sector of the active partition to find and load the program in the boot sector of the active partition ...
|
I don't see any replies to your post. Why do you complain about "I think"s? You would avoid the "I think" frustration if you bothered to try http://www.google.com/search?q=MBR+linux+delete+dd
Anyway, BIOS is a piece of software stored on a flash chip on your mobo. Among other things it has the code that reads MBR from the HD and executes the code in it. Now the answer to your question: MBR is stored in the first 512 bytes in the very beginning of the hard drive, before any partitions. You can read it by: dd if=/dev/hda of=my_save_file.bin bs=512 count=1 |
Hehe, sorry, I've posted other posts on various topics about partitioning and dual-booting, and never figured out exactly where the MBR is, ^_^. My only question now is, will Linux install GRUB to a HD other then hda? My BIOS will boot it, I just need to know if it can install it.
|
man grub-install
google: grub install hdb |
Alright, thanks. I guess I'm going to be installing as a single-boot system, then setting it up to dual-boot.
|
Yes.
As artur and DrOzz stated, the MBR is the first 512 bytes of *EACH* drive. I use lilo, installed to the MBR of the second drive & switch boot drive in BIOS on the rare occasion that I boot into XP. Works slicker than snot. unless a local grub guru tells you otherwise, /sbin/grub-install /dev/hdb should do the trick |
The BIOS will read the MBR from the disk specified on the BIOS Setup to be the boot disk.... What I mean is, you set on your BIOS if the CD will be a bootable device, in the same way you can set anyone of the IDEs to be the bootable device. What is done usually is: CD first boot device, floppy (who still uses'em?) second and HDD-0 third. If you want to boot from the second disk (HDB) you just change this HDD-0 to HDD-1. Easy like this :D
|
What I'm going to do is unplug the Windows drive before I install Linux. My only question is, do I have to set up the Linux drive as hda (primary master) in order to install correctly? Or is it ok to have it as hdc?
|
If your system recognizes the drive as hda during the installation, and then as hdc during normal operation, after you plug in the Windows drive - things will break. your /etc/fstab will still have entries for /dev/hda for partitions that are now on /dev/hdc. Also your grub/lilo config file will need to be updated and bootloader reinstalled. It's easy to fix these problems as long as you can boot off of something else into linux. Might get tricky (but not impossible) if your install is the only bootable linux you have. Some BIOSes/installers do call first drive on the second bus "hdc" even if theres nothing plugged in into the first bus, so YMMV.
|
2 questions here.
1) Is it possible to have more than 1 bootloader in the MBR? 2) What does the fix mbr command do? "format" the mbr? |
Quote:
|
Quote:
Quote:
if you want to wipe out your MBR clean(without touching the partition table), this can do it: Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1 |
Quote:
Regarding the codes, where do I type that at? |
This site has some good information on MBR, partition tables etc:
http://www.ata-atapi.com/hiwmbr.htm Quote:
|
All times are GMT -5. The time now is 02:51 PM. |