我需要/etc/fstab在另外两行之后安装一个特定的行:
# Always mount these first
UUID=fdf38dd4-9e9d-479d-b830-2a6989958503 / ext4 noatime,discard,errors=remount-ro 0 1
UUID=2b548eb8-fa67-46ce-a998-91d587dba62f /home/.hdd ext4 errors=remount-ro 0 2
# Always mount this second
none /home/ak aufs br:/home/.ssd/ak=rw:/home/.hdd/ak=rw 0 0
Run Code Online (Sandbox Code Playgroud)
当前的行为是经常以不可预测的方式颠倒最后两行的顺序。如何指定必要的顺序?
小智 9
Systemd 现在包含一个强制执行挂载顺序的依赖项选项。在您的情况下,添加 fstab 参数:
x-systemd.requires-mounts-for=/,x-systemd.requires-mounts-for=/home/.hdd
Run Code Online (Sandbox Code Playgroud)
如果您需要在其他已挂载的文件系统上挂载,则 noauto 选项将不起作用。在我的情况下,上述工作参见提交https://github.com/systemd/systemd/commit/3519d230c8bafe834b2dac26ace49fcfba139823了解更多详细信息。