Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4650

Raspberry Pi OS • Samba problem with mounted directory

$
0
0
(This is loosely related to my other post about the sleeping hard drive)

I've discovered an interesting problem with Samba. The context is that the drive-that-won't-sleep is being shared by Samba to make it available to Windows users. I've used samba lots over the years, so I'm familiar with the drill and its quirks.

But here's the thing. Unless I do things in exactly the right order (see below) Samba doesn't export the mounted contents of the directory (i.e., the external drive) - it exports the raw directory. Like this:

On Linux:
# mkdir /mnt/foobar
# touch /mnt/foobar/AFile
# mount /dev/sdb1 /mnt/foobar
# ls -lsa /mnt/foobar
(Shows the ccontents of the external drive)

On Windows:

C:> net use Z: \\server\thing /u:user password
C:> dir Z:
(Shows AFile and the "bytes free"is reflective of the rootfs of the Linux machine, not of the external drive)

This is really strange!!!

To get it to work correctly, you have to do:

# service smbd stop && service nmbd stop
# mount /dev/sdb1 /mnt/foobar
# service smbd start && service nmbd start

Then the Windows machine will see the files on the external drive.

There must be a fix (in the Samba config) for this - but I couldn't find it. Is there?

And note, BTW, that "restart" doesn't work. it has to be stop, then start.

Also, last question: Isn't there a way to do this restarting with systemctl? Google search found the above "service" commands, which I assume are equivalent to using systemctl, but I'd like to know how to do it in systemctl.

Statistics: Posted by BigRedMailbox — Mon Dec 16, 2024 1:17 pm — Replies 1 — Views 17



Viewing all articles
Browse latest Browse all 4650

Trending Articles