Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

For backup purposes, I have "snapshotted" a LVM partition. This partition was crypted so I have opened this Luks partition (snapshot) in order to do my backup.

The problem is that I have forgotten to delete the snapshot, thus it reached 100% usage.

When I try to delete the snapshot:

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

That's quite normal, I have to close my Luks partition in first:

cryptsetup -v luksClose /dev/mapper/SnapshotDecrypted
Cannot read device /dev/mapper/vgx-LogVolDBSnapshot.
Command failed with code 15: Cannot read device /dev/mapper/vgx-LogVolDBSnapshot.

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/SnapshotDecrypted" and then "lvremove /dev/vgx/LogVolDBSnapshot" ?

output of dmsetup

dmsetup ls
SnapshotDecrypted (253:17)
vgx-LogVolDBSnapshot (253:14)

dmsetup table
SnapshotDecrypted: 0 733999104 crypt aes-cbc-essiv:sha256 0...0 0 253:14 4096
vgx-LogVolDBSnapshot: 0 734003200 snapshot 253:15 253:16 P 8
share|improve this question
    
What is the output of dmsetup ls and dmsetup table? –  Hauke Laging Feb 28 at 13:31
    
Hi @HaukeLaging ! Here is the output of ls: SnapshotDecrypted (253:17) & vgx-LogVolDBSnapshot (253:14) and table: SnapshotDecrypted: 0 733999104 crypt aes-cbc-essiv:sha256 0000000000000000000000000000000000000000000000000000000000000000 0 253:14 4096 & vgx-LogVolDBSnapshot: 0 734003200 snapshot 253:15 253:16 P 8 –  Bob Sauvage Feb 28 at 13:38
    
Thanks @StephaneChazelas but I'm not able to remove the snapshot device as sayed in my first post :/ ! Logical volume vgx/LogVolDBSnapshot is used by another device. => It is used by the Luks partition :/ –  Bob Sauvage Feb 28 at 13:40
2  
Sorry, I meant dmsetup remove SnapshotDecrypted. So yes to your last question. That is, don't luksClose it, just remove it (luksClose writes things to it (which it can't do here as the snapshot is full) and them dmsetup removes) –  Stéphane Chazelas Feb 28 at 13:46
    
Many thanks for the confirmation @StephaneChazelas ! –  Bob Sauvage Feb 28 at 14:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.