RHEL 7 啟動時不會從 /etc/fstab 掛載磁碟機?

RHEL 7 啟動時不會從 /etc/fstab 掛載磁碟機?

我有一台 RHEL 7 伺服器,其中包含以下行/etc/fstab

\\10.0.0.1\backup /mnt/backup cifs user,uid=500,rw,suid,username=admin,password=password 0 0

這與我在其他 CentOS 6 和 RHEL 6 伺服器上使用的完全相同,但在這個 RHEL 7 機器上,我似乎需要mount -a在每次重新啟動後連接並運行?

有什麼方法可以自動解決這個問題嗎?

答案1

使用_netdevautomount 選項可確保掛載在啟動時發生,並且在網路啟動並運行之前不會嘗試掛載。

man mount

_netdev

The filesystem resides on a device that requires network access (used to prevent the
system from attempting to mount these filesystems until the network has been enabled 
on the system).  
  ....

auto

Can be mounted with the -a option.

相關內容