6

I have a server that runs centos 6.2 with a samba share.

What i am trying to achieve is to have the samba share automatically mounted on my PC running Fedora 15.

In /etc/fstab I have

//192.168.1.104/ant     /media/ant              cifs    gid=users,file_mode=0664,dir_mode=0775,auto,username=***,password=***  0 0

The above works perfectly when I save and run mount -a , now the problem comes in when I reboot my Fedora PC, then the drive is not mounted when the server is running. I can run mount -a but this does not mount the samba share, when I open /etc/fstab and then mount -a then it mounts again

is there a way to have this share auto mounted on boot? Or did I miss something?

Elitmiar
  • 785

5 Answers5

1

Similar issue as this question.

You'll want to enable the netfs daemon on your Fedora system. This daemon can be used automount/unmount network file services (SMB, CIFS, NFS) defined in the /etc/fstab file.

Use either the ntsysv menu or chkconfig netfs on command to enable it.

This will fix your problem.

ewwhite
  • 201,205
1

Better use autofs (automount). http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs

GioMac
  • 4,754
0

Your configuration is OK.

You can try to delay network targets to mount (and also and other network services) after NetworkMananger start, with:

systemctl enable NetworkManager-wait-online.service

In addition you can add the _netdev parameter to prevent the system from attempting to mount these filesystems until the network has been enabled.

references:

https://bugzilla.redhat.com/show_bug.cgi?id=692008 (NFS)

https://bugzilla.redhat.com/show_bug.cgi?id=744399 (SAMBA)

http://linux.die.net/man/8/mount (find _netdev)

0

Just for clarity, when you say "at boot" do you mean having it mounted once the system has loaded, or when someone has logged in?

Have you considered making that code a bash script and running it with cron @reboot?

Or, copying it to /etc/init.d and making a service of it that starts at boot?

David
  • 137
0

Isn't /media a tmpfs in Fedora 15? Have you tried to mount it in another mount point which a normal directory (i.e. /mnt)?

Sorry for answering with questions, I cannot comment yet.

Also the _netdev and networkmanager suggestions made above should help for getting it right.

tripledes
  • 141