cryptswap overwrites existing LUKS partition

Bug #1960916 reported by RedFantom
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cryptsetup (Ubuntu)
New
Undecided
Unassigned

Bug Description

This bug is related to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/474258

In spite of the implementation of cryptswap checking for existing filesystems, I think I have encountered a bug. cryptswap still creates the swap partition if the target partition does not contain a filesystem, but a LUKS partition.

I have been able to reproduce this issue without meaning to. After adding a drive my /dev/sdX assignments shifted, and I lost a partition full of data. However, in spite of attempts to recreate the data partition, the LUKS header kept being overwritten by random data.

That's when I saw this: https://imgur.com/Zl5sYbkl.png

cryptswap has been overwriting the partitions. The partitions contained LUKS Encrypted ext4 filesystems created using gnome-disks.

I have a specific hardware device that I use for SWAP, so in a way it was my own mistake for not updating /etc/crypttab when connecting the new drive, but in my opinion cryptswap should not destroy a LUKS partition to a point where even with header it is difficult to recover any data simply because a drive has been changed. As far as I have been able to find, cryptswap with UUID is still not possible after all.

Tags: dataloss
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.