PDA

View Full Version : Problems automounting samba share on boot


damien_d
2007-11-02, 06:49 AM CDT
Hello all,

I am trying to mount a samba share on boot. That is, once booted, I can perfectly mount:

mount -t cifs -o guest //192.168.1.6/music /media/music

No, there is no user name or password (it's a household network).

I am running FC7 on an ancient P3 HP box.

But I am having extreme problems trying to automatically mount it on boot.

So far, I have tried editing /etc/fstab and /etc/rc.d/rc.local as follows (but not at the same time!)

In /etc/rc.d/rc.local:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# Mount the music drive
mount -t cifs -o guest //192.168.1.6/music /media/music

Bit it fails. Here is the relevant bit of dmesg:

Bluetooth: RFCOMM ver 1.8
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
eth0: no IPv6 routers present
CIFS VFS: Error connecting to IPv4 socket. Aborting operation
CIFS VFS: cifs_mount failed w/return code = -101
eth0: no IPv6 routers present


And the full dmesg can be found at:
http://www.pastebin.ca/758632

I get the same -101 error code (networking not ready?) when I go fstab.

Any ideas before I lose any more hair?

Cheers
Damien.

glennzo
2007-11-03, 08:18 AM CDT
At one time I had a need to mount a samba share at boot. I was quite successful at it and spent so much time trying to make it work that I made a text file with notes on what I did to get it to work. Bear in mind that in my case there was a username, but at any rate I thought that this might help. The notes are as follows:

Make sure NETFS is running in services and that 192.168.0.0 oldendorff (the ip and name of the computer holding the share to mount) is in /etc/hosts.

The next line is the actual line in /etc/fstab:
//oldendorff/d /media/sharephoto cifs username=egon,password="",uid=500,gid=500 0 0

This worked in my case. My thought, since there is no user name on your end, is that you could try this line and substitute username=egon for username="".

I'm far from a samba expert and don't know if everything I did for my share was necessary. All I know is that it worked perfectly for my needs.

damien_d
2007-11-03, 07:44 PM CDT
Hmmm... well, it **just worked**....

I'm not sure why it suddenly decided to work, because I had netfs checked ( (GNOME menu bar) system -> Services). Maybe I hadn't rebooted since last playing with it or something.

For those that are interested, here is the /etc/fstab file that worked. I haven't touched /etc/hosts yet, mainly because there is no need because I have that server as a mapped DHCP address (Aren't I lazy!?)


LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
//192.168.1.6/music /media/music cifs username="",password="",uid=500,gid=500 0 0