VectorLinux
October 25, 2014, 03:15:15 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [SOLVED] Mapping samba network shares  (Read 9060 times)
themainliner
Member
*
Posts: 8


« on: February 19, 2012, 01:57:37 pm »

This is the first distro I've encounter issues with mapping samba shares. However, most of the distro I've used so far have been Debian eggs. To begin I install the smbfs components:
Code:
sudo apt-get install smbfs
then I can create folders in /mnt
Code:
sudo mkdir /mnt/share
and issue the mount command:
Code:
sudo mount -t cifs //server/share /mnt/share -o username=themainliner,password=password
This is returning following error:
Code:
mount: block device //server/sharename is write-protected, mounting read-only
mount: cannot mount block device //server/sharename read-only

Am I missing some components...what should I have installed? Any ideas what I'm doing wrong?
« Last Edit: February 25, 2012, 08:30:59 am by themainliner » Logged
bigpaws
Vectorian
****
Posts: 1856


« Reply #1 on: February 19, 2012, 02:46:30 pm »

According to the inux filesystem hierarchy, /mnt
is for  temporary use.

If you really want to use /mnt then check your permissions
on that directory. Also did you try testparm after you
installed samba?

Bigpaws
Logged
themainliner
Member
*
Posts: 8


« Reply #2 on: February 19, 2012, 03:08:20 pm »

Really,I did not know that about /mnt - I switched to /media and used the following (a step you reminded me of, thanks Grin ):
Code:
sudo chown themainliner:themainliner /media/share
However, the result was the same:
Code:
mount: block device //server/share is write-protected, mounting read-only
mount: cannot mount block device //server/share read-only

Here is the output of testparm:
Code:
[global]
netbios name = server
server string = Samba file and print server
interfaces = 127.0.0.1/8, 192.168.0.0/24
bind interfaces only = Yes
client schannel = No
server schannel = No
allow trusted domains = No
obey pam restrictions = Yes
guest account = smbguest
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
passwd chat timeout = 120
username map = /etc/samba/smbusers
password level = 6
username level = 6
unix password sync = Yes
log file = /var/log/samba/samba.log
max log size = 1000
name resolve order = wins lmhosts bcast
client signing = No
client use spnego = No
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = cups
machine password timeout = 120
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
delete user script = /usr/sbin/userdel '%u'
add group script = /usr/sbin/groupadd '%g'
delete group script = /usr/sbin/groupdel '%g'
add user to group script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
logon script = %G.bat
logon path = \\%L\profiles\%u
logon drive = m:
logon home = \\%L\homes\%u
os level = 33
local master = No
domain master = No
dns proxy = No
remote announce = 192.168.0.255
remote browse sync = 192.168.0.255
template shell = /dev/null
winbind separator = @
winbind cache time = 360
winbind use default domain = Yes
winbind trusted domains only = Yes
winbind nested groups = No
winbind nss info = no
idmap config * : range = 16777216-33554431
idmap config * : backend = tdb
hosts allow = 127., 192.168.0.
cups options = raw
follow symlinks = No

[homes]
comment = Home Directories
path = /home
valid users = %U
read only = No
locking = No
strict locking = No

