On Tuesday 20 December 2005 03:45 pm, [EMAIL PROTECTED] wrote: > How can I get a real eyes on look at what is in the MBR. I'm trying > this: > > dd if=/dev/hda of=mbr.img bs=512 count=1 > > I thought maybe it could be mounted so: > mkdir mbr > mount -o loop mbr.img mbr > > But mount wants to know what `type' filesystem it is. I tried a few > things but really didn't expect them to work like: > ext2 msdos minix iso9660 > > None worked of course. So can this be done? Any one know what > should be in there exactly and how to view it? >
The MBR isn't a partition itself, it merely stores the partition information. As I understand it (and if somebody else has better info, or I've got things backward, please correct me), the MBR is the first 512 bytes of the disk. The first 446 bytes of it is the bootstrap loader code itself - the actual workhorse that starts the system up to load the OS. The rest of it (66 bytes) is the core partition information for the disk. Overwriting this part of it will wipe out your partition table - not something you want to do. The book "Linux Desktop Hacks" has a section just on saving, fixing and restoring the MBR. Rather than using bs=512, you'll want to use bs=446 when overwriting the MBR (if you had a backup, and want to do it by hand), or use a tool like grub-install (the Gentoo Handbook has a chapter on configuring the bootloaders - LILO or GRUB - part 1, chapter 10). Good luck. -- Eric Bliss systems design and integration, CreativeCow.Net -- [email protected] mailing list

