« less than five days, now | Home | relax, grin: let the changes in »
May 19, 2007
BSDelicious, or: how i learned to stop worrying and love the NFS
for several weeks now the mac has been driving me nuts, as, i think, happens to all mac owners after a while. i loves me my lovely mac, with its shiny pretty interface and its gorgeous bash shell underneath, but damnsit, once in a while...
i have some mp3s sitting on an openbsd machine, lots of them. some of them are very poorly sorted. they are/were exported via samba and the mac mounted the samba shares and i could play with my files via the finder. this was all well and good until one day i encountered a strange problem.
i was creating directories, named "1", "2", "3", and so on, and dragging mp3s into those dirs as is my way. after a small number of dirs had been created, say, 4, suddenly they all took on the name of one of the dirs -- they all became "4" in the finder window, and looking in any of them, i could see only the contents of "4". via hte bash shell, all was as it should have been, but via the finder, i had 4 copies of "4". i did various things on my windows laptop to verify that this was a finder problem.
so i figured that perhaps switching to nfs would alleviate the problem, after all, smb + mac? ms + apple? no thanks. so i went about setting up nfs (again), which should be no problem (right?) because i've done it before between the very same machines.
mounting the shares was easy. mount -t nfs eris:/opt/mp3 mp3.
oh no, not that easy.
sudo mount -t nfs -o resvport eris:/opt/mp3 mp3
that's more like it! stupid low-port-requiring-openbsd-nfs-server-that-can't-be-configured-to-accept-user-ports! okay, on to the writable share.
that's where the fun began. nothing bar nothing worked. not at all. i fiddled with options in /etc/exports (and dammit, there really *aren't* many options there!) and fiddled with options to mount_nfs (and there aren't many options *there* either!) and nothing worked. i created a user on the openbsd box with the same uid as my mac user, i tried writing as root, as my user, i changed permissions six ways from sunday, i did many things i can't even remember because by this point i'd had my third stout.
nfs configuration can only be comprehended under the influence. once i'd gotten that third stout in me, i wondered: what if I did something only a drunken idiot would do?
so i deleted a perfectly good line from /etc/exports, one that referred to a perfectly good existing directory on eris, and rebooted (too lazy to do the kill -HUP stuff).
the drunken idiot approach, as always, worked. removing a supposedly harmless, well-formed line from /etc/exports allowed me to write on the totally unrelated writable export. huh?
whatever.
at this point i was ready to attend to the mess of setting the nfs shares to automount on the mac. of course, this is where the *real* fun begins -- there's no real documenttion of this, just blog posts from 2 years and 3 OS versions ago. sigh.
and hence this blog post: if i ever must do it again, i have this for my cruddy reference, though i must punish myself with sloging through all this gunk to get to the point.
which is this:
netinfo
mounts
new dir
name = eris:/opt/mp3
type = nfs
dir = /Network/Servers/ (dont forget the trailing / or unexpected crap will happen!)
opts = resvport,net,tcp
that's it (hah! two seconds typing, twenty minutes trying).
tcp, i found out, is necessary because importing hte mp3s thus mounted thru itunes with nfs/udp causes itunes to barf when the udp packets don't show up. what?! udp packets not showing up over a wireless network? unheard of! how could that possibly happen? surely we have no recourse other than to give up!
in any case, nfs/tcp seems to be working, and maybe even a little faster than smb, probably because i had previously applied hte following to improve speed on smb:
echo "net.inet.tcp.delayed_ack=0" >> /etc/sysctl
really, switching between songs is snappy, browsing dirs seems faster than smb, and it's all unixy goodness. feel the love!
still, itunes is a slow beast and it took all night to import all my mp3s. i went to bed and woke up and went to see if i'd fixed the stupid folder renaming problem.
i had not.
ARRRRRRRRRRGGGGGHHHH!!!!
i spent a drunken evening installing nfs instead of installing my own filesystem in 203s network. and nothing to show for it!
(she did refer to the indian restaurant we visited last week as "darfur" which i found hilarious, and aptly descriptive of their mediocre food)
so, back to work.
google, usenet, apple.com : no help at all finding this problem. it seemed i was the only one who had it.
i decided to think like a drunken idiot, again, this time without the aid of actual alcohol. what if i was a retard working at apple, what would it take for me to screw things up?
maybe this "finder turd" .DS_Store file had something to do with it? i deleted the .DS_Store files under hte dir i was browsing and browsed some more. no help. still the folders shimmied and danced.
what if i disabled .DS_Store on network drives altogether? i dont need them, they screw up soem of my scripts, and they bug me.
so, i ran:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
and rebooted.
wonder of wonders, miracle of miracles! that seems to have done it!!
why the stupid DS_Store files should screw finder up so badly is beyond me -- perhaps it had failed a permissions check and couldn't write one, and that hosed it permanently internally, i have no idea. but after a whole lot of messign about, after coming this close: | | to installing freebsd, partly in hopes it would fix the problem, partly in hopes that i'd get to install freebsd and thus have 3 different bsds online in my house, after skipping my morning pee to write this boring post, i solved the irritating problem and ended up with a slightly faster mp3 network.
now i'll go buy myself a squeezebox and throw all my work away.
Leave a comment