ISSUE:
[root@yangyangtest ~]# virsh -c lxc:/// start lxc
error: Failed to start domain lxc
error: internal error: guest failed to start: internal error: Unable to find a free loop device in /dev
表示loop Device以已经用完。最简单有效的方法是释放一些被占用的loop device,可以用如下命令:
losetup -d /dev/loop7
(当然这里的loop7根据自己的情况来选择释放哪个loop device)
ll /dev/loop* #查看有哪些loop deive
losetup -a #show status of all loop devices
losetup /dev/loop0 #如果该设备loop已被使用,则会得到如下的提示
/dev/loop0: [0801]:266646 (/share/xvs/var/tmp-img_VTD_ASS_04_131), offset 16384
losetup /dev/loop6 #如果该设备loop未被使用,则会得到如下的提示
loop: can’t get info on device /dev/loop6: No such device or address
losetup -d /dev/loop7 #detach the file or device associated with the specified loop device(s)
It
is possible to increase the number of available loop devices. Free all
loop devices, and add a line with the following to
/etc/modprobe.conf(有的系统中是:/etc/modprobe.d/modprobe.conf):
options loop max_loop=64
或者直接运行命令(重启后将失效):
rmmod loop; modprobe loop max_loop=64
或者再grub中添加:
max_loop=64 #在kernel的启动行
和loop device相关的重要源代码文件为loop.c,里面有关于max_loop等的具体设置和实现:
drivers/block/loop.c
阅读(4102) | 评论(0) | 转发(0) |