Page 1 of 1
Automount NFS drive?
Posted: Wed Oct 20, 2010 8:48 pm
by pasdesignal
I running exactly the same setup as puupycrack et al as described over here:
posting.php?mode=post&f=2
Basically its kamikaze 8.09 / NFS mount / mpd etc
Have been trying to automount the nfs drive (which is on a x-wrt based server with a usb harddrive) for a week now and have had no luck.
I am editing the /etc/config/fstab file as so:
config mount
option target /mnt/media
option device 192.168.0.139:/mnt
option fstype nfs
option options rw,nolock
option enabled 1
Am I barking up the right tree?
Re: Automount NFS drive?
Posted: Thu Oct 21, 2010 5:15 am
by jeroen94704
I never got automount to work through fstab either, and ended up adding the mount command to my mpd script in init.d
Re: Automount NFS drive?
Posted: Thu Oct 21, 2010 4:04 pm
by pasdesignal
OK, sounds promising.
I don't mind a workaround if thats what it takes.
Could you post an example?
Thanks for your reply.
Re: Automount NFS drive?
Posted: Fri Oct 22, 2010 12:17 am
by jeroen94704
This is the script that automatically starts mpd when the router boots. It also mounts the usb drive and the NFS share that contains my music:
/etc/init.d/mpd
Code: Select all
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2008 OpenWrt.org
START=99
STOP=99
NAME=mpd
start() {
# Delay so other boot scripts finish running
sleep 5
# Expand library path so packages installed on the usb drive can be found
export LD_LIBRARY_PATH=/usb/packages/usr/lib:/usb/packages/lib
# Mount the USB drive
mount -t ext3 /dev/discs/disc0/part2 /usb
# Run portmap, or mounting the NFS share wil take FOREVER
portmap
# Mount the NFS share
mount -t nfs 192.168.0.192:/mnt/bigdata/music /usb/remote
# Run mpd
/usb/packages/usr/bin/mpd /usb/packages/etc/mpd.conf
}
Now when you add a symlink to this file in /etc/rc.d/S99mpd, it will run the "start" function in this script automatically upon startup. The command to make a sym link is:
Code: Select all
ln -s /etc/init.d/mpd /etc/rc.d/S99mpd
Re: Automount NFS drive?
Posted: Sat Oct 23, 2010 10:09 pm
by pasdesignal
Thank you.
It works a treat! Now I have mpd running and waiting for my commands everytime I power on.
AWESOME!