Closed zenglg closed 6 years ago
In the host:
[root@node-1 ~]# parted -s /dev/sdd print > /dev/null; udevadm settle ; for i in `seq 1 100` ; do ls -alh /dev/sdd13 >/dev/null || echo $i: not found sdd13 ; done
[root@node-1 ~]# echo $?
0
In the container:
[root@node-1 /]# parted -s /dev/sdd print > /dev/null; udevadm settle ; for i in `seq 1 100` ; do ls -alh /dev/sdd13 >/dev/null || echo $i: not found sdd13 ; done
ls: cannot access /dev/sdd13: No such file or directory
1: not found sdd13
ls: cannot access /dev/sdd13: No such file or directory
2: not found sdd13
So, I think udevadm settle
maybe not work well in the container.
I use
parted
command to do some tests:Occasionally, the test maybe faild like:
And, through the
udevadm monitor
output:Seems like, the device is lost after being removed by udev(or kernel), and, reappear after being added.
Add
udevadm settle
to make sure all current udev event be handled.Signed-off-by: Linggang Zeng linggang.zeng@easystack.cn