[SOLVED] Cannot automount NAS share

Issues related to configuring your network
Post Reply
leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

[SOLVED] Cannot automount NAS share

Post by leo8888 » 2015/01/28 21:30:49

Although I wasn't able to get automount working, which was the original purpose of this post, I was able to basically accomplish what I needed by setting up manual mounts that could be done by normal users.


Greetings all!

I have been trying to setup what I thought should be a simple automount to a shared folder on a remote NAS. I can manually mount the share no problem using:

mount -t cifs //192.168.2.250/shs1 /mymount -o username=leo,password=mypassword

I've been trying to set this up as an automount but so far no success. I had already created the mymount folder under the root and added this entry to /etc/auto.master:

/mymount /etc/auto.mymounts --ghost

Then I created the /etc/auto.mymounts file and added this entry:

buffalo -fstype=cifs,rw,noperm,user=leo,pass=mypassword ://192.168.2.250/shs1

Then I restarted the autofs service and verified it was running with:

service autofs restart
service autofs status

The output shows that the service is active (running) but when I do:

cd /mymount/buffalo

I get "No such file or directory". I feel there must be something simple I'm missing but I've been searching the net for hours and trying different things and haven't found anything yet to point me in the right direction.

Thanks in advance for any suggestions!
Last edited by leo8888 on 2015/02/03 20:40:39, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 28865
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot automount NAS share

Post by TrevorH » 2015/01/29 00:11:20

When you did the cd /mymount/buffalo, did you check in /var/log/messages afterwards?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: Cannot automount NAS share

Post by leo8888 » 2015/01/29 03:16:07

TrevorH,

Thanks for your reply. When I checked the /var/log/message I found this repeated each time I tried the cd /mymount/buffalo

Jan 28 16:55:01 SHS1 systemd: Created slice user-992.slice.
Jan 28 16:55:01 SHS1 systemd: Starting Session 49 of user pcp.
Jan 28 16:55:01 SHS1 systemd: Started Session 49 of user pcp.
Jan 28 16:55:24 SHS1 udisksd[2495]: The string `@ P�AT�Ui@�EU�MJ ' is not valid UTF-8. Invalid characters begins at `�AT�Ui@�EU�MJ '

And it is still repeating even though I have not tried the command again since this afternoon. Could this have something to do with the fact that I used webmin to create and edit the auto.mymounts file and also when I edited the auto.master file?

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: Cannot automount NAS share

Post by leo8888 » 2015/01/30 13:50:35

Just tried opening and re-saving the automount.master and automount.mymounts files using gedit to make sure there was not an issue with the encoding of the files. I saved them using encoding: UTF-8 and line ending: Unix/Linux. Then I restarted the autofs service and checked the /var/log/messages and this is what I see now:
Jan 30 08:33:00 SHS1 gnome-session: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x1c00025 (auto.maste)
Jan 30 08:33:00 SHS1 gnome-session: Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Jan 30 08:33:27 SHS1 fprintd: ** Message: No devices in use, exit
Jan 30 08:35:31 SHS1 systemd: Stopping Automounts filesystems on demand...
Jan 30 08:35:31 SHS1 systemd: Starting Automounts filesystems on demand...
Jan 30 08:35:31 SHS1 systemd: Started Automounts filesystems on demand.
Jan 30 08:37:06 SHS1 udisksd[2495]: The string `@ P�AT�Ui@�EU�MJ ' is not valid UTF-8. Invalid characters begins at `�AT�Ui@�EU�MJ
I noticed the reference to "auto.maste". Could this be the problem? Is there another config file somewhere that may have a misspelling of "auto.master"? I'm not sure where to look.

Thanks!

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: Cannot automount NAS share

Post by leo8888 » 2015/01/30 21:51:45

I've given up on automount and decided to just add the mount entry to my fstab with the noauto option so I can just mount as needed but I cannot even get that to work. If anyone could please guide me in the right direction it would be greatly appreciated.

Here is my current fstab entry:
//192.168.2.250/shs1 /buffalo auto noauto,rw,user 0 0
When I try mount /buffalo I get:
This program is not installed setuid root - "user" CIFS mounts not supported.
I've been banging my head on this for hours now and have tried many different variations in my fstab from different google sources but still cannot get this to work. I can mount fine if I use sudo but I need it to work under my user so I can put it in a backup script I am working on. I never imagined something as simple as connecting to a shared folder would be so difficult under linux.

User avatar
TrevorH
Forum Moderator
Posts: 28865
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot automount NAS share

Post by TrevorH » 2015/01/30 23:21:40

You added 'user' as a mount option in your fstab entry and CIFS doesn't support that (or so it says). Remove user from the options and then set up sudo so normal users can mount it that way if that was your intent.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: Cannot automount NAS share

Post by leo8888 » 2015/01/30 23:46:58

TrevorH,

Thanks for the tip but from what what I'm reading I still won't be able to mount and umount this share from a cron job.
Note: If you are executing sudo for the first time in a shell it will ask for the password ( current user password ) by default.
Is there a way around this?

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: Cannot automount NAS share

Post by leo8888 » 2015/01/31 02:50:44

TrevorH,

Thanks for pointing me in the right direction. I was finally able to get it working by doing the following:

Code: Select all

added:
%admin ALL=(ALL) NOPASSWD: ALL
to /etc/sudoers

did "setuid" on mount.cifs:
chmod 4755 /usr/sbin/mount.cifs 

added:
//192.168.2.250/shs1  /buffalo  auto  noauto,rw,user,username=leo,password=mypassword,uid=1000,gid=100    0 0
to /etc/fstab 
I can now do: "mount /buffalo" and "sudo umount /buffalo" without any errors or password prompts. Now I should be able to finish my backup script. Thanks for your help!

Post Reply

Return to “CentOS 7 - Networking Support”