Article 6FWRN How to share via NFS removable disks (without restarting NFS server service)

How to share via NFS removable disks (without restarting NFS server service)

by
alexago
from LinuxQuestions.org on (#6FWRN)
Hi,

recently I bought a DAS module to connect 5 SATA HDs via USB to Debian 12 server): each HD has its own power supply and normally I only turn on the disks I need.

My first problem was how to auto mount these HDs: I solved this using systemd automount in /etc/fstab, like this one

UUID=xxxx/mnt/disk1ext4nofail,lazytime,x-systemd.automount,x-systemd.device-timeout=1000
UUID=yyyyy/mnt/disk2ext4nofail,lazytime,x-systemd.automount,x-systemd.device-timeout=1000

and works very well (this means each disk is auto mounted as soon as it is turned on).

Now I would like to share these HDs via NFS: so in /etc/exports I have

/mnt/disk1 *(rw,insecure)
/mnt/disk2 *(rw,insecure)

but when NFS service starts (at the boot) I got this error:

exportfs[1157]: exportfs: /mnt/disk1 does not support NFS export
exportfs[1157]: exportfs: Failed to stat /mnt/disk1: No such device
exportfs[1157]: exportfs: /mnt/disk2 does not support NFS export
systemd[1]: nfs-server.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: nfs-server.service: Failed with result 'exit-code'.
systemd[1]: Stopped NFS server and services.

Obviously if I restart NFS server after turning on my HDs, all works perfectly.

So my question is: is possible to auto share each single HD every time I turn on an HD without restarting NFS service (like auto mount service)?

Thanks in advance
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments