1

I'm working on a Raspberry Pi B+ with Raspbian Jessie. As far as I can tell, the drive is mounted read/write, but there's some kind of problem with where my Samba share is pointing to the mount point or folder on it, because when I try to access the share from a Windows 7 Pro 64 bit machine, I can't see the contents of the share. I can see the shares, and I can try to authenticate, but I'm not sure if authentication is working.

I remember having problems doing this on Raspbian Wheezy, and I think ultimately I had to use UUIDs in the fstab file and set some permissions there or something. Since I needed to do a whole bunch of work to this pi for other reasons, I upgraded to Jessie. I can't find postings or questions where I asked about this before, so it must have been via chat or in person.

I'm more of a Windows user and have very little experience with Linux. Most of it is aggravating people here on Stack Exchange where I am trying to follow instructions I found elsewhere.

The Samba log file for the machine I'm trying to connect from says:

  STATUS=daemon 'smbd' finished starting up and ready to serve connectionsprocess_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. Permission denied
[2016/02/08 18:56:49.771190,  0] ../source3/param/loadparm.c:4366(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. No such file or directory
[2016/02/08 18:56:49.775938,  0] ../source3/param/loadparm.c:4366(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. No such file or directory
[2016/02/08 18:56:50.769876,  0] ../source3/param/loadparm.c:4366(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. Permission denied
[2016/02/08 18:56:50.774827,  0] ../source3/param/loadparm.c:4366(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. No such file or directory
[2016/02/08 18:56:50.782438,  0] ../source3/param/loadparm.c:4366(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/rootshar failed. No such file or directory

You'll note the timestamps are hours old. I have no newer entries in that log file.

fstab file:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/sda1       /media/5TBDrive auto    noatime           0       0

# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

$ sudo mount

/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=218244k,nr_inodes=54561,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda1 on /media/5TBDrive type fuseblk (rw,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=44504k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

$ lsusb

Bus 001 Device 004: ID 04f2:0963 Chicony Electronics Co., Ltd
Bus 001 Device 005: ID 0bc2:3312 Seagate RSS LLC
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

smb.conf

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S
[RootShare]
   comment = Root Share
   path = /media/5TBDrive
   #valid users = @users
   #force group = users
   #create mask = 0660
   #directory mask = 0771
   read only = no
0

I did not know there was a way to test the samba configuration. There is, and it's included with Raspbian Jessie. It's called testparm, and part of samba-tool.

samba-tool testparm

Running this told me that I had an invalid configuration, and that the hostname I was using was invalid. In my case it was 1 character too long. Overriding the name with netbios name = completely fixed the system. I suspect that the samba server could not work properly with the wrong name.

Prior to fixing the name, I has escalated logging levels by adding log level = 3 and from what I could tell, it looked like all users were being ignored or interpreted as a guest user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.