Posted by: isaraffee | August 10, 2009

Configuring NFS in Sabayon Linux

Configuring NFS in Sabayon

The following commands show that nfs client snd server are not running.

sabayonx86 ~ # ps -ef|grep nfsd

Now check if portmap is running:

sabayonx86 ~ # ps -ef|grep portmap

rpc 10999 1 0 14:18 ? 00:00:00 /sbin/portmap

root 14119 12833 0 15:02 pts/1 00:00:00 grep portmap

Yes, it’s running.

Let’s check out where the nfs scripts are located.

sabayonx86 ~ # cd /etc/init.d

Now let’s start the nfsd service.

sabayonx86 init.d # ./nfs start

* Mounting nfsd filesystem in /proc … [ ok ]

* Mounting RPC pipefs … [ ok ]

* Starting idmapd … [ ok ]

* Starting gssd … [ ok ]

* Starting svcgssd … [ !! ]

* Starting NFS statd … [ ok ]

* Starting NFS daemon … [ ok ]

  • Starting NFS mountd … [ ok ]

Check that the nfs service is running:

sabayonx86 init.d # ps -ef|grep nfs

root 2290 6 0 14:17 ? 00:00:00 [unionfs_siod/0]

root 14308 6 0 15:05 ? 00:00:00 [nfsd4]

root 14311 1 0 15:05 ? 00:00:00 [nfsd]

root 14312 1 0 15:05 ? 00:00:00 [nfsd]

root 14313 1 0 15:05 ? 00:00:00 [nfsd]

root 14314 1 0 15:05 ? 00:00:00 [nfsd]

root 14315 1 0 15:05 ? 00:00:00 [nfsd]

root 14316 1 0 15:05 ? 00:00:00 [nfsd]

root 14317 1 0 15:05 ? 00:00:00 [nfsd]

root 14318 1 0 15:05 ? 00:00:00 [nfsd]

The first line is not a nfs service, but a unionfs service.

Configuring the NFS server

In this example, Sabayon is configured as a NFS server while our NFS client will be another box running Ubuntu. Before this execise, make sure that both hosts are able to ping to each other.

In the NFS server, we need to configure the /etc/exports file in order to share the directories and files to the other NFS clients.

So, let’s view the file.

sabayonx86 init.d # more /etc/exports

# /etc/exports: NFS file systems being exported. See exports(5).

It seems that no directories have been exported or shared. Let’s create a directory called /root/Desktop/Topmovies and in the directory create a file called Alltosee.txt. Write something in the file.

sabayonx86 ~ # mkdir /root/Desktop/Topmovies

sabayonx86 ~ # cd Desktop/Topmovies/

sabayonx86 Topmovies # pwd

/root/Desktop/Topmovies

sabayonx86 Topmovies # vi Alltosee.txt

Use vi or any editor to make the /etc/exports file look like this:

sabayonx86 init.d # vi /etc/exports

/root/Desktop/Alltosee.txt 172.18.0.3 (rw)

The ip address here is the NFS client

After you have saved the file, you will have to re-export the NFS directories.

abayonx86 init.d # exportfs -rv

exportfs: No options for /root/Desktop/Alltosee.txt 172.18.0.3: suggest 172.18.0.3(sync) to avoid warning

exportfs: /etc/exports [1]: Neither ‘subtree_check’ or ‘no_subtree_check’ specified for export “172.18.0.3:/root/Desktop/Alltosee.txt”.

Assuming default behaviour (‘subtree_check’).

NOTE: this default will change with nfs-utils version 1.1.0

exportfs: No host name given with /root/Desktop/Alltosee.txt (rw), suggest *(rw) to avoid warning

exportfs: /etc/exports [1]: Neither ‘subtree_check’ or ‘no_subtree_check’ specified for export “*:/root/Desktop/Alltosee.txt”.

Assuming default behaviour (‘subtree_check’).

NOTE: this default will change with nfs-utils version 1.1.0

exporting 172.18.0.3:/root/Desktop/Alltosee.txt

exporting *:/root/Desktop/Alltosee.txt

On the NFS client

Now let’s configure the NFS client.

Create a directory called /nfs/moviereviews

root@ismailrocks:~# mkdir -p /nfs/moviereviews

Author’s notes:Need to check this–>Also check that for the NFS client, the nfsd need not be running because it is NFS client and not a NFS server. Portmap is also not required.

root@ismailrocks:~# ps -ef|grep portmap

root 15341 15254 0 15:29 pts/2 00:00:00 grep portmap

root@ismailrocks:~# ps -ef|grep nfsd

root 15346 15254 0 15:29 pts/2 00:00:00 grep nfsd

Author’s notes: The Ubuntu box does not have nfs package. Thus NFS exercise could not be continued. Author need to install the NFS package from the repositories.

Advertisements

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

Categories

%d bloggers like this: