我在 Debian Wheezy 服务器上使用 rsnapshot。它最近从 squeeze 升级。升级后,我从hourly
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 卷均已正确备份Logical volume "rsnapshot" successfully removed
,但随后它进入dl
lvm VG 中的卷raid5
并看到无法停用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 "$@"
因此,这会同步,休眠一会儿,然后-real
在尝试 lvremove 之前删除所有设备映射。
即使经过所有这些操作,删除仍然经常失败。以下是 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
答案1
如果这可以帮助任何人,我遇到了如下问题:Debian 错误编号 659762 报告。
我使用 识别了处于暂停状态的卷,dmsetup info
然后使用 重新激活了它,dmsetup resume
从而解锁了 LVM 系统。