Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-11-2005, 03:11 PM
|
#1
|
Member
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199
Rep:
|
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
|
|
|
04-11-2005, 04:25 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
04-11-2005, 09:16 PM
|
#3
|
Member
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199
Original Poster
Rep:
|
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.
|
|
|
04-11-2005, 09:26 PM
|
#4
|
Member
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199
Original Poster
Rep:
|
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.
|
|
|
04-11-2005, 10:03 PM
|
#5
|
Member
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199
Original Poster
Rep:
|
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.
|
|
|
04-12-2005, 03:05 PM
|
#6
|
Member
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199
Original Poster
Rep:
|
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.
|
|
|
04-14-2005, 04:45 PM
|
#7
|
Member
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37
Rep:
|
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
|
|
|
04-14-2005, 04:52 PM
|
#8
|
Member
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37
Rep:
|
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?
|
|
|
04-14-2005, 04:55 PM
|
#9
|
Member
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 229
Rep:
|
//computer/share /directory smbfs ro 0 0 username=guest,password=""
should be:
//computer/share /directory smbfs ro,username=guest,password="" 0 0
|
|
|
04-14-2005, 07:07 PM
|
#10
|
Member
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37
Rep:
|
thanks I alway get stuck on syntax thanks again
|
|
|
06-05-2005, 12:57 PM
|
#11
|
LQ Newbie
Registered: Nov 2003
Distribution: Mandrake 9.1
Posts: 4
Rep:
|
what is the significance of the ro after smbfs?
|
|
|
06-13-2005, 11:33 AM
|
#12
|
Member
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37
Rep:
|
ro = read only
|
|
|
06-13-2005, 11:34 AM
|
#13
|
Member
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37
Rep:
|
rw = read write
|
|
|
All times are GMT -5. The time now is 07:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|