Linux Delete / Remove MBR

I‘ve installed an usb image on Pen drive along with MBR. Now, I need to use this USB pen for other purpose. Is there a way in Linux to delete the mbr (just like dos fdisk /mbr command)?

You can delete the mbr (master boot recored) using the dd command itself. A master boot record (MBR) is the 512-byte boot sector that is the first sector of a partitioned data storage device of a hard disk.

Understanding MBR size

The mbr size is as follows in bytes:

Tutorial details
Difficulty Advanced (rss)
Root privileges Yes
Requirements dd
Time N/A
Where,446 + 64 + 2 = 512
  1. 446 bytes – Bootstrap.
  2. 64 bytes – Partition table.
  3. 2 bytes – Signature.
WARNING! These examples may crash your computer if executed. The following command will completely delete your MBR including all your partition information. So make sure you use the correct device name and block size in bytes.

Option #1: Command to delete mbr including all partitions

Open a terminal and type the following command command to delete everything:
# dd if=/dev/zero of=/dev/sdc bs=512 count=1
Sample outputs:

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00308483 s, 166 kB/s


  • if=/dev/zero – Read data from /dev/zero and write it to /dev/sdc.
  • of=/dev/sdc – /dev/sdc is the USB drive to remove the MBR including all partitions.
  • bs=512 – Read from /dev/zero and write to /dev/sdc up to 512 BYTES bytes at a time.
  • count=1 – Copy only 1 BLOCK input blocks.

Option #2: Command to delete mbr only

The following command will erase mbr, but not your partitions:
# dd if=/dev/zero of=/dev/sdc bs=446 count=1

  • bs=446 – Read from /dev/zero and write to /dev/sdc up to 446 BYTES bytes at a time.
