LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 04-11-2005, 04:11 PM   #1
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Kubuntu 9.04 (workstation) Debian 3.1r4 (file server) Knoppix (troubleshooting)
Posts: 191

Rep: Reputation: 30
Question mount smb shares at boot


Hi all, again.

I've about read myself cross-eyed and I'm not making any progress. This may look like it's been asked/answered before, but I can't find it. If it has, please give me the link rather than go through the whole 'this is how you do it' explanation.

The reason I have this here is that I am using Deb and I believe the resolution to my challenge has something to do with the way Deb boots up.

What I want to do is mount three network shares, via Samba since I use these shares when I boot to Windows, also. I can su to root and mount them manually immediately after boot, but I'd like to not HAVE to do that. Part of why people stick with M$ products is there's just too much work being repeated when you have to reboot that Windows does automagically. I am pretty confident that this doesn't NEED to be this way, it's just a matter of identifying and editing the right configuration files or setting up a shell script that runs at boot. Either way would work for me in this instance, if I could just get it figured out.

Here's my deal, I have the following in a shell script:

Code:
#!/bin/bash
mount -t smb //srvr/pub /mnt/common -o username=me,password=myself
mount -t smb //srvr/weezer /mnt/home -o username=me,password=myself
mount -t smb //srvr/tunez /mnt/music -o username=me,password=myself
mount
When I su to root and run ./mnt.shares.sh I get the following;

