rsnapshot LVM无法删除快照卷

前端之家收集整理的这篇文章主要介绍了rsnapshot LVM无法删除快照卷前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在Debian Wheezy服务器上使用rsnapshot.这是最近从挤压升级.自升级以来,我从小时cron作业中收到以下错误
remote rm -rf /share/HDA_DATA/backup/rsnapshot/hourly.3 p1=-rf p2=/backup/rsnapshot/hourly.3/
remote cp -al /share/HDA_DATA/backup/rsnapshot/hourly.0 /share/HDA_DATA/backup/rsnapshot/hourly.1 p1=-al p2=/backup/rsnapshot/hourly.0
  Logical volume "rsnapshot" successfully removed
  Logical volume "rsnapshot" successfully removed
  Unable to deactivate open raid5-dl-real (254:4)
  Failed to resume dl.
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot hourly 
----------------------------------------------------------------------------
ERROR: Removal of LVM snapshot Failed: 1280

正确备份了两个LVM卷并成功删除了逻辑卷“rsnapshot”,但随后它在lvm VG raid5中达到卷dl并看到无法停用raid5-dl-real.

我的lvm快照的名称叫做raid5 / rsnapshot. raid5-dl-real与卷名不对应 – 真实设备是/ dev / mapper / raid5-dl.

因此,如果这是dl卷本身,为什么lvm会尝试停用它?

请注意,这最初发生在一个完全不同的卷上,所以我从备份中删除了它.现在它已转移到这一个.

rsnapshot日志也不是很有启发性:

[16/Jul/2013:17:26:26] /sbin/lvcreate --snapshot --size 512M --name rsnapshot /dev/raid5/dl
[16/Jul/2013:17:26:29] /bin/mount /dev/raid5/rsnapshot /mnt/lvm-snapshot
[16/Jul/2013:17:26:32] chdir(/mnt/lvm-snapshot)
[16/Jul/2013:17:26:32] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded . /backup/rsnapshot/hourly.0/dl/
[16/Jul/2013:17:27:57] rsync succeeded
[16/Jul/2013:17:27:57] chdir(/root)
[16/Jul/2013:17:27:57] /bin/umount /mnt/lvm-snapshot
[16/Jul/2013:17:27:58] /home/share/scripts/rsnapshot_lvremove --force /dev/raid5/rsnapshot
[16/Jul/2013:17:29:02] /usr/bin/rsnapshot hourly: ERROR: Removal of LVM snapshot Failed: 1280
[16/Jul/2013:17:29:02] rm -f /var/run/rsnapshot.pid

有任何想法吗?

更新 – 这刚刚开始在一个完全不同的服务器上发生.相同的LVM问题.

我尝试过的一件事是将lvremove命令重定向到脚本:

#!/bin/bash
sync
sleep 600
ls /dev/mapper/raid5-*-real
for i in /dev/mapper/raid5-*-real; do /sbin/dmsetup remove $i ; done
/sbin/lvremove --debug "$@"

所以这个同步,睡了一会儿,然后在尝试lvremove之前删除任何-real设备映射.

即便在所有这些之后,删除通常也会失败.这是rsnapshot的输出.请忽略错误的一部分,虽然其中一个卷上存在问题,但直到稍后lvremove失败:

remote cp -al /share/HDA_DATA/backup/rsnapshot/hourly.0 /share/HDA_DATA/backup/rsnapshot/hourly.1 p1=-al p2=/backup/rsnapshot/hourly.0
  One or more specified logical volume(s) not found.
/dev/mapper/raid5-crypt-real
/dev/mapper/raid5-db-real
device-mapper: remove ioctl on raid5-crypt-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db-real Failed: Device or resource busy
Command Failed
  Logical volume "rsnapshot" successfully removed
  One or more specified logical volume(s) not found.
/dev/mapper/raid5-crypt-real
/dev/mapper/raid5-db-real
/dev/mapper/raid5-db--var-real
device-mapper: remove ioctl on raid5-crypt-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db--var-real Failed: Device or resource busy
Command Failed
  Logical volume "rsnapshot" successfully removed
  One or more specified logical volume(s) not found.
/dev/mapper/raid5-crypt-real
/dev/mapper/raid5-db-real
/dev/mapper/raid5-db--var-real
device-mapper: remove ioctl on raid5-crypt-real Failed: Device or resource busy
Command Failed
device-mapper: remove ioctl on raid5-db-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db--var-real Failed: No such device or address
Command Failed
  /dev/raid5/rsnapshot: read Failed after 0 of 4096 at 42949607424: Input/output error
  /dev/raid5/rsnapshot: read Failed after 0 of 4096 at 42949664768: Input/output error
  /dev/raid5/rsnapshot: read Failed after 0 of 4096 at 0: Input/output error
  /dev/raid5/rsnapshot: read Failed after 0 of 4096 at 4096: Input/output error
  Logical volume "rsnapshot" successfully removed
  One or more specified logical volume(s) not found.
/dev/mapper/raid5-crypt-real
/dev/mapper/raid5-db-real
/dev/mapper/raid5-db--var-real
/dev/mapper/raid5-dl-real
device-mapper: remove ioctl on raid5-crypt-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-db--var-real Failed: No such device or address
Command Failed
device-mapper: remove ioctl on raid5-dl-real Failed: Device or resource busy
Command Failed
  Unable to deactivate open raid5-dl-real (254:25)
  Failed to resume dl.
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot hourly 
----------------------------------------------------------------------------
ERROR: Removal of LVM snapshot Failed: 1280

解决方法

在这可以帮助任何人的情况下,我遇到了 Debian bug id 659762 report中描述的问题.

我使用dmsetup信息确定了处于挂起状态的卷,并使用dmsetup resume重新激活它这解锁了LVM系统.

原文链接:https://www.f2er.com/linux/400575.html

猜你在找的Linux相关文章