Changes

Jump to: navigation, search

NAD710 Lab 6

192 bytes added, 09:53, 18 March 2009
Questions
= Procedure =
== Hareware Hardware Requirements==
You need two Linux computers for this lab. One system as an NFS server and the other as an NFS client.
We are going to refer the NFS server machine as SERVER and the NFS client machine as HOST.
* Login to the SERVER as a regular user (joker if you are working in lab T2107).
* Open a terminal window and switch to super user with the command "su -"
* Enter the command <pre>rcpinfo rpcinfo -p</pre>* Study the output, especially the first few output lines. You should see a few lines that ended with the word "portmapper". If you did do not see such lines, or you got get something like "rpcinfo: can't contact portmapper: ...", then "portmapper" is not running. Try the command "service portmap start" and run the "rpcinfo -p" command again.
* Once you have portmapper running, start the NFS server with the command "service nfs start".
* Run the "rpcinfo -p" command again, compare the output with the output of the previous command and note the difference. You should see lines ended with nfs, nlockmgr, mountd, etc.
* Create a directory called "/nfs-pub" and set the read/write/list premission for all (chmod 777).
* Set the sticky bit on the directory "/nfs-pub" (chmod +t /nfs-pub).
* Modify the /etc/exports file and add the following line to it, but replace the place holder "ip-of-host" with your HOST's actual IP address.:
/nfs-pub ip-of-host(rw,root_squash)
** /nfs-pub: directory on the NFS server to be shared
** ip-of-host: IP address or host name of the machine which is allowed to mount the share dierctory
** (rw,root_squash): nfs export options
* Run the command "exportfs -a" to tell your NFS server to re-read the configuration file (/etc/exports) and take appropriate actions, i.e. share the directory "/nfs-pub" to the machine specified.
* Enter the command "showmount -e". Read the man page to learn more about the "showmount" command.
* Boot up another Linux machine. If you are doing this lab in T2107, please boot to Fedora Core 8.
* Login to the HOST as a regular user (joker if you are working in lab T2107).
* Open a terminal window and swith switch to super user with the command "su -"* Enter the command <pre>rcpinfo rpcinfo -p</pre>* If the portmapper is running, you can turn it off with the command "service portmap stop".(You do not need portmapper running on the NFS client machine.)* On the NFS client machine, you need the NFS virtual file system driver in order to be able to access the exported directory on the NFS server. Most Linux system compiled the NFS file system driver as a Loadable Kernel module. Try the following command to check whether the NFS file system module has been installed:
[root@localhost root]# cat /proc/filesystems | grep nfs
* If the command produces no output, use the following command to load the nfs module:
[root@localhost root]# mount -t nfs ip-of-SERVER:/nfs-pub /nfs-mnt
* Use the command "df" and "mount" to check the NFS mounted directory. Record and compare the output of the "df" and "mount" commands.
 
== The ownership of new files created on NFS share==
* While you are still running the root shell on the NFS client machine (HOST), execute the following file copy command:
* On the HOST, re-mount the exported directory.
* While running the root shell, run the following command:
[root@localhost root]# cp /etc/host hosts /nfs-mnt/host-ro.root
* check and record the result for later use.
# What information is provided by the "showmount -e" command?
# What is the location (path name) of the Loadable Kernel Module of the NFS file system driver?
# Who is the owner of the files /nfs-mnt/passwd.c-root and /nfs-pub/passwd.c-root? Are Do thet have the same owner? If not, why not?
# Who is the owner of the files /nfs-mnt/passwd.joker-s and /nfs-pub/passwd.joker-s?
# Who is the owner of the files /nfs-mnt/passwd.joker-c and /nfs-pub/passwd.joker-c?
1
edit

Navigation menu