How to wipe up all partitions on disk and do a clean install of Ubuntu

27,555

Yes, if you select "Erase disk and install Ubuntu", this will delete all partitions on the entire disk and create and format new ones for Ubuntu.


This is good enough for personal use if you have no need to irrecoverably wipe all data for security/privacy reasons.

If you feel the need to securely wipe your disk, the simplest way would be to boot from a live Ubuntu DVD or USB drive, select "Try Ubuntu without installing", open a terminal (Ctrl+Alt+T), check which device name your HDD to wipe has using the lsblk command (should be something like /dev/sda) and then overwrite the complete drive with zeroes using the command below (replacing /dev/sdX with the name of the disk you want to wipe!):

sudo dd if=/dev/zero of=/dev/sdX bs=4M status=progress

This will take a while, depending on your disk size and speed. After that, the disk looks like factory-new, no data, partitions or even partition tables left.

After that you can go on installing Ubuntu normally.

Share:
27,555

Related videos on Youtube

Victor
Author by

Victor

Updated on September 18, 2022

Comments

  • Victor
    Victor over 1 year

    Sorry if it's an obvious question, but here's the deal: I have a notebook with dual boot (Ubuntu 12.04 + Win7) and an extra NTFS partition for general storage.

    I want to wipe out all of it and do a clean installation of only Ubuntu 16.04. How should I proceed? Just booting up Ubuntu Live DVD and choosing "Erase disk and install Ubuntu" will delete/format all my partitions and install a fresh Ubuntu?

    TL;DR: I want to start from fresh and wipe all my partitions table (format and delete them) to install Ubuntu 16.04.

  • Victor
    Victor over 7 years
    Do you have any idea how much time it takes to do "sudo dd"? And I have to do it for every sda (sda1, sda2, etc) listed on lsblk, right? But I guess that I don't need to because it's my personal notebook and I will continue using it. My only worry when I asked this question was if the option "Erase disk and install Ubuntu" is enough to wipe all partitions tables, old MBR from Windows, files, etc... not a zero-fill
  • Byte Commander
    Byte Commander over 7 years
    You run dd for the whole disk (e.g. /dev/sda), not for every single partition (e.g. /dev/sda1). How long it would take depends on your drive's size and write speed. It can take up to a few hours. If you don't need a secure wipe, simply let the Ubuntu installer erase the disk and take care of the partitioning. If you want to do it yourself though, use GParted from the Ubuntu live system and tell it to create a new partition table on the disk. That will invalidate all partitioning and formatting info and make the whole disk unpartitioned, but without overwriting the data area.
  • Byte Commander
    Byte Commander over 7 years
    If this answer solves your question, please consider accepting it by clicking the grey check button on its left. Otherwise feel free to comment again and ask for further clarification. To learn more about how this site works, you can spend two minutes on taking our tour. Thanks and welcome to Ask Ubuntu.
  • Victor
    Victor over 7 years
    Thanks for the help, Byte Commander! I really appreciate. EDIT: I can't find the grey check button you told me about.