How to kill a hard drive in Linux quietly with an easy way to undo it

We know that we can kill Linux by running the command rm -rf /, but this can’t be undone as your files are gone. Here’s a quick way to make your hard drive look like formatted and how to undo that easily (tested under VMWare with ubuntu), click each picture for more information.

First back up the first 10000 bytes of the hard drive and then replace it with empty data.

Everything seemed to be OK and we could still shut down normally, but……..

After we restart, it won’t boot anymore with an empty MBR and all the partitions are gone! To fix it we need to boot from a boot disk and restore what we backed up.

After all this it everything worked again. Now restart and check it…

Inspiration from my very sad personal experience:

Once upon a time I thought the first 512 bytes of hda1(where my Windows is installed) is the MBR but in fact it’s supposed to be the first 512 bytes of hda, I ran the command “dd if=/dev/zero of=/dev/hda1 bs=512 count=1″ and thought this would reset the MBR, but the Windows partition is ruined instead!

6 thoughts on “How to kill a hard drive in Linux quietly with an easy way to undo it”

  1. actually, the mbr are the first 446 bytes of the disk, the next 64 bytes are the partition table and the next 2 are a magic number (55aa) so, if you delete the first 512 bytes of the disk youre basically killing your partition table too and your partitions will be lost, luckily there are tools that can check the disk for specific filesystem signatures and rebuild that (parted)

  2. Hi, I was searching for a website like yours four hours and i spent a lot of time to read all your blog. I post a message only today, but this particular article is so cool and well written, that I’ve just want to say you thanks for all the job you did here and thanks again for writing this one article. Good bye

Leave a Reply

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

You may use these HTML tags and attributes: