OpenBSD 重启时自动检查文件系统

OpenBSD 重启时自动检查文件系统

我希望我的 openbsd 服务器能够启动,不管怎样,不要因为等待手动 FSCKing 而中断。在 linux 中很容易做到,但在 obsd 中它就是不想“自动”。上次我在 fstab 中将第 6、7 个数字设置为 0 0,希望它能奏效,但没有。

我还有选择:

fsck_y_enable="YES"      # Set to YES to do fsck -y if the initial preen fails.
background_fsck="YES"   # Attempt to run fsck in the background where possible.
background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.

在全局 rc.conf 中似乎没有用(它是一个 freebsd 选项)。

有人知道这个问题的解决办法吗?

谢谢

答案1

我还没有在 fstab 中看到任何类似“nofail”的引用,我希望看到。fstab 中任何文件系统的提及都会导致我的启动延迟,因此在我家的组合路由器和文件共享盒中我这样做了:

我在 fstab 中没有提及我的大量 A/V 共享,因此启动会很快,并且只查看恢复互联网连接所需的微小根和网络服务。然后,在 /etc/rc.local 中:(它运行良好,我已经多年没有碰过它了。)

echo -n " /avrepo" ;
sd0=$(/usr/sbin/sysctl hw.disknames | /usr/bin/grep -c sd0) ;
if [ "$sd0" -ge 1 ] && [ $(mount | grep -c /avrepo) -le 0 ] ; then 
   mount /dev/sd0i /avrepo ;
   if [ $? -ge 1 ] ; then 
      sleep 30 ; # assume boot and let system settle first before fsck
      fsck -y /dev/sd0i ; 
      sleep 1 ;
      mount /dev/sd0i /avrepo ;
   fi ;
   sleep 1 ;
fi ;

然后我从 rc.local 启动了 samba 和 ftp 等服务以确保事件的正确顺序。

相关内容