LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-20-2012, 03:02 PM   #1
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,565

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
autofs with cifs device, having issues.


running:
# cat /etc/issue
CentOS-5.4 x86 (ks-3.03)
Kernel \r on an \m
Not Fedora

i have installed autofs, samba-client, samba-common (well updated them at least)

here is my /etc/auto.master:

Code:
[root@rx30 ~]# cat /etc/auto.master
#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc   /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
/net    -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

/mnt/MYBOOK     /etc/auto.MYBOOK
and the /etc/auto.MYBOOK:

Code:
[root@rx30 ~]# cat /etc/auto.MYBOOK
winbox  -fstype=cifs,rw,noperm,password=XXXXX   ://192.168.1.207/Public
i have started with
Code:
 winbox  -fstype=cifs,rw,noperm,user=XXXX,pass=XXXX  ://192.168.1.207/Public
both still produce the same error in dmesg:

Code:
 CIFS VFS: cifs_mount failed w/return code = -6
 CIFS VFS: cifs_mount failed w/return code = -6
 CIFS VFS: cifs_mount failed w/return code = -6
 CIFS VFS: cifs_mount failed w/return code = -6
 CIFS VFS: cifs_mount failed w/return code = -6
 CIFS VFS: cifs_mount failed w/return code = -6
CIFS: Unknown mount option rx30
CIFS: Unknown mount option rx30
CIFS: Unknown mount option admin
CIFS: Unknown mount option admin
CIFS: Unknown mount option admin
CIFS: Unknown mount option admin
the google searching i have done indicated to try adding the workgroup:

so i changed the user=workgroup/XXXX that did not help either.

i can mount the device manually with the following:

Code:
mount -t cifs -o XXXXX,XXXXX //192.168.1.207/Public /mnt/MYBOOK/
when I do that i can read it as root, but not access it as user. I am trying to mount it so user can get to it when ever and how ever they want. most likely just a desktop icon ill create that points to the mount point.

http://wiki.centos.org/TipsAndTricks/WindowsShares

this is what i have been following to set things up:

Quote:
Once mounted through /etc/fstab the remote share remains mounted unless you umount it. This might cause problems if the remote share becomes unavailable, resulting in stale mounts. For example, the Windows machine you are connecting to might crash (surprise!) or the network might go down.

Automount comes in handy (if you don't already have autofs, install it by yum install autofs). Here is what you need to do. First create a mount point


mkdir /mymount
[Note: You can use any directory; make sure that directory exists]

To the /etc/auto.master file add a line like:


/mymount /etc/auto.mymount
Then edit the /etc/auto.mymount file you just entered:


winbox -fstype=cifs,rw,noperm,user=sushi,pass=yummy ://winbox/getme
Or by using the same credentials file as above:


winbox -fstype=cifs,rw,noperm,credentials=/root/secret.txt ://winbox/getme
Note that /etc/auto.mymount can be made world-unreadable, so, use of the credentials file is not as important as in the previous method.

[More note: If you cannot connect by the machine name but can connect by its IP address, then add wins on the hosts line of /etc/nsswitch.conf .]

When all is ready, run /sbin/service autofs restart as root.

Now try accessing the share by ls /mymount/winbox or by cd /mymount/winbox . It is dynamically loaded upon access. After some inactivity (default 60 seconds), the share will be unmounted.

[Note: Upon automounting, you may see an error mount_cifs.so: cannot open shared object file in /var/log/messages. This is harmless and can be safely ignored.]
but as you can see im stuck.
 
Old 08-20-2012, 03:22 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,565

Original Poster
Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
bit more info:

Code:
[root@rx30 ~]# service autofs restart
Stopping automount:                                        [  OK  ]
Starting automount:                                        [  OK  ]
[root@rx30 ~]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@rx30 ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda3     ext3     64G  4.1G   57G   7% /
/dev/sda2     ext3     64G  6.1G   55G  11% /usr/rx30
/dev/sda1     ext3     99M   17M   77M  18% /boot
tmpfs        tmpfs    2.0G     0  2.0G   0% /dev/shm
[root@rx30 ~]# chmod -R 4777 /mnt/MYBOOK/
[root@rx30 ~]# exit
[104890_rx30@rx30 ~]$ ls -laF /mnt/MYBOOK/
total 8
drwsrwxrwx 2 root root    0 Aug 20 15:02 ./
drwxr-xr-x 7 root root 4096 Aug 20 10:30 ../
[104890_rx30@rx30 ~]$ mount /mnt/MYBOOK/
mount: according to mtab, //192.168.1.207/IPC$ is already mounted on /mnt/MYBOOK
mount failed
[104890_rx30@rx30 ~]$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda3     ext3     64G  4.1G   57G   7% /
/dev/sda2     ext3     64G  6.1G   55G  11% /usr/rx30
/dev/sda1     ext3     99M   17M   77M  18% /boot
tmpfs        tmpfs    2.0G     0  2.0G   0% /dev/shm
 
Old 08-20-2012, 04:02 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,565

Original Poster
Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
made the following changes:

/etc/auto.master:
Code:
/mnt/MYBOOK     /etc/auto.MYBOOK        --timeout=600   --ghost
/etc/auto.MYBOOK:
Code:
winbox  -fstype=cifs,rw,noperm,username=XXXX,password=XXXX    ://192.168.1.207/DME
restarted autofs again, and poof everything is working.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
autofs with cifs filesystem creating mountpoint twice? kayasaman Linux - Server 2 03-25-2012 10:35 AM
Using Autofs to mount CIFS share and busy files? wernox Linux - Server 5 04-30-2010 05:39 AM
[SOLVED] autofs, fstab and manual cifs mounts fail if using credentials file carltm Red Hat 1 12-02-2009 07:39 AM
cifs + autofs failed to lookup (program) UltraSoul Linux - Software 0 06-22-2008 10:53 AM
autofs issues, need new version but cant update xcoldfyrex Linux - Server 1 03-24-2007 01:06 PM


All times are GMT -5. The time now is 01:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration