我在一台即插即用的计算机上运行Debian压缩程序(所以只使用SSH,没有GUI),而我要做的就是获取它,这样当USB卡被插入时,它就会自动挂载。
我所做的是安装autofs,根据我收集的信息,它处理自动计数,前提是它知道设备在/dev中的位置。
问题是USB卡并不总是在同一个设备名上。有时是/dev/sdc1,有时是/dev/sdd1,等等。
我想,为了弥补这个问题,我需要使用udev来确保USB棒总是被赋予相同的名称。
我从udevadm获得了以下信息:
Udevadm info starts with the device specified by the devpath and the
当我们执行此操作时(在linux 7.x上)
umount /grop/sdc
umount: /grop/sdc: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
我们可以看到,坐骑在繁忙的时候失败了。
但当我们做remount的时候..。重装是成功的,如下所示:
mount -o rw,remount /grop/sdc
echo $?
0
太有趣了。
重新挂载是否使用类似( umount -l )
通过挂载,我尝试了一个简单的覆盖示例: sudo挂载-t overlay -o lowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/-o/workdir-o /tmp/overlay。
(我从https://blog.programster.org/overlayfs中的示例运行完整的脚本)
坐骑是成功的:
/tmp/lower-fs.img on /tmp/lower type ext4 (ro)
/tmp/upper-fs.img on /tmp/upper type ext4 (rw)
none on /tmp/overlay typ