ubuntu 16.04 fstab 因 nobootwait 而失败

ubuntu 16.04 fstab 因 nobootwait 而失败

我刚刚全新安装了 Ubuntu 16.04(以替换 14.04),目的是移植大量可用的 fstab 文件,以便挂载其他 JFS 磁盘/分区。但我似乎遇到了麻烦nobootwait

例如,在 14.04 中有效的一个 fstab 条目是:

UUID=<uuid>  /storage jfs defaults,nodiratime,noatime,nofail,nobootwait  0 2

但是在 16.04 中,它既不会在启动时挂载驱动器,也不会按照以下命令挂载:

sudo mount /storage

我已经安装了 jfsutils,并且能够手动挂载分区,即

sudo mount -t jfs /dev/sdX /storage

我发现这个dmesg

[   6.720171] jfs: Unrecognized mount option "nobootwait" or missing value

因此,以此为提示,当我nobootwait从 fstab 中删除选项时,命令

sudo mount /storage 

工作正常。(我不知道启动时的情况,因为我目前通过 ssh 执行此操作,并且不想冒计算机无法启动的风险)。

显然,一种解决方案是放弃该nobootwait选项。但我不想这么做。也许 nobootwait 在 14.04 中从未起作用(我从未遇到过磁盘启动时失败的情况)并且 14.04 只是忽略了错误,但我想要 的所谓功能nobootwait

Ubuntu 16.04 或 Linux 内核有没有什么变化nobootwait

答案1

看起来有 2 个相关选项需要设置来模仿 nobootwait 行为,取自systemd mount 手册页

   nofail
       With nofail, this mount will be only wanted, not required, by
       local-fs.target or remote-fs.target. This means that the boot will
       continue even if this mount point is not mounted successfully.
   x-systemd.device-timeout=
       Configure how long systemd should wait for a device to show up
       before giving up on an entry from /etc/fstab. Specify a time in
       seconds or explicitly append a unit such as "s", "min", "h", "ms".

因此设置选项nofail,x-systemd.device-timeout=1应该让系统等待 1 秒钟以安装设备,然后再继续启动。

答案2

此选项似乎已被删除。Ubuntu手册页如果您选择,则包含fstab此文本14.04 长期支持在顶部:

The  mountall(8)  program  that  mounts  filesystem  during  boot  also
 recognises additional options that the ordinary mount(8) tool does not.
These  are:  ``bootwait''  which  can  be applied to remote filesystems
mounted outside of /usr or /var, without which  mountall(8)  would  not
hold up the boot for these; ``nobootwait'' which can be applied to non-
remote filesystems to explicitly instruct mountall(8) not  to  hold  up
the boot for them; ``optional'' which causes the entry to be ignored if
the filesystem type is not known  at  boot  time;  and  ``showthrough''
which  permits  a mountpoint to be mounted before its parent mountpoint
(this latter should be used carefully, as it can cause boot hangs).

如果您选择16.04在顶部。

答案3

如果你只是在寻找如何nobootwait在 16.04 中复制行为,那么你正在寻找的选项似乎是nofail。从http://manpages.ubuntu.com/manpages/zesty/man5/systemd.mount.5.html

   nofail
       With nofail, this mount will be only wanted, not required, by
       local-fs.target or remote-fs.target. This means that the boot will
       continue even if this mount point is not mounted successfully.

答案4

从 Ubuntu 16.04 开始,默认的 init 系统是 systemd,它取代了 mountall。 http://manpages.ubuntu.com/manpages/zesty/man5/systemd.mount.5.html提供了可能消除 nobootwait 需求的新选项。

相关内容