安装外部 USB 硬盘并通过 samba 共享

安装外部 USB 硬盘并通过 samba 共享

我有一个外部 USB 硬盘。我想这样做:从启动时自动挂载它并通过 samba 共享它。

1)我把它放在fstab中,它在启动时正确自动安装,没有问题:

UUID=XXX /usb-hdd ext4 defaults,nofail 0 0

2)挂载后通过samba共享/usb-hdd。没问题。

[usb-hdd]
comment = raid5-usb
path = /usb-hdd
read only = No
valid users = michaelm

3)但是,如果机器重新启动,samba共享就会失败。可以很容易地解决

systemctl restart smbd 

4)供您参考,“systemctl status smbd”在启动时返回以下消息:

May 06 14:44:37 storage systemd[1]: Starting Samba SMB Daemon...
May 06 14:44:38 storage systemd[1]: smbd.service: Supervising process 1172 which is not our child. We'll
May 06 14:46:07 storage systemd[1]: smbd.service: Start operation timed out. Terminating.
May 06 14:47:38 storage systemd[1]: smbd.service: State 'stop-final-sigterm' timed out. Killing.
May 06 14:47:38 storage systemd[1]: smbd.service: Killing process 1172 (smbd) with signal SIGKILL.
May 06 14:47:38 storage systemd[1]: Failed to start Samba SMB Daemon.
May 06 14:47:38 storage systemd[1]: smbd.service: Unit entered failed state.
May 06 14:47:38 storage systemd[1]: smbd.service: Failed with result 'timeout'.

我的猜测是,启动时,smbd 服务在安装 /usb-hdd 之前启动。如何纠正呢?

相关内容