Operating System - HP-UX
1748142 Members
3605 Online
108758 Solutions
New Discussion юеВ

fstab entry for mounting shares with cifs

 
SOLVED
Go to solution
Mark Vollmers
Esteemed Contributor

fstab entry for mounting shares with cifs

I have the cifs client installed, and it all works fine for mounting shares from NT to unix. I have no problems using the command:

mount -F cifs -o username=,password=

However, I want to automate it so that I don't have to type it all in at reboot or with an unmount. the stupid manual says that I can put it in /etc/fstab, but doesn't say how I am suppose to include the login info (user name and passwd). Useless piece of... Anyway, I tried to put them after the type:

cifs username=,password= 0 0

but it didn't work. Has anyone done this? I could write a script with the individual mount commands, but I'd prefer not to. Thanks!

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
6 REPLIES 6
Eric Ladner
Trusted Contributor

Re: fstab entry for mounting shares with cifs

mount the file system like you described, then execute

/usr/sbin/mount -p

This will show the current mounts in fstab format. Grab the line you're interested in and paste it into your /etc/fstab at the bottom.
Mark Vollmers
Esteemed Contributor

Re: fstab entry for mounting shares with cifs

Eric-

I went ahead and tried that. I got a bunch of errors about "illegal file system specific option" and all the options, like soft, noac, retrans=3, etc. There was no login info or password in the command. If I just use the folders and no options ( cifs defaults 0 0), it will mount,but when I do a bdf, I get "NFS access failed for server engpro5: RPC: remote system error", so I still think that I have to communicate the login info somewhere.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Jeff Schussele
Honored Contributor

Re: fstab entry for mounting shares with cifs

That's pretty cool Eric.
Love it when I learn something new here (that I probably should've known).

I have struggled with fstab syntax.

I don't have cifs to check - does the mount -p handle the username/pw info as well & are these values stored in clear text?
Not sure I would want that.......

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mark Vollmers
Esteemed Contributor

Re: fstab entry for mounting shares with cifs

Jeff-

No, it doesn't seem to be passing that information. It might be becuase I am specifying it in the command; I don't know. I'm not really concerned about the login and password being out there for viewing. It is a dummy account that we made on both sides so that there would be something that could be used for all of our NT stations without having to use the actual user name and password (which I wouldn't want everyone to see).

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
melvyn burnard
Honored Contributor
Solution

Re: fstab entry for mounting shares with cifs

there are a few additional steps to perform to enable this, so here is an outline:

1.add an entry in your /etc/fstab file like the following example:

# grep cifssrv /etc/fstab
cifssrv:/dirname /tmp/cifs cifs defaults 0 0
!! NOTE: The cifssrv hostname MUST be a WINS name!!

2. mount the drive using:
# mount -a
or
# mount -F cifs cifssrv:/desktop /tmp/cifs

3. do a cifslogin for the user with the '-s' option to save the password in a user database (/var/opt/cifsclient/cifsclient.udb by
default) :

# cifslogin cifssrv myname -P password -s
NOTE: man on cifssrv for specifics on options

4. Check to make sure the password db was created :

# ll /var/opt/cifsclient/cifsclient.udb
-rw------- 1 root sys 191 Jul 26 21:14 cifsclient.udb
!!NOTE: This file will get deleted if you upgrade cifsclient or patch cifs9000!!

5. Make sure that cifs share is mounted

# bdf -tcifs
localhost:\\CIFSSRV\DIRNAME 6289888 3650064 2639824 58% /tmp/cifs

6. reboot the system to test th emount does occur at boot time


HTH
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Mark Vollmers
Esteemed Contributor

Re: fstab entry for mounting shares with cifs

Thanks, Melvyn! that did the job!

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"