LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-14-2006, 09:43 PM   #1
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Mounting Windows network shares at boot time?


I installed Slackware 10.2 on a spare computer, I'm looking for a way to automount my windows network shares when I boot my computer.

I tried adding an entry to /etc/fstab, but that didnt work and I dont even know if I'm going in the right direction with that. I can mount the shares manually using a mount command.
 
Old 05-14-2006, 10:12 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
Mmm, adding Samba shares in fstab _does_ work, you're just obviously doing it wrong. Post your fstab so we can see where.
 
Old 05-15-2006, 01:51 AM   #3
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Rep: Reputation: 62
i'm not guru, i know enuff to get myself into trouble,

Quote:
smbmount://ServerIPAddress/ShareName /DirectoryForServerToMountTo -o username=yourwindowsusername,pasword=yourwindowspassword
note that's all one line in console.

Last edited by Old_Fogie; 06-09-2006 at 11:09 PM.
 
Old 05-15-2006, 04:53 PM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,476

Rep: Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531
My Windows and Slack boxes are not always powered up concurrently. Therefore, rather than embed my share connections in fstab, I wrote a script to connect to those shares. If the Windows box is not ready then my bash script merely reports a screen message to that effect. Because the connections are established by a script, I can manually make those connections if I later concurrently power up both and want to share files.

I named my connection script netconnect and I store that script in /usr/local/sbin.

During booting I run the netconnect script from within /etc/rc.d/rc.local.

One nice aspect about mounting through a script is flexibility because I can add or create connection shares with minimal fuss. That is, within the script I use procedures/subroutines. All I need do is create the Windows share point and then add one line in my script to call the mounting subroutine. I never have to muck with fstab either.

Of course, I need to have the Samba service running before I run the script and when I run the script manually I need root privileges.
 
Old 05-15-2006, 08:08 PM   #5
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Rep: Reputation: 62
so is your script something like

text file named netconnect.sh and made executable
and then with these contents in it
Quote:
smbmount://ServerIPAddress/ShareName /DirectoryForServerToMountTo -o username=yourwindowsusername,pasword=yourwindowspassword
??
 
Old 05-16-2006, 07:31 PM   #6
soulestream
Member
 
Registered: Nov 2005
Posts: 183

Rep: Reputation: 30
I am assuming your are not mounting AD shares.

Soule
 
Old 05-16-2006, 09:14 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,476

Rep: Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531
Quote:
so is your script something like

text file named netconnect.sh and made executable
and then with these contents in it
Minimally, yes, that is my script. However, my script is more complicated than that.

My primary box is multi-boot with Windows NT4 and Slackware. My second box is Slackware only. When I boot my primary box into Slackware, using fstab I automatically mount all of my Windows partitions, all of which are NT4 partitions. I mount those partitions read-only, but, I also have one read-write FAT32 partition for sharing and shuffling files. I had that box configured for multi-booting a long time before I obtained my second box.

For consistency, I use the same mount points for either Slackware OS. For example, if I boot my primary box into Slackware, then my NT4 data files partition, which is my E: partition when in Windows, is mounted at mount point /mnt/nt_e. My shared FAT32 partition, which is my O: partition in Windows, is mounted at /mnt/nt_o. I have many Windows partitions, but those two examples should provide the idea. When I want to mount those Windows partitions from within my second box, I use the same mount point names. That kind of consistency keeps me from getting confused.

Because my primary box is multi-boot, my second box does not necessarily "know" which OS that box might be running. And I cannot predict that either. Therefore, my connection script needs to figure whether Windows or Slackware is the OS on the primary box. I use different box names for Windows and Slackware. In my script I ping the box name to test which OS I booted into. You might need to update your /etc/hosts file to include the box names and IP addresses. I use static addresses.

I do not automatically run all of my networking services when in Windows because I don't tinker much these days with my two boxes. Most of the time I just boot into NT4 for surfing and email as well pounding away in Word 97. Therefore typically I have no need for localized networking most of the time. I'm stuck on dialup, so that too negates the need for continuous network services. When I find occasional spare time and want to play and learn then I manually start my Windows networking services with a script. Although I have 256MB in my primary box, which is more than enough for NT4 even if I were to run networking services continuously, I've been around personal computers for almost 25 years. Thus, I'm sort of a throwback to the days and philosophy when one did not run unnecessary services and programs. Old habits like that are challenging to break.

When I want to tinker and I forget to start my Windows networking services, my second box netconnect script provides me error messages on screen. I do the Homer Simpson "Doh!", quickly run my Windows script, run my netconnect script again, and then everything connects fine.

Automating all of this is always an ultimate goal, but because I already know that most of the time I am not networking both boxes, I prefer to simply run my scripts manually. That would change if I finally had access to a broadband connection for the web. Then I'd have to start some of the Windows network services all the time.

I haven't finished the netconnect script for when I boot my primary box into Slackware because I have not found the time to update that box to 10.2. I probably will not do that until this coming winter and then I'll update both boxes to Slackware 10.3/11.0. I want to update both boxes with the same version of KDE too. When I finally update my boxes I want my Slackware user scripts and rc.d scripts on both boxes to work the same and eventually I'll write some sort of automatic synchronizing script to perform that for me.

But for now my manual methods are okay because when I want to connect my second box to my primary box, the primary box usually is in Windows. When I am running Slackware on both boxes I connect using the Konqueror fish (ssh) protocol. That is sufficient for me when I want to sync or browse files and the like.

With that said and done, I am providing a link to a copy of the script at my web site. Feel free to modify as you see fit. Understand that this script is not finished and is a work in progress.

/usr/local/sbin/netconnect

The script sources a colorization script: /etc/functions-colors

What I have done probably overkill is for many people, but in a tinkering environment the script provides a lot of flexibility.
 
  


Reply

Tags
boot, mount, samba, share, windows


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
mounting and viewing network shares GraemeK Linux - Networking 4 01-27-2004 03:23 AM
Mounting Windows Shares ilumin8d Linux - Networking 4 07-15-2003 02:36 AM
Mounting Windows Shares Thermos Linux - Networking 3 07-09-2003 01:34 PM
mounting windows shares Moebius Linux - Newbie 12 12-19-2002 08:58 PM
Mounting windows network shares at boot TennesseeJeff Linux - Networking 1 05-24-2002 12:58 PM


All times are GMT -5. The time now is 04:06 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