Wiping the wrong block device in Linux destroys data immediately, so a disk wipe has to start with a confirmed target and an unmounted filesystem. A zero overwrite removes normal reads of previous contents from the selected disk or partition before it is reused, repartitioned, or handed to another system.

Linux exposes storage as block devices such as /dev/sdb and /dev/nvme1n1, with partitions such as /dev/sdb1 below them. Use lsblk to confirm the device path and mount state, wipefs to inspect visible filesystem or partition-table signatures, dd to write zeros across the target, and follow-up reads to confirm that old metadata is no longer visible.

This method overwrites bytes through the normal kernel block-device path. It is not a vendor secure-erase operation for SSD or NVMe media and may not clear inaccessible remapped sectors, so use the drive's own erase or discard workflow when policy requires that level of sanitization. The target must be unmounted first, the running root or boot disk must be handled from live or rescue media, and a wrong of= path in dd erases the wrong device immediately.

Steps to wipe a disk or partition in Linux:

  1. Display the chosen target device and its current mount point before wiping it.
    $ lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS /dev/loop5
    NAME  PATH       SIZE TYPE FSTYPE MOUNTPOINTS
    loop5 /dev/loop5  64M loop        /mnt/wipe-demo

    Replace /dev/loop5 with the disk or partition that should be wiped. Use a whole-disk path such as /dev/sdb or /dev/nvme1n1 to erase an entire drive, or a partition path such as /dev/sdb1 when only one partition should be wiped.

  2. Inspect the current filesystem or partition-table signatures before overwriting them.
    $ sudo wipefs --output DEVICE,OFFSET,TYPE,UUID,LABEL /dev/loop5
    DEVICE OFFSET TYPE UUID                                 LABEL
    loop5  0x438  ext4 cca40684-e408-449d-8db3-ac07088e1687 wipe-demo

    This confirms that the target still exposes recognizable metadata. If wipefs prints no data rows here, the device may already be blank from a previous wipe or format.

  3. Unmount the target device before writing over it.
    $ sudo umount /dev/loop5

    If the target is a whole disk, unmount every mounted child partition on that disk first. If the target is the running root filesystem, a boot volume, or another busy live device, stop here and continue from live or rescue media instead of forcing the wipe from the active system.

  4. Overwrite the entire target with zeros and flush final writes.
    $ sudo dd if=/dev/zero of=/dev/loop5 bs=4M status=progress conv=fsync
    dd: IO error: No space left on device

    The No space left on device line is expected when dd writes until the block device reports its end. On large disks, status=progress may also print periodic byte counts while the overwrite is still running.

  5. Confirm that the wipe removed the visible signatures from the device.
    $ sudo wipefs --noheadings /dev/loop5

    Blank output means wipefs no longer sees a filesystem, RAID, or partition-table signature on the target. wipefs is being used here as a verification command, not as the wipe method.

  6. Sample the first bytes of the device to confirm that the overwrite starts with zeros.
    $ sudo od -An -tx1 -N 64 /dev/loop5
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *

    All-zero readback is a quick spot check after the overwrite. The decisive success state is still the full-device dd write plus blank wipefs output, because a short readback only samples one small part of the disk.