我有一个基于文件的挂载,用于 nginx 缓存目录,这样数十万个小文件就不会弄乱主文件系统。
它的 fstab 行如下:
/data/project/cache.img /data/project/cache ext4 discard,defaults,nofail 0 2
我的问题是它无法在系统重新启动时干净地卸载。如果我手动停止nginx服务并手动卸载它,那么就没有问题,但它会自动生成以下journalctl日志:
May 17 01:09:44 hn systemd-fstab-generator[334]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:09:44 hn systemd[1]: Mounting /data/project/cache...
May 17 01:09:44 hn systemd[1]: Mounted /data/project/cache.
--- reboot issued ---
May 17 01:21:25 hn systemd-fstab-generator[14467]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:21:30 hn systemd-fstab-generator[14758]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:21:31 hn systemd-fstab-generator[14783]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:21:33 hn systemd-fstab-generator[15701]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:21:33 hn systemd-fstab-generator[15724]: Checking was requested for "/data/project/cache.img", but it is not a device.
May 17 01:22:46 hn systemd[1]: Unmounting /data/project/cache...
May 17 01:22:46 hn umount[18509]: umount: /data/project/cache: target is busy.
May 17 01:22:46 hn systemd[1]: data-project-cache.mount: Mount process exited, code=exited status=32
May 17 01:22:46 hn systemd[1]: Failed unmounting /data/project/cache.
乌班图18.04
答案1
2
看起来与相应条目末尾的内容相关/etc/fstab
。将其更改2
为 a0
可能会解决问题,但代价是不再fsck
使用您的文件系统。