我在 Debian Wheezy 服务器上使用 rsnapshot。这是最近从挤压升级的。升级后,我从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
Run Code Online (Sandbox Code Playgroud)
两个 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
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
更新- 这刚刚开始发生在一个完全不同的服务器上。同样的 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 "$@"
Run Code Online (Sandbox Code Playgroud)
所以这会同步,休眠一段时间,然后-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
Run Code Online (Sandbox Code Playgroud)
如果这可以帮助任何人,我遇到了Debian bug id 659762 报告中描述的问题。
我识别出处于挂起状态的卷并使用dmsetup info
它重新激活它,dmsetup resume
这解锁了 LVM 系统。