LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 04-18-2018, 02:14 PM   #1
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,927

Rep: Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214
openSUSE Tumbleweed auto-mount network drives at boot


Have a smaller system with limited drive space; in this case, a mini PC that has zero room for expansion, and is only used for conference room display purposes. Not really much to be gained by upgrading this cheap little box.

In order to have access to our internal server, I've used SSHFS to mount the remote shares. Could easily be NFS, Samba or whatever, but for this example, that's what I've used. This is a two part solution:

Step One: In /etc/NetworkManager/dispatcher.d, create a file called "netdrives" (or whatever). In it, put:
Code:
#! /bin/sh
. /etc/rc.status

case "$2" in
    up)
        /usr/local/bin/NetMount.sh
        ;;
    *)
        exit 0
        ;;
esac
Note the line bolded above; that's another script file located somewhere else, that contains your mount commands. So, when the interface comes up, it'll run this, and not before.

Step Two: Create the mount script. Can be as simple or complex as you want it; in my case, it's only several lines like this:
Code:
sudo -u user sshfs user@10.11.12.13:/some/remote/path /some/local/path -o allow_other
This will mount the shares as my 'regular' user account, allowing me full read/write.

Handy for the house, too, if you have a NAS you'd like to mount when you hook up to your home network.
 
Old 12-04-2018, 01:03 PM   #2
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Rep: Reputation: 29
I apologize for necroing this thread I am just wondering if this would work for mounting from Raspi 3 last year I bought one and was trying to get it to mount drives that had videos on them and I never could get it to work . and of course I dont remember the OS I was using but it had Kodi which booting automatically . I ended up just boxing the raspi 3 .
 
Old 12-04-2018, 01:28 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,927

Original Poster
Rep: Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214Reputation: 5214
Quote:
Originally Posted by Shadowmeph View Post
I apologize for necroing this thread I am just wondering if this would work for mounting from Raspi 3 last year I bought one and was trying to get it to mount drives that had videos on them and I never could get it to work . and of course I dont remember the OS I was using but it had Kodi which booting automatically . I ended up just boxing the raspi 3 .
No idea; if it has the same folders/items mentioned here, it'd be worth a try. You could always just lowball the whole thing, create a script that runs at boot-time, with a "sleep" in it, to allow the network time to come up, or have the script check for a successful ping of something and mount the drive(s). Lots of options.
 
Old 12-04-2018, 01:56 PM   #4
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Rep: Reputation: 29
thanks for replying I will digout my raspi3 and see if I can get this up and running
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to auto mount network drives robertkwild CentOS 3 03-06-2016 11:59 AM
auto mount network drives at start up sideburns05 Linux - Newbie 7 08-13-2015 07:31 AM
Using OpenSuSE 11.3...how do I auto-mount my two optical drives? cbjhawks SUSE / openSUSE 1 03-21-2011 09:21 AM
how to do auto mount network folder (smbfs) on boot? fahridon Linux - Networking 2 05-27-2006 04:06 AM
auto mount a network drive at boot Dr Gutiemouth Linux - Newbie 14 02-27-2005 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration