How do I destroy my installation? (render it unbootable?)

6,152

Solution 1

This command deletes your system irrevocably. This information is for educational purposes only and I am not responsible for your misuse of this information

sudo rm --no-preserve-root -rf / deletes everything recursively from root down to other directories , including kernel and any system binaries. Works in both VM and physically installed OS.

Solution 2

To remove a virtual machine completely from Virtual Box we can select it from the Virtual Box Manager:

enter image description here

On right click context menu select Remove or press Ctrl + R:

enter image description here

On choosing Delete all files all files associated to this machine including snapshots will be irreversibly removed.

In case we had created a VDI virtual hard drive used for other machines as well we may need to remove them separately from the Virtual Box Media Manager Ctrl + D:

enter image description here

Solution 3

This'll nuke you're MBR as well as your EFI partition. (Assuming the EFI partition isn't bigger than 64MB)

sudo dd if=/dev/urandom of=/dev/sda bs=1M count=64

This'll ruin your permissions, and render the system unbootable:

sudo chmod -r 777 /

This'll hang your system:

:(){ :|: & };:

Solution 4

  1. Use lsblk to find the partition Ubuntu is installed to. It should be mounted to /.
  2. Replacing /dev/sda1 with the actual partition (found in step 1), run this command:

    sudo dd if=/dev/urandom of=/dev/sda1
    
  3. Enjoy.

If you want to nuke the entire drive, take the number of the Ubuntu partition off, revealing something like /dev/sda, and use that.

This command will completely wipe out every single bit of data on the given partition pretty reliably, allowing little to no chance of recovery if not stopped very quickly.

Alternatively, if you need it gone now with zero chance of recovery:

If you do not have dynamite available, thermite, a drill, a hammer, or a large neodymium magnet will also be acceptable in a pinch.

Solution 5

You can run wipefs on each partition of your intallation. wipefs returns immedialty so it is very quick. So for example,

wipefs -a /dev/sda1

will wipe trace of a filesystem (any of them) in /dev/sda1 partition. It could be recoverable but the goal was to render it unbootable not irrecoverable.

If you use LUKS you can delete the header with dd, as already mentionned.

Share:
6,152

Related videos on Youtube

Eskils
Author by

Eskils

Recycle! This is the only planet with Swift.

Updated on September 18, 2022

Comments

  • Eskils
    Eskils over 1 year

    How can I destroy my Ubuntu system (in a virtual PC) or render it unbootable?

  • Dan Brown
    Dan Brown over 7 years
    Ah, beautiful death. Thank God it's only a VM (And that I didn't run it on my windows device.)
  • Csabi Vidó
    Csabi Vidó over 7 years
    …and all the other partitions on the drive too.
  • solsTiCe
    solsTiCe over 7 years
    there is a backup of the partition table in EFI at the end of the drive
  • You'reAGitForNotUsingGit
    You'reAGitForNotUsingGit over 7 years
    @solsTiCe - But if the EFI partition is wiped out, as it will be, then that backup is also toast.
  • WinEunuuchs2Unix
    WinEunuuchs2Unix almost 6 years
    This is probably best answer but I wonder about space returned to OS depending on fixed length or variable length storage?
  • Takkat
    Takkat almost 6 years
    @WinEunuuchs2Unix On "delete all files" all virtual hard drive space is released to the host. If a VDI is used by another VM you need to remove it there too.
  • Archisman Panigrahi
    Archisman Panigrahi almost 3 years
    How does the last command (for hanging the system) work?
  • Levente
    Levente almost 3 years
    @ArchismanPanigrahi it's called a fork bomb. The article has this string in the "Implementation" section.