I recently posted a question asking about how to fix a complicated problem with my laptop after partitioning my hard drive. The problem is here -How do I undo those partitions I made for dual booting? -but long story short I'm considering just wiping everything and starting again. Someone offered me this advice:

Simplest way to start again... boot your USB stick, open a terminal, and

Work out which drive is the main drive

Wipe it with zeroes (you only need to do a few seconds worth to wipe the partition table)

sudo fdisk -l <-- Look at the output of this to find the disk that matches the HD

sudo dd if=/dev/zero of= bs=32M

What this does

sudo elevates the privileges to root because you need that to write to raw disk devicesdd was originally "dupe disk" but it's just a very powerful raw copy utility/dev/zero is a special file on Linux that is just an infinite pool of zeroes - here we're using as the ifor input fileReplace  with the right device identifier, e.g. /dev/sda

Beware - the dd command is powerful and can write to raw disk devices when running as root. This means you can wipe any drive connected to the machine - including the USB thumb you're using as a boot disk. Check the output of fdisk very carefully to make sure which disk you want to wipe.

I would just put on a comment but I need an answer somewhat urgently so if I followed this advice, would this erase partitions that I foolishly created, giving me the storage back? Because in short, I halved my hard drive space between windows and left the rest for ubuntu but I messed up and spread around (lost) the free space and so forth. Will this command (or any command or program I can run from live usb, I have NO OS) reset my hard drive so it was like it was when I bought the laptop (sans windows)? Please is there any solution that won't damage my hard drive or reduce space/performance? Nothing like DBAN please.

This is a pretty tall order I know but any help is appreciated.

1 Answer 1


I would recommend using GParted since you will have a visual cue of what is going on. In GParted, you will have list of partitions on a particular disk. You can make your preferred changes to a disk or partition and apply those changes when done.

I read your other question and it seems there might be a problem with the bootable USB you created. If you have access to another computer, try recreating the bootable USB (using a new iso if possible).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .