20 lines or less to NFS !


I was looking through the Linux Magazine links on facebook again and came across another nifty little topic that is fairly usable in almost every scenario, NFS.  I thought it was funny that I found several blog postings that had lots of replies that the steps outlined didn’t work !  I know I am a stickler, but see I told you that was the case… this one is functional on CentOS v5.5… So in less than 20 lines, you can share all day on your Linux boxes…

# Server-side:
yum install -y nfs-utils nfs-utils-lib
echo “/home/software 192.168.11.141(rw,sync)” >> /etc/exports
echo “/home/scripts 192.168.11.141(rw,sync)” >> /etc/exports
echo “portmap: 192.168.11.0/255.255.255.0” >> /etc/hosts.allow
exportfs -a -v
for i in nfs portmap; do chkconfig $i on; done
for i in tcp udp; do iptables -A INPUT -p $i -m $i -m multiport –dports 1110,2049 -j ACCEPT; done
iptables-save > /etc/sysconfig/iptables
service portmap start
service nfs start
#
# Client-side:
service portmap start
chkconfig portmap on
cd /
mkdir fx6-share
mount 192.168.11.64:/home/software /fx6-share
# Make it stick:
echo “192.168.11.64:/home/software /fx6-share         nfs     defaults        0 0” >> /etc/fstab
echo “192.168.11.64:/home/scripts /fx6-scripts         nfs     defaults        0 0” >> /etc/fstab
mount -a
# EOF

Advertisements

, , , , , , ,

  1. #1 by gmconklin on June 9, 2010 - 5:00 pm

    I just noticed that this is now my 2nd (in a row no less) post of a “20 lines or less” script… LOL Maybe I am on to something here… I will now challenge myself to keep this one going and also try to go back and re-do all the rest in this fashion… that should be interesting 🙂

  1. Tweets that mention 20 lines or less to NFS ! « A Technological Farce -- Topsy.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: