Prior to running the dd
command, the command lsblk
returned the output below:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
The command dd if=/dev/urandom of=/dev/sda conv=fsync status=progress
is run. The device however loses power and shuts down. When power is reinstated, the command lsblk
returns the following output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
sda2 8:2 0 487.5G 0 disk
Best Answer
Several possibilities:
Linux supports a lot of different partition table types, some of which use very few magic bytes, and then it's easy to mis-identify random data (*) [so it's possible to randomly generate a somewhat "valid" partition table].
Some partition table types have backups at the end of the disk as well (most notably GPT) and that could be picked up on if the start of the drive was replaced with random garbage.
The device doesn't work properly and it was disconnected before it finished writing the data, or keeps returning old data, so partition table survives. Sometimes this happens with USB sticks.
...
(*) Make 1000 files with random data in them and see what comes out:
The goal of random-shredding a drive is to make old data vanish for good. There is no promise the drive will appear empty, unused, in pristine condition afterwards.
It's common to follow up with a zero wipe to achieve that. If you are using LVM, it's normal for LVM to zero out the first few sectors of any LV you create so old data won't interfere.
There's also a dedicated utility (
wipefs
) to get rid of old magic byte signatures which you can use to get rid of filesystem and partition table metadata.