How to Erase MBR In Linux

The Master Boot Record (MBR) is the information in the first sector of any hard disk or diskette that identifies how and where an operating system is located so that it can be boot (loaded) into the computer’s main storage or random access memory. The Master Boot Record is also sometimes called the “partition sector” or the “master partition table” because it includes a table that locates

each partition that the hard disk has been formatted into. In addition to this table, the MBR also includes a program that reads the boot sector record of the partition containing the operating system to be booted into RAM. In turn, that record contains a program that loads the rest of the operating system into RAM.


how to erase MBR in Linux ?

Answer :

# dd if=/dev/zero of=/dev/hda1 bs=512 count=1


bs = the first 512 bytes of the harddrive to remove the bootloader

  • shortbaldman

    If you use a figure of 512 bytes to be zeroed out, you will also zero out the disk’s partition table. The bs count needs to be less than 512 so that the partition table is retained. (I don’t have the actual figure with me at the moment. You should be able to Google for it.)

  • pirat9

    Tp wipe out the partition table also, change 446 to 512.

  • Robert Brockway

    erasing 512 bytes like this will destroy the partition table.  set bs=446 to erase the boot loader and leave the partition table intact.

  • Pingback: Erase mbr | Figifoto()

  • Piomar

    Shouldn’t the output be like this: of=/dev/hda not of=/dev/hda1 (the entire drive not the first partition)? Or it doesn’t matter?

  • creatron

    Please correct the above, the correct answer is indeed as suggested above
    dd if=/dev/zero of=/dev/sda count=1 bs=446

  • Andrew Ampers Taylor

    I have tried whole scripts trying to get my computer back, finally, I tried this in Live Ubuntu 13.05 and it workedd, after a small tweak.

    Just need to add sudo and a space before dd

    Thanks, you have evidently heard of the K.I.S.S. principle!


  • Cheap category1 Jerseys Outlet With Lowest Price

    Wholesale NBA Iphone Case Online With Best Discount

  • super bowl jerseys cheap china

    Cheap nfl Hats outlet, Wholesale nfl Hats from china official Hats factory with the fast free shipping.

  • Buy Wholesale Cheap Football Jerseys Online Store

    2013 nfl jerseys online for sale, China nfl Jerseys wholesale supply center.

  • wholesale jerseys reviews

    All new 2013 NBA Shorts is in store, Get NBA Shorts and wear the latest NBA Shorts.

  • Cheap NFL Jerseys China

    Best shopping time for shop nfl Jerseys at the largest online Store from china with wholesale price.