I have a USB drive shared from a Raspberry Pi via Samba.
Everything works fine, but when I disconnect the USB drive, the mounting folder (/media/usb1
) still exists and its still being shared through Samba as an empty folder.
What I would have expected is Samba to stop sharing that resource, and appear as disconnected or unavailable in Windows, as its mapped as a network drive.
Is there a way to tell Samba to stop sharing the resource if it's empty? Is there any other workaround?
My smb.conf
entry for this shared resource is the following:
[usbdrive]
path = /media/usb1
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = no
umount
, it no longer exists. How is samba supposed to know that it was for a removable device? The folder is still there and still accessible. Unix's stupidity is also it's strength. Most things aren't overthought or over programmed. It the organization of things by the user that make it powerful.