cryptsetup: unable to close a Luks partition due to LVM snapshot reaches 100% usage

Posted on

Hello there,

I've an encrypted LVM partition where my database is located. For backup purposes, I've snapshotted it. Then, I've opened this Luks partition in order to zip my database.

After some days I've forgotten to delete the snapshot, thus my snapshot reached 100% usage.

Now, when I want to close the Luks partition in order to delete the LVM snapshot, this error happens:

cryptsetup -v luksClose /dev/mapper/SnapDecrypted
Cannot read device /dev/mapper/vg1-LogVolDatabaseSnapshot.
Command failed with code 15: Cannot read device /dev/mapper/vg1-LogVolDatabaseSnapshot.

When I try to delete the snapshot:

lvremove /dev/mapper/vg1-LogVolDatabaseSnapshot
/dev/vg1/LogVolDatabaseSnapshot: read failed after 0 of 4096 at 375809572864: Input/output error
/dev/vg1/LogVolDatabaseSnapshot: read failed after 0 of 4096 at 375809630208: Input/output error
/dev/vg1/LogVolDatabaseSnapshot: read failed after 0 of 4096 at 0: Input/output error
/dev/vg1/LogVolDatabaseSnapshot: read failed after 0 of 4096 at 4096: Input/output error
/dev/mapper/SnapDecrypted: read failed after 0 of 4096 at 375807475712: Input/output error
/dev/mapper/SnapDecrypted: read failed after 0 of 4096 at 375807533056: Input/output error
/dev/mapper/SnapDecrypted: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/SnapDecrypted: read failed after 0 of 4096 at 4096: Input/output error
Logical volume vg1/LogVolDatabaseSnapshot is used by another device.

How can I close or delete my Luks partition in order to be able to delete the snapshot ?

Can I use dmsetup remove /dev/mapper/SnapDecrypted ?

Thanks,

Responses