Return to the main mkusb page

Wipe the first megabyte or the whole device

Check before, that you wipe the intended target drive and nothing else

It is very important that you wipe your intended target drive and nothing else. If you wipe the whole drive, it will be completely wiped, not even PhotoRec can do anything after that operation. But there are other (and better) tools to wipe an entire HDD or SSD for example hdparm or DBAN. If you wipe the first megabyte, the partition tables and file systems are lost. If you stop using the drive, and boot from another drive with PhotoRec, you might be able to save some files.

Wipe the CD file system

If you want to re-use a USB drive that has been used with mkusb, you should wipe it with dd (overwrite with zeros), otherwise for example grub-install doesn't want to write into the mbr area, because it recognizes the CD file system, iso9660. (You need not wipe it before cloning with mkusb, only if you intend to use some other tools to make partitions and file systems.)

You can use mkusb, mkusb-nox, mkusb-dus or dus also for this task and wipe the whole drive, wipe-whole-device, but often it is enough to wipe the first megabyte (or to be correct, mibibyte = 1024*1024 bytes = 2^20 bytes = 1048576 bytes) of the drive, wipe-1

sudo mkusb-nox wipe-1   # wipes the first mibibyte

sudo mkusb-nox restore  # wipes the first mibibyte, creates partition table & partition with FAT32

dus                     # and select restore or wipe via the menu

mkusb version 12 alias dus



mkusb version 9-11 alias classic



Wipe the whole device

To wipe-whole-device with mkusb is a very special task, that is not recommended except in very special situations. Other tools are better to wipe an entire HDD or SSD for example hdparm or DBAN.

mkusb can be a good alternative for USB pendrives to remove information completely

  • to make it impossible to extract private information with tools like PhotoRec

  • to increase the life of pendrives that are close to 'gridlock'. If a pendrive starts running slower, it might soon get 'gridlocked', and wiping might relieve the situation by releasing good memory cells.

  • to increase the speed of pendrives. When old pendrives get slower (typically reduce the writing speed to half), wiping the whole device can recover the original (or near original) write speed. See this link.

Run this option from the command line

sudo -H mkusb wipe-whole-device

sudo mkusb-nox wipe-whole-device


sudo -H mkusb wipe-whole-device
Please wait for sync (flushing file system buffers to the device)
until 'Done' is written ...
dd: writing `/dev/sdd': No space left on device
3.73GB 0:13:10 [4.83MB/s] [             <=>                             ]
Done, but you should also
check for the line 'dd: writing '/dev/sdd': No space left on device',
which means that the whole device is wiped. (Look in the terminal window) 


Wipe menu

mkusb version 12

There is a small wipe menu in mkusb version 12 alias mkusb-dus with two options,

  • 1 "wipe 1 (the first) Mibibyte"

  • w "wipe the Whole device (very slow) - consider other options except for special cases"

mkusb version 9-11

There is a wipe menu in mkusb-11, where you can select several options, either only wiping or wiping plus creating a partition table and some partition(s) and file system(s)

  • s "Standard: create MSDOS partition table with FAT32 partition"

  • b "Big drive: create GUID partition table with NTFS partition"

  • g "General: use 'gparted' to make partition table and partition(s)"

  • a "Advanced: create GUID partition table (skeleton for installing an OS)"

  • f "wipe the First megabyte (mibibyte)"

  • w "wipe the Whole device - consider other options except for special cases"

Make partition(s) after wiping

After wiping you can use gparted to make a new MSDOS partition table and a partition with the FAT32 file system with a boot flag, which is typical for USB pendrives, that should be bootable via other tools for example Unetbootin and Startup Disk Creator. This works to store data and transfer data to Windows and MacOS too.

You might want to create a GUID partition table (GPT) and/or linux partitions ... gparted is a powerful tool, but when you want one of the options in the wipe menu, it is very convenient to get a working partition table with some file system(s).


General tips for 'gparted'

Partition tables: MSDOS is old. GUID (GPT) is new

Use GPT to install operating systems in UEFI mode and for really big drives, more than 2 GB

  • Pull down menu in gparted: Device -- Create partition table -- Advanced -- Select 'gpt'

    • and create at least one partition with a suitable file system.
  • If you plan to connect the drive
    • only to linux, use 'ext4'
    • also to Windows, use 'NTFS'
    • also to Mac OS, use 'FAT32', but it is really not good for big partitions. You may consider making several partitions
  • Add a 'label' to make it easy to identify the drive and its partition

See also this link for more details.

Return to the main mkusb page

mkusb/wipe (last edited 2017-07-24 13:51:35 by ister-kokos)