count_wakula
Posts: 8
Joined: Sat Mar 31, 2018 7:27 pm

SAMBA refuses to work

Sat Mar 31, 2018 7:53 pm

Good afternoon,

I am trying to setup a home NAS system with the raspberry pi.

I got a 3B+ starter kit and a 256 GB USB drive for storage.

Installed the latest version of Raspbian Lite. SSH works fine and connectivity works.

I installed the exfat fuse driver and set the "mount point" to /mnt/PIHDD/.

Below is the output of the "sudo -l /mnt/" command:

drwxrwxrwx 1 root root 131072 Jan 1 1970 PIHDD

From what I understand this means that "PIHDD" has read/write access enabled.

I also added an entry to the fstab file to enable automounting for "PIHDD."

Next I installed samba via the following command:

sudo apt-get install samba samba-common-bin

After that I added the following data to the "/etc/samba/smb.conf" file (at the end of the file):

[share]
comment = PIHDD
path = /mnt/PIHDD/
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = yes
guest ok = yes

I didn't make any other changes to the smb.conf file.

After that I added a samba user via the following command:

sudo smbpasswd -a pi

And restarted samba: sudo /etc/init.d/samba restart. Restart seemed to have worked.

However, when I run the "sudo smbstatus --shares" command I get nothing. Windows 10 also doesn't see the share.

What am I doing wrong and how to I troubleshoot this issue?

I don't believe it's an issue with my router setup (I made the router assigns the pi with a fixed IP).

I have a feeling that it will impossible to get samba running, it doesn't really strike me as a solution designed for "outcome enablement". Are there any alternatives to messing with samba? I tried installing OMV on raspbian lite, I was able to access the webUI, but the solution was extremely unstable and for some reason it kills SSH access (wasn't able to fix it and I am not wasting any more time troubleshooting this issue). The raspberry pi install image for OMV won't load at all.

Thanks.

hortimech
Posts: 443
Joined: Wed Apr 08, 2015 5:52 pm

Re: SAMBA refuses to work

Sun Apr 01, 2018 7:34 am

It should work, but is Samba actually starting ?

Try these two commands:

ps ax |grep -v 'grep' | grep 'smbd'

ps ax |grep -v 'grep' | grep 'nmbd'

It should produce lines like these:

7366 ? Ss 0:00 /usr/sbin/smbd -D

7304 ? Ss 0:05 /usr/sbin/nmbd -D

If you don't get any output, neither the 'smbd' or 'nmbd' deamons is running, so try starting them separately:

sudo /etc/init.d/smbd start

sudo /etc/init.d/nmbd start

Then check if they are now running using the two commands you used previously.

User avatar
DougieLawson
Posts: 40123
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: SAMBA refuses to work

Sun Apr 01, 2018 9:08 am

Run sudo testparm to syntax check your smb.conf file.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

count_wakula
Posts: 8
Joined: Sat Mar 31, 2018 7:27 pm

Re: SAMBA refuses to work

Sun Apr 01, 2018 4:28 pm

This is what I get running the commands from above:

ps ax |grep -v 'grep' | grep 'smbd'

Code: Select all

  518 ?        Ss     0:00 /usr/sbin/smbd
  519 ?        S      0:00 /usr/sbin/smbd
  520 ?        S      0:00 /usr/sbin/smbd
  523 ?        S      0:00 /usr/sbin/smbd
ps ax |grep -v 'grep' | grep 'nmbd'

Code: Select all

516 ?        Ss     0:00 /usr/sbin/nmbd
I am assuming this means that the smbd and and nmbd services are indeed running.

I tried to run the start commands again

Code: Select all

sudo /etc/init.d/smbd start
but when I run "sudo smbstatus --shares" it still doesn't show any shares.

Code: Select all

Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
This is what I get when running the sudo testparm command:

Code: Select all

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[share]"
Loaded services file OK.
Server role: ROLE_STANDALONE


I couldn't find the "rlimit_max" keyword when doing a F6 search via nano. At any rate, it's not that windows can't see the share, but from what I understand the lack of results for "sudo smbstatus --shares" means that I can't even "see" the share locally?

Do I need to install a samba client on the Pi? Some of the tutorials mentions that you need the samba client too...
Last edited by count_wakula on Sun Apr 01, 2018 4:30 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 40123
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: SAMBA refuses to work

Sun Apr 01, 2018 4:30 pm

So your config is OK, your problem lies elsewhere.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

count_wakula
Posts: 8
Joined: Sat Mar 31, 2018 7:27 pm

Re: SAMBA refuses to work

Sun Apr 01, 2018 4:32 pm

How can I figure out what's wrong? I am not an expert in Linux so I am not even sure where to start or how to get more information.

Are there any other diagnostic commands that I can run to try troubleshoot this issue?

Do I need to change the permissions of the /mnt/PIHDD to allow samba to have access to that folder? From what I understand, right now only root has read/write access to /mnt/PIHDD/, is this normal?

hortimech
Posts: 443
Joined: Wed Apr 08, 2015 5:52 pm

Re: SAMBA refuses to work

Sun Apr 01, 2018 7:24 pm

It looks like everything is working, but you seem to be misunderstanding what 'smbstatus --shares' is for. It doesn't show the shares, it shows who is connected to the share or as Samba calls it the 'Service'.

To see the share, you need to install 'smbclient':

sudo apt-get install smbclient

Then run 'smbclient -L <hostname>

Replace <hostname> with the short hostname of your rpi

You will be asked for a password, just press enter.

It should display info about your Samba server

To connect to share you need to use something like this:

smbclient \\\\<hostname>\\<share> yourpassword

You can find more info about smbclient by running 'man smbclient' on the rpi

Rowland

Return to “Troubleshooting”