mounting linix drive upon boot

Stuff that don´t fit in the other categories.
Post Reply
User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

mounting linix drive upon boot

Post by l0ngb1t »

i have installed a NAS and shared a file on it with NFS, on my linux machine (debian 7) i can mount it successfully with the following command:

Code: Select all

mount -t nfs NAS_IP:/shared_folder /root/share
i tried to add the following line to fstab in order to be mounted automatically upon boot

Code: Select all

NAS_IP:/shared_folder /root/share 0 0
it is not working, i have to mount it manually every-time
any ideas on how to solve this?
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

Re: mounting linix drive upon boot

Post by l0ngb1t »

ok i have solved it and i thought to share it.

first in fstab i should add

Code: Select all

NAS_IP:/shared_folder /where_to_mount    nfs     defaults     0    0
the problem was that S09mountall.sh (mountall do the mounting) is called in rcS.d before the networking service starts, and nfs kind aneeds networking service :P i linked it to rc3.d and named it S30mountall.sh (the S30 to give it a higher sequence number or order of execution)

so now mountall.sh is called after the network service starts, hence the mount is successful
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

Re: mounting linix drive upon boot

Post by l0ngb1t »

ok it worked without the rc thingy :| i guess the syntax was just wrong
anyway i learned something new
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: mounting linix drive upon boot

Post by bad_brain »

nfs is usually autostarted during boot already, so no need to explicitly start it again...most likely the 2nd time you told nfs to start was the reason of the problem.
a very nice way to deal with the rc settings is through rcconf, simply install it via apt-get.... :wink:
Image

Post Reply