Common samba share problems
1. Samba access denied (Error 12)
2. Samba mount error 6 no such a device or address
3. Cannot create folder/file into samba share
4. Cannot un mount samba share (the device or resource is busy)
Sample samba share
2. Samba mount error 6 no such a device or address
3. Cannot create folder/file into samba share
4. Cannot un mount samba share (the device or resource is busy)
Sample samba share
[share]
path=/test/samba/food [this path must be present and valid]
writeable = yes
browseable = yes
guest ok = no [disables guest access]
public = yes
available = yes
printable = no
write list = myuser [the user has permissions to mount samba share]
1. Samba access denied (Add samba user with smbpasswd)
Samba access denied because, you are trying to mount samba share with unknown user or the user don’t have permission to mount samba share.
For example,
#mount.cifs //192.168.1.152/share /mnt/share –o user=myuser,pass=mypassword
#mount.cifs //192.168.1.152/share /mnt/share –o user=myuser,pass=mypassword
The user name myuser has to have permission to mount //192.168.1.152/share
To add user myuser to samba database, run following command,
#smbpasswd –a myuser (The user myuser must be in /etc/passwd file or this command fails)
You have to enter password for myuser, that password will be used to mount samba share.
More options with smbpasswd,
If you want to remove any user from samba database,
#smbpasswd –x username
#smbpasswd –d username – disables username in local samba configuration database
#smbpasswd -e username – enables user.
#smbpasswd -a username (Adds user to samba user database – user must present)
#smbpasswd username – same like above one
2. Samba mount error code 6 – no such a device or address.
When mounting samba share, the error comes out saying
#mount.cifs //192.168.1.152/share /mnt/share –o user=myuser,pass=mypassword
retrying with upper case share name
mount error 6 = No such device or address
mount error 6 = No such device or address
Refer to the mount.cifs manual page (e.g.man mount.cifs)
The error because, either share name is misspelled or remote share name doesn’t exist or samba share path is not valid.
Make sure to double check samba share path and share name, also check local mount path is exist.
Run, #testparam /etc/samba/smb.conf to ensure that no error at server side.
3. Cannot create folder/file into samba share
Make sure samba user has right permissions to samba share, ex if you mounted samba share as user myuser, but samba shared folder in server has different user permissions.
In above samba share the user myuser has permissions to mount share in remote clients.
On the server, if you list content of samba share, it displays only root user has full access to folder /test/samba/food. User myuser doesn’t have any permission to access this directory
#ls –lh /test/samba/
drwxr-xr-x. 27 test test 4.0K Jan 23 14:16 food
So change ugo/rwx permissions to user ‘myuser’
#chown -R myser:muser /test/samba/food and then mount,
#mount.cifs //192.168.1.152/share /mnt/share -o user=myuser,pass=mypass
4. Cannot unmount samba share:
When you try to unmount shares, it will give an error.
umount device or resource is busy
Cannot unmount device or resource
Refer to the mount.cifs manual page (e.g.man mount.cifs)
To force unmount, run the following command
#umount -l /mnt/share
No comments:
Post a Comment