无法关闭Luks分区


13

为了备份,我“快照”了一个LVM分区。该分区已加密,因此我已打开此Luks分区(快照)以进行备份。

问题是我忘记删除快照,因此快照使用率达到了100%。

当我尝试删除快照时:

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.

这很正常,我必须首先关闭Luks分区:

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.

我如何关闭或删除Luks分区才能删除快照?

我可以使用“ dmsetup remove / dev / mapper / SnapshotDecrypted”然后使用“ lvremove / dev / vgx / LogVolDBSnapshot”吗?

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

dmsetup ls和的输出是dmsetup table什么?
Hauke Laging

1
嗨@HaukeLaging!这是ls的输出:SnapshotDecrypted (253:17)vgx-LogVolDBSnapshot (253:14)和table:SnapshotDecrypted: 0 733999104 crypt aes-cbc-essiv:sha256 0000000000000000000000000000000000000000000000000000000000000000 0 253:14 4096vgx-LogVolDBSnapshot: 0 734003200 snapshot 253:15 253:16 P 8
Bob Sauvage 2014年

谢谢@StephaneChazelas,但是我无法按照我的第一篇文章中所述删除快照设备:/!Logical volume vgx/LogVolDBSnapshot is used by another device.=> Luks分区使用它:/
Bob Sauvage

7
对不起,我是说dmsetup remove SnapshotDecrypted。是的,您的最后一个问题。也就是说,不luksClose它,只是将其删除(luksClose写的东西出来(这作为快照已满,不能在这里做的),并dmsetup删除)
斯特凡Chazelas

1
@StephaneChazelas您的评论将是一个不错的答案!
George Udosen '17

Answers:


1

解决问题的一种方法是:

  1. 插入USB驱动器或将物理存储器连接到相关系统。
  2. 将VG扩展到USB上。
  3. 现在,您将有足够的空间来关闭
  4. 关闭快照删除它
  5. 使用vgreduce从卷组中删除临时设备。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.