[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
locking = No
strict locking = No

[profiles]
comment = User Profiles
path = /var/lib/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
locking = No
strict locking = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
locking = No
strict locking = No

[pdf-documents]
comment = Converted PDF Documents
path = /var/lib/samba/pdf-documents
admin users = %U
read only = No
guest ok = Yes
locking = No
strict locking = No

[pdf-printer]
comment = PDF Printer Service
path = /tmp
guest ok = Yes
printable = Yes
print ok = Yes
printing = bsd
print command = /usr/bin/gadmin-samba-pdf %s %u
lpq command =
use client driver = Yes
Logged
themainliner
Member
*
Posts: 8


« Reply #3 on: February 23, 2012, 10:24:43 am »

Can anyone see anything amiss in my testparm output or suggest a next step?  Huh

Thanks all.
Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #4 on: February 23, 2012, 11:57:15 am »

Is the samba share on a Windows machine? If so, is the box for "allow users to change files" checked?

Is the share on a Linux machine? If so, did you create a samba user, check permissions in smb.conf as well as on the file system?
Logged
themainliner
Member
*
Posts: 8


« Reply #5 on: February 24, 2012, 07:10:20 am »

The samba share is on Fedora box, running Amahi server.

My desktop PC has never had an issue whether accessing the share with Windows7, Linux Mint 11, openSUSE 11.4, Debian 6...neither has the netbook I'm running Vector on when I've used Crunchbang, Puppy or AntiX...so this is clearly a client side issue with my set up of Vector.  Huh
« Last Edit: February 24, 2012, 07:27:06 am by themainliner » Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #6 on: February 24, 2012, 08:26:00 am »

And you are using which version of VL?
Logged
themainliner
Member
*
Posts: 8


« Reply #7 on: February 24, 2012, 08:46:51 am »

6 Cheesy Don't get me wrong I like it, it looks great and runs on mah underpowered netbook. If I can nail this share mapping malarky...  Grin
Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #8 on: February 24, 2012, 10:42:37 am »

I run 6 myself, and use samba shares without problems. Smiley

Make sure that the full samba package is installed, then try to mount the share as root.
Logged
themainliner
Member
*
Posts: 8


« Reply #9 on: February 24, 2012, 12:22:53 pm »

Make sure that the full samba package is installed, then try to mount the share as root.

Thanks for all your help man. I'm trying slapt-get --install samba and (unsurprisingly) get
Code:
Reading Package Lists...Done
samba is up to date.
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.
Is there any other package I need? I tried smbfs and cifs but neither are in the repos...   Cry
Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #10 on: February 24, 2012, 12:54:09 pm »

At least we know that samba is installed. Do you get the same response if you run the mount command as root instead of using sudo?
Logged
themainliner
Member
*
Posts: 8


« Reply #11 on: February 24, 2012, 03:19:13 pm »

Yeah, identical. I do not get it...  Undecided

I ripped out samba and reinstalled...
Code:
mount -t smbfs //server-IP/share /mnt/share -o username=themainliner,password=password
Result:
Code:
/sbin/mount.smbfs: line 115: /sbin/mount.cifs: No such file or directory
Roll Eyes with cifs as above...
« Last Edit: February 24, 2012, 03:48:05 pm by themainliner » Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #12 on: February 24, 2012, 04:28:17 pm »

Your syntax is correct, I just tested it on my VL6 (KDE-Classic) system, with samba 3.5.3.

There is something amiss though. The file /sbin/mount.cifs is part of the samba package and should be present.

You say you removed and re-installed samba? Using slapt-get? You could try to manually download the package: http://vectorlinux.osuosl.org/veclinux-6.0/patches/net/samba-3.5.3-i586-1vl60.tlz and install it using the installpkg command.
Logged
themainliner
Member
*
Posts: 8


« Reply #13 on: February 25, 2012, 03:34:26 am »

Yeah, I used slapt-get and I noticed some anomalous behaviour from mount.cifs. The mount.smbfs file is there and I can open it and scroll to the bottom: line 115 tries to
Code:
exec /sbin/mount.cifs
When I tried to open mount.cifs that appears in the directory listing Leafpad tells me the file doesn't exist. Not put off yet I tried to open the file with vi...but I got the same result and that is off putting.  Shocked

Manual install it is then. (Once again thanks for your persistence).  Grin

Code:
sudo installpkg samba-3.5.3-i586-1vl60.tlz  

.-----.-----------------------------------------------------------------------.
| 1/1 | Installing samba-3.5.3-i586-1vl60.tlz                                 |
'-----'-----------------------------------------------------------------------'
ERROR: Package is corrupt: samba-3.5.3-i586-1vl60.tlz

Deep joy.  Angry  (Downloaded three times so it probably didn't corrupt in transit.)

Went back to the CLI and reinstalled samba.

I'm was starting to lose some faith with the distro now to be honest:
Code:
mount: wrong fs type, bad option, bad superblock on //192.168.1.10/spaceman,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

and dmesg | tail seemed to confirm the worst:

Code:
[29690.972488] fs/cifs/cifsfs.c: Devname: //192.168.1.10/Other flags: 0
[29690.972516] CIFS VFS: No username specified

These errors result after adding shares into /etc/fstab and submitting sudo mount -a at the command line. Here is the line in /etc/fstab:

Code:
//192.168.1.10/share /mnt/share cifs credentials=/root/.smbcredentials,file_mode=0777,dir_mode=0777 0 0

...of course /root/.smbcredentials contains my credentials for the server.

I also tried entering the credentials directly into fstab. Finally I have a drive mapped! Problem is with the credentials file then, as well as using temporary mounts...progress anyway. That will do for me, I have a network share mapped.

Thanks Nightflier...I hope others find this valuable.  Cheesy
« Last Edit: February 25, 2012, 08:25:27 am by themainliner » Logged
nightflier
Administrator
Vectorian
*****
Posts: 4026



« Reply #14 on: February 25, 2012, 08:38:00 am »

Nice job getting it working!  Smiley  I wish I knew why it worked one way and not the other. Good to see that it pays not to give up too easily.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!