3

I'm using Cent OS 6.5. I have a cifs share which needs to be automatically mounted at the system reboot/startup.

Following is the line from my /etc/fstab file :

//192.168.1.2/files/ /users/ cifs _netdev,credentials=/root/secret.txt,uid=apache,gid=apache 0 0

When I run mount -a command the cifs mounts into the system, but does not automatically mount when I reboot or startup the machine.

Any reasons for this?

EDIT: When I cat /var/log/messages | grep -i cifs I get the following logs

Apr 21 17:01:13 cloud kernel: CIFS VFS: cifs_mount failed w/return code = -113
Apr 21 17:03:32 cloud kernel: CIFS VFS: Error connecting to socket. Aborting operation
Apr 21 17:03:32 cloud kernel: CIFS VFS: cifs_mount failed w/return code = -113
Apr 21 17:03:32 cloud kernel: CIFS VFS: Error connecting to socket. Aborting operation
  • If you use grep -i cifs instead of grep cifs, do you see any additional error messages? Do you see CIFS VFS: Error connecting to IPv4 socket. Aborting operation? – Mark Plotnick Apr 21 '14 at 19:19
  • @MarkPlotnick yes I'm getting an error like that. I have updated it on my question. – Chamara Keragala Apr 22 '14 at 2:43
2

http://rhn.redhat.com/errata/RHBA-2012-0816.html

It seems the netfs service should do what you want since 6.3

So propably you should just enable it on boot.

http://wiki.centos.org/TipsAndTricks/WindowsShares#head-64eaf1fbf783896908fc01021bdba240c2c4ff0b

Describes what you have done as 3.

But: netfs in CentOS does not mout as Fedora does...

to be continued...

  • I enabled it. But still no use - i.imgur.com/MPAYTka.png – Chamara Keragala Apr 22 '14 at 2:53
  • @chmzzy Interesting. Do umount cifs and do sh -x /etc/init.d/netfs start. Perhaps you can see what is going wrong there. – Nils Apr 22 '14 at 7:19
  • Here is what I got when I ran your command (I have no idea what it says, It would be great if you could explain me) - pastebin.com/raw.php?i=HbAm1BTW – Chamara Keragala Apr 22 '14 at 7:58
  • 1
    @chmzzy The init-script parses your fstab, finds a _netdev entry without noauto, sees that this should be cifs and assigns some varables. Then it activates your cloud vg with its three LVs. But then there is no mount command. Strange. Can you upload the init-script into pastebin, too? I have no co6 in reach at the moment. – Nils Apr 22 '14 at 19:05
  • Which init-script do you want? Here is rc.sysinit pastebin.com/raw.php?i=DXAaMaxB Hope this will be useful – Chamara Keragala Apr 23 '14 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.