|
Author | Topic: (Solved) Mounting NAS at boot with fstab (Read 1,788 times) |
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | (Solved) Mounting NAS at boot with fstab « Thread Started on Jan 24, 2011, 3:33pm » | |
I cannot mount my NAS at boot by entering the following in fstab:
Code:| 192.168.1.200:/Public /mnt/NAS nfs rw,addr=192.168.1.200 0 0 |
|
I have another desktop with both Debian Squeeze/KDE and Mandriva/KDE installed and this line works perfectly on both distros.
In Saline I can successfully manually mount this NAS with the following command:
Code:| mount -t nfs 192.168.1.200:/Public -vv /mnt/NAS/ |
|
I have had a problem in the past with a Mandriva/KDE distro (not my current Mandriva release) using the fstab method when I found there was timing issue in the init scripts sequence, so I have been experimenting by adding delays in various scripts in /etc/init.d but with no success. I've compared the contents of Saline /etc/rcS.d with the Debian Squeeze/KDE and there are some differences but I'm getting out of my depth now.
Why can I manually mount the NAS but not auto mount it with fstab, anybody able to help ?
TIA
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: Mounting NAS at boot with fstab « Reply #1 on Jan 24, 2011, 3:51pm » | |
A quick fix for this is to gksu mousepad /etc/rc.local and add mount -t nfs 192.168.1.200:/Public -vv /mnt/NAS/ to it above the exit 0 line.
| |
|
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | Re: Mounting NAS at boot with fstab « Reply #2 on Jan 25, 2011, 6:38am » | |
Thanks for the quick fix suggestion. Initially this did not work so I had a look at the text on the <Ctrl><Alt><F1> console and there was an error on the line directly after the "Starting Network connection manager: wicd" line:
Quote:| mount.nfs: Failed to resolve server 192.168.1.200: Name or service not known |
|
I tried a few more things but none were successful, one of which was to add a "sleep 10" command on the line before my "mount" command in rc.local.
Code:#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. sleep 10 mount -t nfs 192.168.1.200:/Public -vv /mnt/NAS/
exit 0 |
|
I found that I can look at the F1 console whilst at the Login screen, so before I logged in I had a look and, at first, the error line was not there but then whilst I was watching, the mount appeared showing the information that I normally see when I do a successful manual mount in a terminal after logging in. I returned to the Login screen, logged in and my NAS had mounted successfully. I experimented with the "sleep" command and found that 10 seconds was the minimum delay I could use, anything less and I got the error shown above. Even with this delay if I continue to login as soon as the Login screen appeared, then the NAS does not mount.
This is a repeatable sequence, so there does appear to be a timing issue. I would really like to get the fstab method to work but this quick fix will do for now.
Has anyone any suggestions on how I could track down what is happening during the boot sequence ?
| |
|
ryuichi New Member
 member is offline
Joined: Jan 2011 Gender: Male  Posts: 1
|  | Re: Mounting NAS at boot with fstab « Reply #3 on Jan 26, 2011, 7:07am » | |
It came to be able to do mount with fstab by using NetworkManager instead of wicd though the same phenomenon had been generated.
Is wicd indispensable?
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: Mounting NAS at boot with fstab « Reply #4 on Jan 26, 2011, 7:49am » | |
No you can aptitude purge wicd and use network manager if you wish. It's a bit more bloated, but if it is needed its not that bloated.
| |
|
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | Re: Mounting NAS at boot with fstab « Reply #5 on Jan 26, 2011, 2:50pm » | |
Thanks ryuichi. I have replaced wicd with Network Manager and now my NAS is mounted by fstab 
As Anthony states, it's a bit more bloated and I was attracted to Saline because of it's lightweight, but it's not a showstopper.
I'm impressed with Saline so far, a lot of the customisation that's been done has suited my needs very well.
Thank you both for your help, I'll mark this thread as Solved.
Steve
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #6 on Jan 26, 2011, 3:09pm » | |
This seems to be an issue with the boot sequence. Possibly a bug caused by the move to dependency based boot. When I find the time I will see if I can figure out the cause and take appropriate action.
| |
|
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #7 on Jan 26, 2011, 3:46pm » | |
I had a play with bootchart2 (installed from sid) today to see if I could see why I needed to put a sleep 10 in rc.local but I could not see any obvious reason.
When I get time I'll run it again now that I've installed NM and see if it reveals anything about why fstab is now able to mount the NAS.
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #8 on Jan 26, 2011, 3:53pm » | |
Any information you can supply would be much appreciated.
| |
|
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #9 on Feb 3, 2011, 2:12pm » | |
I have had a look at the bootchart2 output after having installed Network Manager and I'm afraid I don't have enough knowledge of the boot process or how it is interpreted by the bootchart2 package to draw any definitive conclusion 
I can see that there is a lot more "activity" when NM gets loaded, compared to the chart with wicd installed, including some mountnfs commands, but I can't tell if this is before or after fstab is "interrogated".
I'm just going to have to be pragmatic about the issue and accept that my NAS is now getting mounted by fstab, which is what I want to happen.
Steve
| |
|
62chevy Senior Member
    member is offline
![[avatar] [avatar]](http://img541.imageshack.us/img541/451/hrdp0704patinachevrolet.jpg)
Hard Core!
Joined: Jan 2011 Gender: Male  Posts: 412 Location: West Virginia, USA
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #10 on Feb 3, 2011, 5:12pm » | |
Maybe this info will help from the wicd forums.
http://wicd.net/punbb/viewtopic.php?id=261
Seems you can use a script in wicd or that wicd uses to mount your nfs mounts.
|
Debian 6.0.3 Gnome2 Debian - Sid Caution DE may change on a whim. SalineOS 1.5
|
|
62chevy Senior Member
    member is offline
![[avatar] [avatar]](http://img541.imageshack.us/img541/451/hrdp0704patinachevrolet.jpg)
Hard Core!
Joined: Jan 2011 Gender: Male  Posts: 412 Location: West Virginia, USA
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #11 on Feb 3, 2011, 9:14pm » | |
This is a more up to date link from wicd.
http://wicd.net/moinmoin/Adding%20pre%20....ction%20scripts
I'm thinking you should be able to add something like mount -a or mount -t nfs /the/rest.
I've been wanting to do an NFS but never have.
|
Debian 6.0.3 Gnome2 Debian - Sid Caution DE may change on a whim. SalineOS 1.5
|
|
rc10b New Member
 member is offline
Joined: Jan 2011 Posts: 10
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #12 on Feb 4, 2011, 4:45pm » | |
Thanks for your input but I've decided to stay with Network Manager, it's works 
Maybe another time.
| |
|
62chevy Senior Member
    member is offline
![[avatar] [avatar]](http://img541.imageshack.us/img541/451/hrdp0704patinachevrolet.jpg)
Hard Core!
Joined: Jan 2011 Gender: Male  Posts: 412 Location: West Virginia, USA
|  | Re: (Solved) Mounting NAS at boot with fstab « Reply #13 on Feb 4, 2011, 6:44pm » | |
Can't say that I blame you but others might find this useful. Plus when the hony do list get done I'm wanting to play with it and maybe write a small how-to. Just don't hold your breath.
|
Debian 6.0.3 Gnome2 Debian - Sid Caution DE may change on a whim. SalineOS 1.5
|
|
|