"How can SB reconnect to nfs when it reboots?"
I think we can add the entry to /etc/fstab (I haven't tried yet). Sole problem: if nfs is not present, SB may not boot, unless one uses "nofail" (but this option is buggy, i.e. is ignored, on some distros).
BTW, I have a related question: "How can SB reconnect to nfs when the NFS server reboots?" For me it's a bigger problem: SB almost never reboots, but I plan to shut down my nfs server from time to time. autonfs could be a solution. But there's another problem: what if at some point SB cannot connect, thinks /media/sda1/MyLibrary mount point is empty, thus erases the database? Then it needs to rescan once nfs is recovered... Not very optimal...
I'm in the process of implementing/testing all this. Suggestions from anybody are welcome!
Results 21 to 26 of 26
-
2010-10-24, 06:35 #21Junior Member
- Join Date
- Oct 2010
- Posts
- 3
-
2010-10-31, 13:30 #22Senior Member
- Join Date
- Apr 2008
- Location
- Paris, France
- Posts
- 1,466
If the server goes down on you, you're in serious trouble. The only way around that is not mounting... Use an automounter and dismount when possible, after a short delay like 5 minutes.
Then on the server side, detect if there is a mount or not. Refrain from going down if there is a mount (or other measurable NFS activity). Server unfs3d is slower but easier to monitor. It shows opened files via lsof, when the kernel server does not.
On the client side, you can send a WOL packet to the server within the mount request (using an exec map). Or, slower but more reliable, send wol packets when NFS retries start piling up. Usually the reason for the mount to fail is the server sleeping.
I've been using this kind of setup for a good deal of time on AppleTVs, clients to a linux server. It's been working pretty well. Almost zero lockups. Sequence "try mount>errors>wol>mount" is not fast, but very robust. If you can somehow anticipate the wake of the server in addition to that defensive scheme, you could have a swift system. Beware of the client-side cache, and make sure to set negative caching to 0.
The AppleTv has 256MB RAM, and I had no issue running an automounter and the NFS+WOL monitor on top of it.
Using an automounter will also ease your mounting-at-boot issues, most certainly.
HTHLast edited by epoch1970; 2010-10-31 at 13:40.
4 SB 3 • iPeng (iPhone + iPad) • SqueezeLite • Squeezebox Server 7.6.2 (Debian 6.0) with plugins: CD Player, WaveInput by bpa • IRBlaster by Gwendesign (Felix) • Server Power Control by Gordon Harris • Smart Mix by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • Just Covers by Tom Kalmijn • WeatherTime by Martin Rehfeld • Local Player, BBC iPlayer, SwitchPlayer by Triode • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.
-
2010-11-02, 16:44 #23Member
- Join Date
- Jan 2008
- Posts
- 34
I'm trying to do this, too. After a few tries this seems to work. Here are some more details.
I inserted a usb stick in Touch and /media/sda1 appeared mounted.
I made a mount point on the usb stick
and did an nfs mount thereCode:mkdir /media/sda1/music
Putting the moint point on the usb lets the Touch write to the usb rather than the nfs share which I prefer to export wo. This seems like a good idea?Code:mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,nolock 192.168.1.3:/music/music/24-96 /media/sda1/music
Then I restarted the squeezecenter
It seems to have scanned and be working.Code:/etc/init.d/squeezecenter restart
I mounted a directory of 24/96 and it's playing fine. Any ideas on how the Touch squeezecenter will handle ~50K songs?Last edited by mkt; 2010-11-03 at 05:17.
-
2012-01-06, 20:20 #24Member
- Join Date
- Dec 2009
- Posts
- 70
Sorry to drag this up again, but I just found a version of tomato-firmware for my router that allows me to export nfs from the attached router hard disk.
so what became of testing for this? will it retain entries made in fstab, and is it best to use a local usb stick in the touch as the cache point (or sd card) what happens when the sd/usb is removed?
Better yet, is there a way to load all this onto a local usb stick/sd so it will access a remote nfs share when the stick is inserted, but default to the normal SqueezeOS behavior when the local sd/usb is removed?
-
2012-01-16, 09:57 #25Member
- Join Date
- Dec 2009
- Posts
- 70
Mmmm, maybe I'm just too linux-stupid, but I keep getting "bad file descriptor". Am I mounting the wrong directories? Anyone tried mounting to the SD card?
I'm trying:
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,no lock 192.168.1.150:/music /media/mmcblk0p1/music
also, I don't have a restart command there, just 'reboot' in the 'sbin' directory... have things changed in the operating system?
-
2012-01-16, 19:35 #26Member
- Join Date
- Dec 2009
- Posts
- 70
I seem to have figured out the host side better. Now I'm trying:
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,no lock 192.168.1.1:/music /media/mmcblk0p1/music
or
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,no lock 192.168.1.1:/mnt/music /media/mmcblk0p1/music
Still with no luck, and keep getting bad file descriptor errors.
I can see 192.168.1.1 exporting /mnt/music with another client program so I know its there.
Can anyone decipher what is happening?

Reply With Quote


