Partition still encrypted with luks after wipefs

I wiped the disk using

wipefs -a /dev/sda.

I happily formatted the disk, and it seems that when I’m about to mount /dev/sda3 it says “unknown file system type crypto_LUKS”.

I did no encryption on this partition, so it’s like the previous configuration is saved somehow.
If I apparently wiped or reset the disk, how can this be possible?

Do I have to open and decrypt and remove encryption on that drive first?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

wipefs -a /dev/sdx only wipes magic signatures on that device, not on its partitions. So at best, it only wipes your partition table, but if you then proceed to re-create the partitions at the same offsets at before, the old data is still there. You’d have to wipe the partitions as well.

wipefs -a /dev/sdx[1-9]* # wipe old partitions
wipefs -a /dev/sdx       # wipe the disk itself
parted /dev/sdx          # create new partitions
wipefs -a /dev/sdx[1-9]* # wipe the new partitions, just in case
# create filesystems or whatever

That aside it’s also entirely possible for wipefs to not wipe something if it doesn’t know the signature. Or for another program to still recognize the data on the partition despite the signature being damaged. wipefs only overwrites a few magic bytes, which is reversible in most cases.

Method 2

Use the much more simple wipe command:

cat /dev/zero > /dev/sda

But BE CAREFULL, all files are history after that.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x