[SOLVED] Cannot automount NAS share
[SOLVED] Cannot automount NAS share
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!
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.
Re: Cannot automount NAS share
When you did the cd /mymount/buffalo, did you check in /var/log/messages afterwards?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Cannot automount NAS share
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?
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?
Re: Cannot automount NAS share
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:
Thanks!
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.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
Thanks!
Re: Cannot automount NAS share
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:
Here is my current fstab entry:
When I try mount /buffalo I get://192.168.2.250/shs1 /buffalo auto noauto,rw,user 0 0
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.This program is not installed setuid root - "user" CIFS mounts not supported.
Re: Cannot automount NAS share
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Cannot automount NAS share
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.
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.
Is there a way around this?Note: If you are executing sudo for the first time in a shell it will ask for the password ( current user password ) by default.
Re: Cannot automount NAS share
TrevorH,
Thanks for pointing me in the right direction. I was finally able to get it working by doing the following:
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!
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