Forum
« (Solved) Mounting NAS at boot with fstab »

Welcome Guest. Please Login or Register.
May 19, 2013, 9:31pm



Return to or visit the SalineOS webpage

Forum :: General :: Networking Support :: (Solved) Mounting NAS at boot with fstab
   [Search This Thread] [Share Topic] [Print]
 AuthorTopic: (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
« Last Edit: Jan 26, 2011, 2:50pm by rc10b »Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

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.
Link to Post - Back to Top  IP: Logged
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 ?
Link to Post - Back to Top  IP: Logged
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?
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

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.
Link to Post - Back to Top  IP: Logged
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 ;D

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
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

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.
Link to Post - Back to Top  IP: Logged
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.
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

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.
Link to Post - Back to Top  IP: Logged
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
Link to Post - Back to Top  IP: Logged
62chevy
Senior Member
****
member is offline

[avatar]

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.
Link to Post - Back to Top  IP: Logged

Debian 6.0.3 Gnome2
Debian - Sid Caution DE may change on a whim.
SalineOS 1.5

62chevy
Senior Member
****
member is offline

[avatar]

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.
Link to Post - Back to Top  IP: Logged

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.
Link to Post - Back to Top  IP: Logged
62chevy
Senior Member
****
member is offline

[avatar]

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. ;D
Link to Post - Back to Top  IP: Logged

Debian 6.0.3 Gnome2
Debian - Sid Caution DE may change on a whim.
SalineOS 1.5

   [Search This Thread] [Share Topic] [Print]



Anthony Nordquist, on behalf of the SalineOS project, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. As such, if you click the above banner and then make any purchase including digital downloads, a small percentage will be paid to the SalineOS project.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile