UNIX / How to initialize the MBR from a UNIX prompt

Home | UNIX | Practical

How to initialize the MBR from a UNIX prompt
and how to create DOS bootable floppies from a UNIX prompt


Initialize MBR
The DOS equivalent for "fdisk /mbr" on UNIX is,
dd if=/dev/zero of=/dev/sdX bs=446 count=1
To remove the partition table with it,
dd if=/dev/zero of=/dev/sdX bs=512 count=1

Note there's a tool to do that otherwise,
ms-sys.sourceforge.net/

To backup the MBR & parttable,
dd if=/dev/hdx of=MBR-backup bs=512 count=1
To restore the MBR & parttable,
dd if=MBR-backup of=/dev/hdx bs=512 count=1


DOS bootable floppy
To make a DOS bootable floppy on DOS,
format a: /s
and on UNIX,
fdformat /dev/fd0u1680
mformat a:
ms-sys -w /dev/fd0
mcopy /dosc/io.sys a:
mcopy /dosc/msdos.sys a:
mcopy /dosc/command.com a:


Links
ms-sys.sourceforge.net/,
mtools.linux.lu/
en.wikipedia.org/wiki/Fdformat


References
www.cyberciti.biz/faq/linux-how-to-uninstall-grub/
ubuntu.wordpress.com/2005/10/20/backing-up-the-mbr/


Sat Nov 8 12:19:49 CET 2008
       © 2008 Pierre-Philipp Braun