Log in
Register
Menu
Log in
Register
Home
What's new
Latest activity
Authors
Forums
New posts
Search forums
What's new
New posts
Latest activity
Members
Current visitors
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Linux Based Receivers
Dreambox Support Forum
Mounting a network share at boot time.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="billnot" data-source="post: 401750" data-attributes="member: 176016"><p>A few weeks ago, in a thread on the 7025 forum entitled "expert setup", I posted a copy of my /etc/fstab with the idea of showing how to mount a network share (e.g. a folder on your PC) on the Dreambox at boot time.</p><p></p><p>Since then, and having learned a lot more about how the Dreambox does things, often quite differently from "standard" Linux, I now realise why this doesn't always work.</p><p></p><p>The problem is that /etc/fstab can be read, and the mount attempted, before the Samba client has started, and thus it will fail. The same trouble also befalls shares declared in automount.conf</p><p></p><p>The solution, which I have tried and tested with consistently good results on my 7025 follows. I have only tested it on the 7025. Locations and exact numerical files may differ for other models, but I see no reason why it shouldn't work for all. I'll explain the "why" after the "what".</p><p></p><p><span style="font-family: 'Tahoma'">Open a Telnet session.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"></span><span style="font-family: 'Tahoma'">(1) If you have a share mounted in /etc/fstab, remove it.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">(2) Navigate to /etc/init.d</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"><em>cd /etc/init.d</em></span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">(3) Create a shell script named (e.g.) netmount.sh which should be something like this:</span></p><p><span style="font-family: 'Tahoma'">--------------------------------------------------------------</span></p><p><span style="font-family: 'Tahoma'"><em> #! /bin/sh </em></span></p><p><span style="font-family: 'Tahoma'"><em># </em></span></p><p><span style="font-family: 'Tahoma'"><em># netmount.sh mounts all networkfilesystems. </em></span></p><p><span style="font-family: 'Tahoma'"><em># </em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em>PATH=/sbin:/bin:/usr/sbin:/usr/bin </em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em>mount -t cifs -o user=</em> <em>dream //</em><em>192.168.0.2/</em><em>share /media/shares/share</em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em>----------------------------------------------------------</em></span></p><p><span style="font-family: 'Tahoma'"><em>user=dream</em> - specifies user name on the PC - substitute your user name for dream</span></p><p><span style="font-family: 'Tahoma'"><em>//192.168.0.2/share</em> - IP address of the PC with the folder to be shares and share is the share name given to it.</span></p><p><span style="font-family: 'Tahoma'"><em>/media/shares/share </em>This is a the directory you have created on your Dreambox to accommodate the share - it seems logical to me to create it under /media, but you can put it where you like as long as you specify it correctly in the script.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">(4) chmod 755 your new script.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">(5) Now navigate to /etc/rcS.d and do a directory listing </span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"><em>cd /etc/rcS.d</em></span></p><p><span style="font-family: 'Tahoma'"><em>ls -l</em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em></em>You will see some (linked) files <em>Sxxsomething </em>where xx is a number.</span></p><p><span style="font-family: 'Tahoma'"><em>S98configure</em> should be the highest. Pick a number somewhere between the highest before that and 98 - in my case, <em>S60hdparm_script.sh</em> was the next highest, so I chose 90.</span></p><p><span style="font-family: 'Tahoma'">Now you need to do the clever bit and create a symbolic link back to the netmount.sh script you created above, naming it so that it's the last to execute before S98configure, i.e. using the number chosen above. Since I chose 90, my file will start S90, i.e.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"><em>ln -s /etc/init.d/netmounter.sh /etc/rsS.d/S90netmount.sh</em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em></em>To test it, make sure your PC share isn't mounted (by means of the <em>mount</em> command), and umount it if necessary, then call the linked file:</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"><em>cd /etc/rcS.d</em></span></p><p><span style="font-family: 'Tahoma'"><em>sh S90netmount.sh</em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em></em>Finally, check that your share is now mounted using <em>mount</em></span></p><p><span style="font-family: 'Tahoma'"><em></em></span></p><p><span style="font-family: 'Tahoma'"><em></em>When you reboot, your PC share will automatically be mounted. netmount.sh can contain as many mount lines as you like, to mount multiple PC shares.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">Why this works is because when booting Linux executes all the commands and scripts in the directories /etc/rc0.d to /etc/rc6.d and only handles /etc/rcS.d last (i.e. when runlevel 6 has been achieved). Also, it executes the commands within each directory in numerical order, so by linking our script to such a high numbered file, we guarantee it's virtually the last thing done on booting, thus ensuring that the Samba client is up and running when it happens.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'">It's working consistently for me, and I hope it's of help to you.</span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"></span></p><p><span style="font-family: 'Tahoma'"></span></p></blockquote><p></p>
[QUOTE="billnot, post: 401750, member: 176016"] A few weeks ago, in a thread on the 7025 forum entitled "expert setup", I posted a copy of my /etc/fstab with the idea of showing how to mount a network share (e.g. a folder on your PC) on the Dreambox at boot time. Since then, and having learned a lot more about how the Dreambox does things, often quite differently from "standard" Linux, I now realise why this doesn't always work. The problem is that /etc/fstab can be read, and the mount attempted, before the Samba client has started, and thus it will fail. The same trouble also befalls shares declared in automount.conf The solution, which I have tried and tested with consistently good results on my 7025 follows. I have only tested it on the 7025. Locations and exact numerical files may differ for other models, but I see no reason why it shouldn't work for all. I'll explain the "why" after the "what". [FONT=Tahoma]Open a Telnet session. [/FONT][FONT=Tahoma](1) If you have a share mounted in /etc/fstab, remove it. (2) Navigate to /etc/init.d [I]cd /etc/init.d[/I] (3) Create a shell script named (e.g.) netmount.sh which should be something like this: -------------------------------------------------------------- [I] #! /bin/sh # # netmount.sh mounts all networkfilesystems. # PATH=/sbin:/bin:/usr/sbin:/usr/bin mount -t cifs -o user=[/I] [I]dream //[/I][I]192.168.0.2/[/I][I]share /media/shares/share ---------------------------------------------------------- user=dream[/I] - specifies user name on the PC - substitute your user name for dream [I]//192.168.0.2/share[/I] - IP address of the PC with the folder to be shares and share is the share name given to it. [I]/media/shares/share [/I]This is a the directory you have created on your Dreambox to accommodate the share - it seems logical to me to create it under /media, but you can put it where you like as long as you specify it correctly in the script. (4) chmod 755 your new script. (5) Now navigate to /etc/rcS.d and do a directory listing [I]cd /etc/rcS.d ls -l [/I]You will see some (linked) files [I]Sxxsomething [/I]where xx is a number. [I]S98configure[/I] should be the highest. Pick a number somewhere between the highest before that and 98 - in my case, [I]S60hdparm_script.sh[/I] was the next highest, so I chose 90. Now you need to do the clever bit and create a symbolic link back to the netmount.sh script you created above, naming it so that it's the last to execute before S98configure, i.e. using the number chosen above. Since I chose 90, my file will start S90, i.e. [I]ln -s /etc/init.d/netmounter.sh /etc/rsS.d/S90netmount.sh [/I]To test it, make sure your PC share isn't mounted (by means of the [I]mount[/I] command), and umount it if necessary, then call the linked file: [I]cd /etc/rcS.d sh S90netmount.sh [/I]Finally, check that your share is now mounted using [I]mount [/I]When you reboot, your PC share will automatically be mounted. netmount.sh can contain as many mount lines as you like, to mount multiple PC shares. Why this works is because when booting Linux executes all the commands and scripts in the directories /etc/rc0.d to /etc/rc6.d and only handles /etc/rcS.d last (i.e. when runlevel 6 has been achieved). Also, it executes the commands within each directory in numerical order, so by linking our script to such a high numbered file, we guarantee it's virtually the last thing done on booting, thus ensuring that the Samba client is up and running when it happens. It's working consistently for me, and I hope it's of help to you. [/FONT] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Linux Based Receivers
Dreambox Support Forum
Mounting a network share at boot time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top