Click to See Complete Forum and Search --> : mount shares at bootup


CablDeViL
02-03-2001, 02:31 AM
I have everything runing great in rh70 2.2.4 and samba 2.0.7 but i like to get the MS shares to auto mount durring boot time. I have tried many command lines in rc and other with no luck. Also these shares I am connecting to are MS shares and they need the user name and password to connect.

I have searched for days and here is my cry for help!

Thanks :confused:

Strike
02-03-2001, 04:20 AM
What kind of lines were you putting in your rc startup scripts (should be in rc.local)? They should look something like:

mount -t smbfs \\\\ComputerName\\foldername \path\to\mount\point

(I think you have to do double slashes, but am not 100% sure, just 99% sure [since \\ is just an escaped backslash])

Also, make sure you have started the smbd and nmbd daemons first as well as having already brought up your network interface. I think that either of those not being done first will cause the mounting to fail (I'm certain the latter will, not sure about the former).

CablDeViL
02-03-2001, 02:32 PM
I was using rc.sysinint (i think that was next to rc.local in rc.d dir) I am not at my linux box now so im not sure.

The command I was using was smbmount //server/share /mnt/temp
then i tried the same as above but added "username=root password=pass"

I guess I am using the wrong command and the wrong rc file??

does the -t use the login info entered durring prompt?? I will go to my linux box in 1 hour and try your command line at the end of the rc.local and see if it works. And Yes i have smb and nmd starting up durring boot (all works well when i mount manually)

TY

CablDeViL
02-03-2001, 03:06 PM
ok i used the command you posted and the format is \\\\server\\share /mnt/mountpoint

But it does the same thing smbmount does and it asks be for my password, any thoughts?

digitalzero
02-03-2001, 04:07 PM
I'm new to this as well. I have a win2k pro box with a fat32 drive shared. How can I access it on my linux box? Thanks.

The King Ant
02-03-2001, 07:23 PM
CablDeViL: "mount -t smbfs -o username=tridge,pasword=boobar //hostname/sharename /mnt/point" or "mount -t smbfs -o guest //hostname/sharename /mnt/point"

"mount -t smbfs" basically just calls smbmount. If you don't specify either a password or the "guest" option, samba will prompt for a password.

digitalzero: You'll need to know which drive letter you have win2k installed on. First cd to /mnt and see if there is already a "win" or "windows" or "dos" partition--many new distributions mount it automatically.

If it's not already set up, as root: "mkdir /mnt/windows" Then "mount -t vfat /mnt/windows"

You can also add a line to your /etc/fstab file so it's done automatically. man fstab for more info. I think there is also an NHF about it.

CablDeViL
02-04-2001, 07:24 PM
The King Ant,

THANKS for the help! your command line worked to the T and i cant thank you and evryone else here enough!!

Now its time to set up a nat and a firewall. Look for more dumb questions by me =))

CD :D

Coral Sea
02-05-2001, 03:40 AM
Or you could try adding the following command line to /etc/rc.local:

smbmount //winbox/windirectory /mountpoint -o username=you,password=password,uid=501,gid=501

where you substitute the appropriate values for the variables, e.g., put your Windows PC's name in for winbox. :cool:

Ryeker
02-05-2001, 12:42 PM
Why not use fstab?

Coral Sea
02-06-2001, 03:45 AM
Yup, lots of ways to skin that cat. :rolleyes:

Craig McPherson
02-10-2001, 04:31 AM
Well, fstab is the standard configuration file for ALL filesystem mounting: whether it's local filesystems, or NFS filesystems, or etc.

However, I'd avise you NOT to mount SMB (Windows filesharing) fileshares at boot time automatically. The mounting tools included with Samba are not incredibly robust. If the Windows goes down while one of its shares is mounted on your Linux box, you're likely to get IO errors, and you'll probably have trouble re-mounting it once the Windows box is back up, because it wasn't unmounted properly.

Also, the Windows box will eventually time out the connection after it's idle for long enough, and once again, since you didn't unmount the share before the Windows box killed your connection to it, you'll get IO errors and have a hard time remounting it.... the smbmount program just does NOT seem to handle this cleanly, I've found.

Your BEST course of action would be to specify the shares and their mount points and the user and password and all that in /etc/fstab, but use the noauto option, so that the shares aren't mounted automatically at boot. Then, you can mount them with one simple command after they're defined in /etc/fstab:

mount /mnt/win

And when you're done, you can unmount it like this:

umount /mnt/win

As long as you remember to unmount the shares before before the Windows box barfs, reboots, or kicks you off, you'll be fine.