Code:
workstation:~# ./mount.shares.sh
Password:
Anonymous login successful
4476: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
/dev/hda6 on / type reiserfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda1 on /boot type reiserfs (rw,notail)
/dev/hda2 on /tmp type reiserfs (rw)
/dev/hda3 on /var type reiserfs (rw)
/dev/hda5 on /root type reiserfs (rw)
/dev/hda7 on /usr type reiserfs (rw)
/dev/hda8 on /home type reiserfs (rw)
/dev/hdb1 on /opt type ext3 (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev on /dev/.static/dev type unknown (rw,bind)
none on /dev type tmpfs (rw,size=10M,mode=0755)
//srvr/pub on /mnt/common type smbfs (rw)
//srvr/weezer on /mnt/home type smbfs (rw)
Maybe this is working correctly, after all I do get two of the three shares mounted. Maybe the problem is in my Samba configuration for the tunez share. Then again, maybe I'm stuck with having to mount these by hand everytime I reboot my system into Debian. Does anyone have any thoughts or suggestions?

help
 
Old 04-11-2005, 05:25 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
you managed to read everything out there and not once did you read about /etc/fstab???

/etc/fstab:
Code:
//server/share     /mnt/share      smbfs    username=bob,password=secret
job done.
 
Old 04-11-2005, 10:16 PM   #3
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Kubuntu 9.04 (workstation) Debian 3.1r4 (file server) Knoppix (troubleshooting)
Posts: 191

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by acid_kewpie
you managed to read everything out there and not once did you read about /etc/fstab???

/etc/fstab:
Code:
//server/share     /mnt/share      smbfs    username=bob,password=secret
job done.
Uh, don't recall saying I'd read "everything out there". Simply that I'd read enough that it was all bleeding together (messages and words).

In any event, I've tried the fstab route in the past and it flat hasn't cooperated. Could be an issue with my smb.conf or smbpasswd setups rather than my bootup stuff. I don't know. That's why I'm posting, and reading.
 
Old 04-11-2005, 10:26 PM   #4
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Kubuntu 9.04 (workstation) Debian 3.1r4 (file server) Knoppix (troubleshooting)
Posts: 191

Original Poster
Rep: Reputation: 30
Tried the syntax offered by acid_kewpie for fstab - I get the same results on boot as I was getting with my shell. Which shows me that I've got the syntax correct. But I still don't have the last mount occuring successfully. Am going to try shuffling the order of the lines in fstab to see if that matters. It's always been the same share that fails to mount, but I've always tried mounting them in the same order. We'll try this one again.
 
Old 04-11-2005, 11:03 PM   #5
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Kubuntu 9.04 (workstation) Debian 3.1r4 (file server) Knoppix (troubleshooting)
Posts: 191

Original Poster
Rep: Reputation: 30
Here is my fstab:

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda1       /boot           reiserfs notail         0       2
/dev/hda2       /tmp            reiserfs defaults       0       2
/dev/hda3       /var            reiserfs defaults       0       2
/dev/hda5       /root           reiserfs defaults       0       2
/dev/hda6       /               reiserfs defaults       0       1
/dev/hda7       /usr            reiserfs defaults       0       2
/dev/hda8       /home           reiserfs defaults       0       2
/dev/hda9       none            swap    sw              0       0
/dev/hdb1       /opt            ext3    defaults        0       2
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0
/dev/hdd        /media/cdrom1   iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
//srvr/tunez   /mnt/music      smbfs   username=me,password=myself
//srvr/pub     /mnt/common     smbfs   username=me,password=myself
//srvr/weezer    /mnt/home       smbfs   username=me,password=myself
//srvr/www     /mnt/web        smbfs   username=me,passwrod=myself
And here is the result of mount immediately after boot:

Code:
$ mount
/dev/hda6 on / type reiserfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda1 on /boot type reiserfs (rw,notail)
/dev/hda2 on /tmp type reiserfs (rw)
/dev/hda3 on /var type reiserfs (rw)
/dev/hda5 on /root type reiserfs (rw)
/dev/hda7 on /usr type reiserfs (rw)
/dev/hda8 on /home type reiserfs (rw)
/dev/hdb1 on /opt type ext3 (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev on /dev/.static/dev type unknown (rw,bind)
none on /dev type tmpfs (rw,size=10M,mode=0755)
//srvr/pub on /mnt/common type smbfs (rw)
//srvr/weezer on /mnt/home type smbfs (rw)
So, it's not necessarily the location/position of the share being mounted - it's got to be something with the share and it's setup in smb.conf:
Code:
# Samba config file created using SWAT
# from 10.10.1.1 (10.10.1.1)
# Date: 2005/04/11 22:50:01

# Global parameters
[global]
        workgroup = ITS.LOCAL
        server string = %h server (Samba %v)
        obey pam restrictions = Yes
        passdb backend = tdbsam, guest
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        domain logons = Yes
        dns proxy = No
        wins support = Yes
        panic action = /usr/share/samba/panic-action %d
        invalid users = root
        valid users = weezer, chick
        admin users = weezer, root
        hosts allow = 10., 127.

[printers]
        comment = All Printers
        path = /tmp
        create mask = 0700
        printable = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
        invalid users =
        guest ok = Yes

[homes]
        comment = Personal files stored on the network
        path = /home/%u
        invalid users =
        valid users = %S
        read only = No
        browseable = No

[pub]
        comment = Shared or public files stored on the network
        path = /home/common
        invalid users =
        read only = No

[www]
        comment = Website deployment space
        path = /home/www
        invalid users =
        read only = No

[tunez]
        comment = Music files in various formats
        path = /home/tunez
        invalid users =
        read only = No
Any suggestions or ideas would be greatly appreciated. And for the record, I've read A LOT, but not everything there is to be read. And I'm sure there are approaches that would probably yield the results I'm looking for, but I haven't thought of them, nor had them suggested, as yet.
 
Old 04-12-2005, 04:05 PM   #6
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Kubuntu 9.04 (workstation) Debian 3.1r4 (file server) Knoppix (troubleshooting)
Posts: 191

Original Poster
Rep: Reputation: 30
Okay, now I'm getting somewhat frustrated. I've got two shares mounting at boot. And I have two that don't mount, for no apparent reason that I can find. Also, the two shares that are mounted are supposed to be read-write, but I can't save a file to them. I have a file I've generated in Linux that I need to transfer to Windows, which is the biggest use I get from having a Samba files server. But, when I go to save it to /mnt/common, it chokes and gives me "Error saving the document myDoc.sxw: /mnt/home/My Documents/myDoc.sxw does not exist.". Well of course it doesn't exist there, that's why I'm trying to save it there!

Anyway, if anyone has any suggestions and can get past my grumpiness, I'd love to hear from you.

 
Old 04-14-2005, 05:45 PM   #7
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
the fstab somewhat works for me but I don't have a password set for one of my shares that I want to connect to, what can I do besides add a password, so i can mount this share on boot
 
Old 04-14-2005, 05:52 PM   #8
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
also I can use with no problem

mount -t smbfs //computer/share /directory/ -o username=guest,password=""

my fstab is this

//computer/share /directory smbfs ro 0 0 username=guest,password=""

I also tried single quotes for the password also.... any ideas?
 
Old 04-14-2005, 05:55 PM   #9
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
//computer/share /directory smbfs ro 0 0 username=guest,password=""

should be:

//computer/share /directory smbfs ro,username=guest,password="" 0 0
 
Old 04-14-2005, 08:07 PM   #10
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
thanks I alway get stuck on syntax thanks again
 
Old 06-05-2005, 01:57 PM   #11
slyguyr3
LQ Newbie
 
Registered: Nov 2003
Distribution: Mandrake 9.1
Posts: 4

Rep: Reputation: 0
what is the significance of the ro after smbfs?
 
Old 06-13-2005, 12:33 PM   #12
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
ro = read only
 
Old 06-13-2005, 12:34 PM   #13
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
rw = read write
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
smb mount folders disappear on mount & konqueror smb fails: network unreachable tisource Linux - Networking 1 10-17-2007 01:30 AM
SMB won't mount Windows Server Shares galliar Linux - Networking 1 05-11-2005 11:31 AM
making smb shares viewable from smb client via web browser scottpioso General 3 11-10-2003 05:25 PM
How to mount remote shares at boot up rparkes Linux - Networking 10 07-17-2003 03:48 AM
Auto Mount On Boot Win32 Shares zipur Linux - Networking 1 10-08-2002 03:38 AM


All times are GMT -5. The time now is 08:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration