This is a detailed set of instructions (partly for my own future reference) on setting up mounted NFS folders on the Nokia N810 tablet.

Before we get started, this article makes a couple assumptions. First, that you already have a directory setup on a different computer as an NFS share. Second, that you've already got 'sudo gainroot' enabled. I don't recall exactly how I did that... but I believe it had something to do with taking the red pill (seriously, I'm not a big enough fan of that movie to make those kind of jokes, but obviously somebody at Nokia is). Also, I highly advise that before you do anything you make sure you can SSH into your device directly as root. In doing this myself I screwed up the sudoers file and couldn't 'gainroot' on the device anymore (meaning I couldn't even fix what I broke). Being able to SSH to the device allowed me to fix the file and saved me from having the reflash the OS and reinstall everything from scratch. If any of this scares you, take my advice and leave now. This is the deep end of the pool and there are no lifeguards on duty.

Ok, still here? That's too bad. I assume no responsibility for what you're about to try to do. If you do really, really screw up though, just download a new image of the OS from maemo.org and reflash the device and it should be good as new. Moving along.

First, from your xterm, type sudo gainroot, or just SSH to the device as root from a computer with a full size keyboard. cd to /etc, and open the 'sudoers' file in vi (maemo doesn't appear to come with emacs, so you may be stuck with vi). Add the following two lines to the very end of the file.

user ALL = NOPASSWD: /bin/mount -t nfs <remote_ip>\:/remote/path /mnt/mount_point
user ALL = NOPASSWD: /bin/umount /mnt/mount_point

Pay special attention to the '\:' in the first line, that backslash is important.

Next, create a file in /etc/rc2.d called 'S99mountmods' and add the following lines to it.

#! /bin/sh
insmod /lib/modules/2.6.21-omap1/extra/sunrpc.ko
insmod /lib/modules/2.6.21-omap1/extra/lockd.ko
insmod /lib/modules/2.6.21-omap1/extra/nfs.ko

Ok, now create your mount_point directory if you haven't already and go back to being a regular user for the rest of this.

The next few steps are a little more complicated than they probably need to be, but this job calls for aliases, and I prefer to always keep my aliases in their own .aliases file in my home directory. Here's how I figured out how to do that on the N810.

First, create a .profile file in your home directory, with the following lines...

ENV=$HOME/.ashrc
export ENV

Now, create a .ashrc file in the same place, with the line source ~/.aliases.

Alright, now we're ready for the .aliases file. You don't really need the first line unless you want to create more aliases easily and want to do it the same way I do. Otherwise, you can safely ignore it. You can also name the aliases anything you want, as long as you remember what the names are when you need to use them.

alias ea='vi ~/.aliases; source ~/.aliases'
alias umntr='sudo umount /mnt/mount_point'
alias mntr='sudo mount -t nfs :/remote/path /mnt/mount_point'

And that should be it. Reboot the device, and from xterm as the normal user run 'mntr'. It should pause for a moment and then go right back to the command prompt without any messages. You should now be able to cd into the mount point folder and see files from the remote machine as if that terrabyte drive were directly on your handheld device. Hopefully you got all the way through that without bricking your device. If not, well, don't say I didn't warn you earlier.

It should also be noted that next time you flash an OS upgrade onto the tablet, you'll probably have to do much of this all over again, so bookmark this page now.

Comments: 0 [add comment]