[Solved] How to umount USB Samba drive

I set up my USB thumb drive as a Samba share, following the instructions on https://openwrt.org/docs/user-guide/services/samba . Sometimes, however, I may want to make this shared thumb drive inaccessible on the network.

What is the best way to do that?

One option I found was to turn off the power input on the thumb drive through ssh, but this does not seems to be adequate, as it's better to umount first. But, umount does not makes the thumb drive inaccessible on the network, I can still access it as nothing happened. Where is my misconception about the process located at?

If you are only sharing that drive, you can stop the samba service.

1 Like

/etc/init.d/samba stop
/etc/init.d/samba start

This really solved my need. The "smb://" is still accessible, but the shared folders disappear after stopping, and so the status of the USB drive becomes irrelevant.

Thank you!