I am able to mount the remote system and directory just fine. So I put that into the /etc/fstab file. Rebooted...not there. I was beginning to question why I was in Always Fresh mode when I finally read the top of the fstab file...it's always regenerated at reboot. Ah. So that's why my stuff was disappearing. It says to put my mount changes in /etc/rc.d/rc.local or sysvinit scripts.
I put the mount command in rc.local, but upon reboot, it was not mounted. I then executed the rc.local file, and it mounted correctly. So I'm wondering if perhaps the network had not yet been established before the mount command happened?
I'm somewhat surprised that searches don't reveal this to be a common problem. Am I going about this the wrong way? Is it trivially easy to do and I'm just missing it?
Mount cmd:
mount -t cifs \\\\WindowsSys\\my_dir /localLogs -o user,uid=500,rw,suid,username=u,password=p
Mounting NFS after boot
- francois
- Contributor
- Posts: 6312
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
Re: Mounting NFS after boot
Do you work in always fresh mode or with the saves cheatcode in your grubloader instructions?
http://www.porteus.org/tutorials/26-gen ... -them.html
http://www.porteus.org/tutorials/26-gen ... -them.html
Prendre son temps, profiter de celui qui passe.
Re: Mounting NFS after boot
I'm not working in always fresh, I have saves set to the default (porteus/changes). And for all other things, saves works fine. But the fstab file is regenerated each boot, regardless of saves, so however I am to mount the NFS drive, it can't be that way.
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Mounting NFS after boot
Use /etc/rc.d/rc.local or a sysvinit script to inject the line into fstab.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
Re: Mounting NFS after boot
It says to do that in the top of the fstab file...and that is what I've been trying...but that is what I have trouble getting done.
I don't know how to "inject" this into the fstab file from rc.local. I just tried doing the "mount" command in there...is that the same thing? I put the line in rc.local and rebooted...and it did not work. But when I simply executed rc.local on the command prompt, it worked. So, the mount command I am using WORKS, but does not appear to work in rc.local.
Is there a log somewhere that might indicate what the problem was? I checked dmesg and it did not indicate anything had tried to run in rc.local and could not.
I checked the /etc/fstab file after I had rebooted and no new lines were added to it via the mount command I had put in rc.local.
I don't know how to "inject" this into the fstab file from rc.local. I just tried doing the "mount" command in there...is that the same thing? I put the line in rc.local and rebooted...and it did not work. But when I simply executed rc.local on the command prompt, it worked. So, the mount command I am using WORKS, but does not appear to work in rc.local.
Is there a log somewhere that might indicate what the problem was? I checked dmesg and it did not indicate anything had tried to run in rc.local and could not.
I checked the /etc/fstab file after I had rebooted and no new lines were added to it via the mount command I had put in rc.local.
Re: Mounting NFS after boot
Ok, I was able to redirect the output of rc.local to a log file, and see that the reason the mount command is failing is because it can't resolve the address. I believe that the command in rc.local is executing before the network is technically "up".
Is there a delay command I need to use?
I still find it hard to believe no one else has ever tried to mount an NFS upon boot (at least based on search results, no one has ever tried, or no one had any problems doing it!)
Is there a delay command I need to use?
I still find it hard to believe no one else has ever tried to mount an NFS upon boot (at least based on search results, no one has ever tried, or no one had any problems doing it!)
Re: Mounting NFS after boot
Ok...by adding a "sleep 10" command before the mount command, it now works. But doing this roughly doubles the boot time.
There goes the benefit of Porteus' quick booting.
Soooo, I think what I'm going to have to do is simply do the mount command at the beginning of the test script. The network will have come up by then, and if the mount fails, I can just go to a local directory instead. It's not flashy, but I don't see how else to get the mount command to happen without un-necessarily delaying system boot.

Soooo, I think what I'm going to have to do is simply do the mount command at the beginning of the test script. The network will have come up by then, and if the mount fails, I can just go to a local directory instead. It's not flashy, but I don't see how else to get the mount command to happen without un-necessarily delaying system boot.
- fanthom
- Moderator Team
- Posts: 5591
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Mounting NFS after boot
you can send the code to the background through rc.local:
this way it wont slow down booting.
Code: Select all
#!/bin/sh
(
sleep 20
mount xxx
) &
Please add [Solved] to your thread title if the solution was found.
Re: Mounting NFS after boot
Excellent, thank you! 
