User avatar
RDK
Posts: 262
Joined: Wed Aug 13, 2014 10:19 am
Location: Wyoming and France

SAMBA: Win7 sees shares and files, but can't add, create or

Thu Aug 28, 2014 7:01 am

Folks....I'm having a problem with SAMBA. My Raspberry Pi has Raspdian as the OS (recommended). I have a home network with several Windows 7 PC all networked (and happy).

I have installed SAMBA on my Pi and it is working, kind of!!!! ;) That is, my Windows 7 PC's see the share and also the files in the same. They can be copied to the PC and opened without issues. HOWEVER, I can not create, add or delete files from the share. Below is the

Code: Select all

sudo testparm -s
and several

Code: Select all

ls -l /mnt/usbdrive
relating to the shared Pi folder and files.

Before I display the above output, I need to add that the users (all Windows 7 users are also Pi users with the same password) and all are also SAMBA users. Now the interesting part, the home directory for each user is also shared and shows up on Windows and it WILL (note emphasis) allow added, created, and deleted files.
  • xxx@yyyRasPi ~ $ sudo testparm -s
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[homes]"
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[usb]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
    workgroup = 1234567890
    server string = %h server
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    idmap config * : backend = tdb

    [homes]
    comment = Home Directories
    valid users = %S
    read only = No
    create mask = 0775
    directory mask = 0775
    browseable = No

    [printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    print ok = Yes
    browseable = No

    [print$]
    comment = Samba server's CD-ROM
    path = /cdrom
    guest ok = Yes
    locking = No
    preexec = /bin/mount /cdrom
    postexec = /bin/umount /cdrom

    [usb]
    comment = USB Share
    path = /mnt/usbdrive
    read only = No
    create mask = 0777
    directory mask = 0777
    guest only = Yes
    guest ok = Yes

    xxx@yyyRasPi ~ $ ls -l /mnt/
    total 8
    drwxr-xr-x 2 root root 8192 Jan 1 1970 usbdrive

    xxx@yyyRasPi ~ $ ls -l /mnt/usbdrive
    total 24
    -rwxr-xr-x 1 root root 175 Aug 27 17:35 hosts
    -rwxr-xr-x 1 root root 12340 Aug 27 07:55 usbdrive
So what am I doing wrong with my "USBDRIVE" share? I have run

Code: Select all

sudo chmod 0777 /mnt/usbdrive
and it seems to have not effect.

Thanks...RDK

User avatar
thagrol
Posts: 1983
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: SAMBA: Win7 sees shares and files, but can't add, create

Thu Aug 28, 2014 4:54 pm

Is your USB drive formatted as one of the FAT varients (e.g. FAT32)?

If so check what mount options you're using, especially umask, dmask, fmask, and maybe uid. Also check that the partition is being mounted rw and not ro (applies even if not FAT).

The "mount" command will lst all current mounted drive along with their mount options.
Attempts to contact me outside of thes forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

User avatar
RDK
Posts: 262
Joined: Wed Aug 13, 2014 10:19 am
Location: Wyoming and France

Re: SAMBA: Win7 sees shares and files, but can't add, create

Fri Aug 29, 2014 1:14 pm

thagrol....Thanks for the info. I solved the issue, but I guess you would say I cheated. I installed SWAT, the SAMBA web configuration utility. Logged in as root and specified the existing SAMBA userid's as "Valid users" and "voila" now everything is working.

Regarding your suggestions, the USB key was formatted as FAT32 and is 16GB.

I looked at the Mount listing and it showed
  • /dev/sda1 on /mnt/usbdrive type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
I'm not sure what all of that means - but I'm reading....

Permissions on my /mnt folder and related files are unchanged:
  • drwxr-xr-x 2 root root 8192 Jan 1 1970 usbdrive
SWAT seems to have added these two lines to smb.conf
  • valid users = userA, userB, pi
    admin users = userA, pi, root
Thanks again....RDK

Return to “Beginners”