Skip to Main Content
Linux Desktop Hacks
book

Linux Desktop Hacks

by Nicholas Petreley, Jono Bacon
March 2005
Beginner to intermediate content levelBeginner to intermediate
342 pages
15h 55m
English
O'Reilly Media, Inc.
Content preview from Linux Desktop Hacks
Bypass the Boot Manager #3
Chapter 1, Booting Linux
|
7
HACK
Because of the bs=446 element, this command only restores the boot code in
the MBR. I purposely left out the last 66 bytes of the file so the partition
table would not be overwritten (just in case you have repartitioned or
changed any partition sizes since your last MBR backup). If you have acci-
dentally corrupted or deleted your partition table, restore the full 512 bytes
to the MBR with:
knoppix@ttyp0[knoppix]$ sudo dd if=mbr_backup of=/dev/hda bs=512 count=1
How Do I fdisk/mbr?
Knoppix also provides a useful tool called install-mbr that allows you to
manipulate the MBR in many ways. The most useful feature of this tool is
that it can install a “default” master boot record on a drive, which is useful if
you want to remove lilo or grub completely from the MBR so Windows can
boot by itself, or so you can install Windows to a hard drive that previously
used Linux. The results are the same as if you were to type
fdisk /mbr in
DOS. To remove the traces of lilo or grub from your MBR, run:
knoppix@ttyp0[knoppix]$ sudo install-mbr /dev/hda
Replace /dev/hda with your drive.
See Also
The install-mbr manpage by typing man install-mbr in a console.
—Kyle Rankin
HACK
#3
Bypass the Boot Manager Hack #3
Save your system from a broken or missing kernel.
Of all the fantastic things you can do with your Linux box, one of the most
nerve-wracking activities is
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Server Hacks, Volume Two

Linux Server Hacks, Volume Two

William von Hagen, Brian K. Jones
Introducing Linux Distros

Introducing Linux Distros

Jose Dieguez Castro

Publisher Resources

ISBN: 0596009119Supplemental ContentCatalog PageErrata