See also

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
23 comments… add one
  • sylvainulg Aug 23, 2011 @ 7:45

    IIrc, fdisk /mbr does not “delete” your MBR. Instead, it overwrites it with a fresh one. Pasting zeroes on your MBR means it’s no longer a valid boot device (no 55AA signature at the end), it no longer has a bootstrap code on it (typically, it wont say “not bootable partition” if left in a booting computer), and has no structure to welcome new partitions.

    Maybe that still does the trick to ensure another tool will not complain that “there is already something installed on this device”, but I remain skeptic over the actual benefit of this step.

    • Jidifi Sep 16, 2011 @ 6:55

      Linux has a perfect and very easy tool for partitionning anything, fresh devices
      without mbr for instance : cfdisk (see: man cfdisk).

  • angry_user Jun 23, 2012 @ 12:51

    This command delete ALL THE DISK, not just MBR. If you have no idea about what are you writing, better STOP writing.
    For you fault I’ve lost all my disk. This blog is a s****t.

    • AlexC Aug 27, 2012 @ 22:02

      I could understand why you are upset. however, you should have read, its pretty clear to me: “The following command will completely delete your MBR, which contains all your partition information….”. BTW, you could have restore your partition. Lastly, there is a link you could have used to delete only the bootstrap part. Don’t get angry after people because you execute command without reading and understanding them first. Again, there is no error in the information provided.

    • Chris Feb 23, 2013 @ 10:13

      I loll’d

      • nigra May 27, 2013 @ 12:50


      • Dmitri Aug 4, 2016 @ 0:58

        I cracked at “This blog is a s****t”

    • nate Feb 20, 2014 @ 0:41

      you have to be kidding me… i mean. its obvious. why would you want to keep whats on the disk if you’re about to delete the MBR.

      you need to realize what you’re doing. then realize that what you’re doing is wrong.

      don’t get pissed at this blog for doing exactly what it is supossed to.

  • creatron Oct 14, 2012 @ 17:08

    Indeed the above comments is valid , you could (shall) destroy the partition info, alias everything, leaving many readers in a very unpleasant condition.

    dd if=/dev/zero of=/dev/sdc bs=446 count=1
    to clear the MBR
    dd if=/home/dd-mbr.raw of=/dev/sdc bs=446
    to restore it from a backup.

    Note: To create a backup, one indeed need bs=512, then the partition info is also saved.

    Please update the page as this is totally unclear

  • 🐧 nixCraft May 27, 2013 @ 15:57

    Alright, the faq has been updated as per request so that new users will not get confused.

  • Onykage Nov 27, 2014 @ 0:11

    So, without reading what this guy wrote in his blog you scrolled down to the first example dd code and typed in exactly what you read and hit enter. THEN you realise wth happened to the disk? Me personally, why on gods green earth would you give directions on how to delete the jurnal on your disk using a program that does exactly what you tell it to with zero warning. But whatever. So if you did just deleted your disks journal because you didnt read… your next shot at linux should be the following snippit.

    gpart -W /dev/sdc /devsdc

    and for future uses with dd i’ll bet you’ll never use the number 512 again. check out this article for some extra reading on the subject.


  • Alexey Feb 12, 2015 @ 23:07

    Thank you so much. You helped me a lot.

  • behzad Jul 24, 2015 @ 13:34


  • Trego Jul 25, 2015 @ 23:05

    I have Ubutntu and trying to put back Win7.
    I have tried everything I know (little to nothing) to get the Win 7 running again.
    I have look at about every website/blog I could fine with information to do want I desire to see work for me.

    I have done:
    dd if=/dev/zero of=/dev/sdc bs=446 count=1

    then i got this:
    dd: opening ‘/dev/sda’ : Permission denied

    I need help?

    I am the only person to access and install to any PC i am running these OS options.

    • 🐧 Vivek Gite Jul 26, 2015 @ 8:15

      Add sudo

      sudo dd if=/dev/zero of=/dev/sdc bs=446 count=1
      • Trego Jul 26, 2015 @ 20:15

        I tried it and no good. I received this:

        dd: opening `/dev/sdc’: No medium found

        • wtm (I AM CHINESE) Nov 21, 2015 @ 15:40

          You should replace `sdc’ with your disk
          sda(the first disk you have)
          or sdb(the second disk you have)
          which typing `sudo dd if=/dev/zero of=/dev/sdb bs=446 count=1′ will clear the mbr of your second disk.
          Don’t mind my poor English.

  • Trego Jul 26, 2015 @ 20:11

    After, sudo dd if=/dev/zero of=/dev/sdc bs=446 count=1 , does work out.

    What can i do next to ensure Win7 will install, maybe use Dban to nuke?

    • Lukas Sep 12, 2015 @ 17:17

      You probably won’t read this, but here goes:

      Win7 doesn’t care at all about existing Linux partitions. You can delete them in the Windows installer.
      It is however a good idea to make sure your disk is in MBR format and not GPT (google it)

  • wtm (I AM CHINESE) Nov 21, 2015 @ 15:33

    Hello, I am now looking for how to write MBR on Linux System, and I found this.
    What I want to say is: GREAT BLOG!!!
    This blog helped me well.
    BTW, please forget my poor English :)

  • frenzic Mar 16, 2016 @ 22:56

    sudo dd if=/dev/zero of=/dev/sdb bs=446 count=1 worked for me. Thanks.

  • tomlee Sep 7, 2016 @ 12:32

    Good option is conv=notrunc, so command should looks like:

    sudo dd if=/dev/zero of=/dev/sdb bs=446 count=1 conv=notrunc

  • Joel Cross Mar 12, 2017 @ 14:31

    I was up all night trying to fix my partition table after running the first command (maybe I was naive, but when I saw ‘clearing out master boot record’, I thought that’s what the command would do, rather than the much more destructive ‘wiping the partition table’).

    Some suggestions for how you can improve this post to make sure that other people don’t make the same mistake I made:

    * Swap options 1 and 2 so that the less destructive option (and the one that actually does what the title claims) comes first.
    * Give instructions on how to back up the partition table in case something does go wrong.

    One final point, ‘fdisk /mbr’ does not do what you think it does, so it probably shouldn’t be referenced here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @