mbr in linux

fdisk /mbr
ever used the above in dos? but this doesn't work in linux. there are times when i have a need for this. i usually install bootloaders on specific partitions than on the mbr.

dd can be used for such requirements. the following will wipe your mbr clean

# dd if=/dev/zero of=/dev/xxx bs=446 count=1
where xxx is your disk.

how/where do i use this? i have been playing with many different os for a long time. every os wants to install their own bootloader into the mbr. but, we can't really have that, can we? not if we want them to exist simultaneously on the same disk.

i always install the bootloader on the same partition as the os, and wipe the mbr clean. then use fdisk to make a partition active and reboot to load that os. an os could do whatever with its bootloader and not bother me. this method can also be used to play with multiple bootloaders, each on a separate partition. i arrived at this method, after much grief from trashed bootloaders.

caution: just in case, make a backup of your mbr, before you wipe it.
# dd if=/dev/xxx of=xxx-mbr.raw bs=446 count=1

and restore it, like so
# dd if=xxx-mbr.raw of=/dev/xxx

No comments:

Post a Comment

most popular posts