Score:0

Securely erase the drive with DBAN using USB to boot

br flag

I am selling my laptop and I want to make sure to erase all the data.

I am on ubuntu 18.04 in Dell. I have tried to use DBAN with a USB boot. I am using rufus to create my boot, but when I run rufus and I chose DBAN ios, the partition scheme is fixed to MBR and not GPT. I am searching for a way to create an USB bootable with GPT partition scheme.

ru flag
DBAN may not be a UEFI-capable ISO. From what I can tell, in BIOS you should switch the drive to Legacy/MBR mode, then boot to DBAN and wipe the disk. Then switching back to UEFI will keep the system UEFI-capable. But I don't think DBAN has a UEFI-bootable ISO.
Score:2
ru flag

DBAN is a MBR-only ISO and as such does NOT have a UEFI bootable mode - it is fairly old even though it still works, and doesn't have a UEFI boot option in it. You can take the approach of switching your BIOS/system to MBR, run DBAN, then switch to UEFI again. The data will still be gone on disk.


However, I may have an alternative to DBAN, if you're interested: Use an Ubuntu installation / Live USB disk as a base, then use tools in Linux already to erase the disk.

Instead of writing DBAN to a USB, there are tools you can use already in Linux, and can erase data with ease like DBAN does. Both the options I suggest here start with writing Ubuntu 18.04 or 20.04 Desktop LiveUSB to the disk instead (20.04 recommended). Reboot to that disk.

Then, ppen up a terminal in the LiveUSB and run sudo fdisk -l and find the hard drive in question. It should have an /dev/sdX type indicator (where X is a letter) or an nvmeXnY (where X is a number and Y is a number).

The dd approach

Then run this:

sudo dd if=/dev/zero of=/dev/DEVNAME bs=1024

... where DEVNAME is the device found in the previous set of commands.

This will run and overwrite your disk with zeros from start to end. Note that this will take a long time without any progress indicator.

If you are using Ubuntu 20.04 in your LiveUSB, then use this, which does have a status indicator:

sudo dd if=/dev/zero of=/dev/DEVNAME status=progress

The dcfldd approach

This requires you to first run in the LiveUSB these commands in terminal:

sudo add-apt-repository universe
sudo apt update

The program dcfldd is a modified version of dd in the Universe repository designed for work with forensics specialty so it has a lot of other tools and hash sum verifications to validate wipes and hashes. This also comes with status meters for progress, and reports as it goes (in Ubuntu 18.04, dd did not have this, so if you are using 18.04 in your LiveUSB for this, you may want to use the dcfldd option instead if you want a progress indicator)

It uses a larger block size (bs) by default, but is also more than capable of wiping your disks, and is an alternative to dd because it has status tracking and indications as it goes.

Similar to above, use:

sudo dcfldd if=/dev/zero of=/dev/DEVNAME status=on

What this does is runs dcfldd with the same options, except it defaults to the 32768 bytesize block size for how it processes. This also has a status indicator which we're forcing 'on' here.

This essentially does the same thing as dd, but is faster and has a guarantee of a status indicator.

Farah Mind avatar
br flag
I have checked the Boot options, I have only UEFI, the legacy boot mode is not supported.
Farah Mind avatar
br flag
by "writing Ubuntu 18.04 or 20.04 Desktop LiveUSB to the disk instead (20.04 recommended)", you mean I create a bootable ubuntu USB stick?
ru flag
Correct, but only the installer, as in the standard ISOs you'd use to install Ubuntu with. Write that to the USB, and it can boot into UEFI mode. you can then utilize one of the other tools in my answer to wipe the target drive.
Farah Mind avatar
br flag
thank you for your answer. Is there any difference with the two ways you have mentioned and the erasing using the shred command?
ru flag
@FarahMind the manpage for `shred` says that there are examples of filesystems where `shred` does not work - such as "log-structured or journaled file systems such as those supplied with AIX and Solaris (and JFS, ReiserFFS, Ext3, etc.)". Ubuntu uses ext4 by default which is one of those journaled file systems. Therefore "many modern file system designs" do not satisfy the original assumptions behind `shred` which is that the filesystem overwrites in place. `dd` and the `dcfldd` ways write direct to disk AND overwrite the filesystem journal in the process (first 32 bytes) - `shred` doesn't.
ru flag
`dd` and `dcfldd` are closer to what DBAN does.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.