|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +status: publish |
| 4 | +published: true |
| 5 | +title: Configuring NFS on Fonera 2.0n |
| 6 | +author: |
| 7 | + display_name: Sudesh Jethoe |
| 8 | + login: sudeshjethoe |
| 9 | + |
| 10 | + url: '' |
| 11 | +author_login: sudeshjethoe |
| 12 | + |
| 13 | +wordpress_id: 11 |
| 14 | +wordpress_url: http://sudeshjethoe.wordpress.com/?p=11 |
| 15 | +date: '2012-01-06 02:08:11 +0100' |
| 16 | +date_gmt: '2012-01-06 02:08:11 +0100' |
| 17 | +categories: |
| 18 | +- Uncategorized |
| 19 | +- linux |
| 20 | +tags: |
| 21 | +- linux |
| 22 | +- fon |
| 23 | +- nfs |
| 24 | +- nfs3 |
| 25 | +comments: [] |
| 26 | +--- |
| 27 | +<p>1. Install nfs: 'opkg install unfs3'<br /> |
| 28 | +2:Edit hosts.deny:<br /> |
| 29 | +echo 'ALL: ALL' > /etc/hosts.deny<br /> |
| 30 | +3:Edit hosts.allow:<br /> |
| 31 | +echo '192.168.1.' > /etc/hosts.allow<br /> |
| 32 | +4:Edit /etc/exports (with vi and enter):<br /> |
| 33 | +/tmp/mounts/Disc-A1/music (ro,async,insecure,root_squash,proto=udp,anonuid=65534,anongid=65534)<br /> |
| 34 | +/tmp/mounts/Disc-A1/videos (ro,async,insecure,root_squash,proto=udp,anonuid=65534,anongid=65534)<br /> |
| 35 | +/tmp/mounts/Disc-A1/pictures (ro,async,insecure,root_squash,proto=udp,anonuid=65534,anongid=65534)<br /> |
| 36 | +/tmp/mounts/Disc-A1/my_home (rw,sync,secure,root_squash,proto=tcp,anonuid=65534,anongid=65534)</p> |
| 37 | +<p>5: Start service:<br /> |
| 38 | +/etc/init.d/portmap start && sleep 3 && /etc/init.d/unfs3 start</p> |
| 39 | +<p>6: Enable on reboot:<br /> |
| 40 | +/etc/init.d/portmap enable && /etc/init.d/unfs3 enable</p> |
| 41 | +<p>Explain:<br /> |
| 42 | +allow > deny<br /> |
| 43 | +ro: read only<br /> |
| 44 | +async: unsafe, no file locking but faster<br /> |
| 45 | +insecure: allow ports over 1024 to connect<br /> |
| 46 | +root_squash: remote root is converted to anonuid+anongid<br /> |
| 47 | +anonuid: server uid of anonymous user<br /> |
| 48 | +anongid: server gid of anonymous user</p> |
| 49 | +<p>uid's and gid's are mapped one to one (possible security risk)</p> |
| 50 | +<p>*http://wiki.fon.com/wiki/F2_NFS</p> |
| 51 | +<p>Now for pure awesomeness enable automount* on your client:<br /> |
| 52 | +Easy as: 'yum install autofs'<br /> |
| 53 | +And add the following too</p> |
| 54 | +<blockquote><p>/etc/auto.misc >>:<br /> |
| 55 | +# local entries<br /> |
| 56 | +fon-svjethoe -fstype=nfs,rw,tcp,rsize=32768,wsize=32768 fonera:/tmp/mounts/Disc-A1/svjethoe<br /> |
| 57 | +fon-music -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/music<br /> |
| 58 | +fon-pictures -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/pictures<br /> |
| 59 | +fon-videos -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/videos</p> |
| 60 | +<p># vpn entries<br /> |
| 61 | +fon-svjethoe -fstype=nfs,rw,tcp,rsize=32768,wsize=32768 10.8.0.1:/tmp/mounts/Disc-A1/svjethoe<br /> |
| 62 | +fon-music -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/music<br /> |
| 63 | +fon-pictures -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/pictures<br /> |
| 64 | +fon-videos -fstype=nfs,rsize=32768,wsize=32768 :/tmp/mounts/Disc-A1/videos</p></blockquote> |
| 65 | +<p>Now the folders will be automatically mounted when accessed (defaults under /misc ->)<br /> |
| 66 | +rsize= transfer block size for reads in bytes (=32bytes=max=nfs4 default)<br /> |
| 67 | +wsize= transfer block size for writes in bytes ( "" """" "")<br /> |
| 68 | +default rsize+wsize in nfs3= 8 bytes</p> |
| 69 | +<p>Just run 'cd /misc/fon-music' and you're there!</p> |
| 70 | +<p>http://fedoraproject.org/wiki/Administration_Guide_Draft/NFS</p> |
0 commit comments