Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which Option Is Used With Exportfs Command To Display The Current Export List, Also Displays The List Of Export Options?

Answer»

EXPORTFS -V

exportfs -v

2.

Can We Grant Access By Username And Password For Nfs Share?

Answer»

No, ACCESS is GRANTED only for IP ADDRESS.

No, access is granted only for IP address.

3.

What Is Different Between Nfs Version 2 & 3 ?

Answer»

nfs 2 default 8kb transfer rate,it did not check the AUTHENTICATION at the time connection.client wants to ACCESS UNAUTHORIZED file it shows error messages like “write error”,”read error” nfs 3 32kb transfer rate. It check at the time connection- ACL Support

nfs 2 default 8kb transfer rate,it did not check the authentication at the time connection.client wants to access unauthorized file it shows error messages like “write error”,”read error” nfs 3 32kb transfer rate. It check at the time connection- ACL Support

4.

What Is The Role Of “rmtab” File For Nfs Server?

Answer»

For every mount request received from an NFS client, rpc.mountd adds an ENTRY to the /var/lib/nfs/rmtab FILE.

When RECEIVING an unmount request, that entry is REMOVED.

 

For every mount request received from an NFS client, rpc.mountd adds an entry to the /var/lib/nfs/rmtab file.

When receiving an unmount request, that entry is removed.

 

5.

Which Nfs Versions Are Available?

Answer»

6.

What Is Nfs ?

Answer»

NFS stands for Network File System. NFS was ORIGINALLY developed by Sun Microsystems in the 1980’s. NFS allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to CONSOLIDATE resources onto CENTRALIZED SERVERS on the network.

NFS stands for Network File System. NFS was originally developed by Sun Microsystems in the 1980’s. NFS allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network.

7.

Explain “hard Mounting” Option At Nfs Client?

Answer»

If a file request FAILS, the NFS CLIENT will report an error to the process on the client machine REQUESTING the file ACCESS. if it cannot be satisfied, then it will not quit until the request is satisfied. This is called Hard mounting.

If a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied, then it will not quit until the request is satisfied. This is called Hard mounting.

8.

Explain “soft Mounting” Option At Nfs Client?

Answer»

If a file request fails, the NFS client will report an error to the process on the client MACHINE requesting the file access. if it cannot be SATISFIED (for EXAMPLE, the server is down), then it quits. This is called soft mounting.

If a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied (for example, the server is down), then it quits. This is called soft mounting.

9.

What Is Meaning Of “no_root_squash” Option ?

Answer»

Treat remote ROOT user as local root. Do not map REQUESTS from root to the ANONYMOUS user and group ID.

Treat remote root user as local root. Do not map requests from root to the anonymous user and group ID.

10.

Explain “exportfs” Command?

Answer»

The exportfs command is used to MAINTAIN the current table of exported FILE SYSTEMS for NFS.

The exportfs command is used to maintain the current table of exported file systems for NFS.

11.

Explain Option “all_squash”?

Answer»

The UID and GID of exported FILES are mapped to the user anonymous. It is GOOD for public DIRECTORIES.

The UID and GID of exported files are mapped to the user anonymous. It is good for public directories.

12.

Name Of Configuration File For Nfs Server ?

Answer»

/etc/exports

/etc/exports

13.

Explain The Working Of Nfs Mount Daemon “rpc.mountd”?

Answer»

The rpc.mountd PROGRAM IMPLEMENTS the NFS mount PROTOCOL. When RECEIVING a MOUNT request from an NFS client, it checks the request against the list of currently exported file systems. If the client is permitted to mount the file system, rpc.mountd obtains a file handle for requested DIRECTORY and returns it to the client.

The rpc.mountd program implements the NFS mount protocol. When receiving a MOUNT request from an NFS client, it checks the request against the list of currently exported file systems. If the client is permitted to mount the file system, rpc.mountd obtains a file handle for requested directory and returns it to the client.

14.

Which Kernel Module Is Used By “rpc.nfsd”?

Answer»

nfsd.o KERNEL MODULE

nfsd.o kernel module

15.

How To Retrieve A List Of Clients Connected To The Nfs Server ?

Answer»

To RETRIEVE a LIST of clients connected to the NFS server, use the showmount command from a SHELL PROMPT. To also SHOW the directories the clients are connected to, use the showmount -a command.

To retrieve a list of clients connected to the NFS server, use the showmount command from a shell prompt. To also show the directories the clients are connected to, use the showmount -a command.

16.

Can Nfs Share Mounted On Window Xp And Justify Your Answer?

Answer»

No, Window XP OPERATING system doesn’t support NFS protocol.

No, Window XP operating system doesn’t support nfs protocol.

17.

What Do You Understand By “nfsstat –nfs –server -3″ Command?

Answer»

It will show statistics for NFS VERSION 3 server.

It will show statistics for NFS version 3 server.

18.

What Is The Role Of “sync” Option For Nfs Server?

Answer»

If sync is specified, the server waits until the request is WRITTEN to disk before responding to the client. The sync OPTION is recommended because it FOLLOWS the NFS PROTOCOL.

If sync is specified, the server waits until the request is written to disk before responding to the client. The sync option is recommended because it follows the NFS protocol.

19.

What Is “portmap”?

Answer»

The portmapper KEEPS a list of what SERVICES are RUNNING on what ports. This list is used by a connecting machine to see what ports it WANTS to TALK to access certain services.

The portmapper keeps a list of what services are running on what ports. This list is used by a connecting machine to see what ports it wants to talk to access certain services.

20.

What Will Happened If A Space Is Given In Between Allowed_hosts And (options)

Answer»

If a SPACE is included, the options are APPLIED to any and all IP addresses, which can be quite DANGEROUS if write permission is GRANTED.

If a space is included, the options are applied to any and all IP addresses, which can be quite dangerous if write permission is granted.

21.

192.168.1.51:/data Is Exported By Nfs Server And I Want To Add This Nfs Share To Client /etc/fstab File. How You Will Add This Entry In /etc/fstab File?

Answer»

# device mount-point fs-type OPTIONS DUMP fsckorder
192.168.1.51:/data /MNT NFS rw 0 0

# device mount-point fs-type options dump fsckorder
192.168.1.51:/data /mnt nfs rw 0 0

22.

Explain This Entry /shared 192.168.1.0/255.255.255.0(sync,rw)?

Answer»

Allows all SYSTEMS with 192.168.1.* IP addresses read-write access to the /SHARED/ DIRECTORY:

Allows all systems with 192.168.1.* IP addresses read-write access to the /shared/ directory:

23.

What Are The Services Required On Nfs Client And Nfs Servers ?

Answer»

NFS*, rpcbind*, xinetd*

nfs*, rpcbind*, xinetd*

24.

How To Mount The Nfs Shared File System In Client?

Answer»

To MOUNT NFS SHARE on the CLIENT USE below command :

# mount -t nfs IP_of_NFS_Server:/NFS_Share_Name /mount_point

E.g. 
# mount -t nfs nfs.linuxtechi.com:/nfs_data /mnt/data

To Mount NFS share on the Client use below command :

# mount -t nfs IP_of_NFS_Server:/NFS_Share_Name /mount_point

E.g. 
# mount -t nfs nfs.linuxtechi.com:/nfs_data /mnt/data

25.

How To Re Export All The Directories Of ‘/etc/exports’ File ?

Answer»

Using the command ‘ EXPORTFS -r’ , we can REEXPORT or refresh ENTRIES of ‘/etc/exports’ file WITHOUT restarting nfs SERVICE

Using the command ‘ exportfs -r’ , we can reexport or refresh entries of ‘/etc/exports’ file without restarting nfs service

26.

What Is Portmap?

Answer»

The portmapper KEEPS a list of what services are running on what PORTS.

This list is USED by a connecting MACHINE to see what ports it wants to TALK to access certain services.

The portmapper keeps a list of what services are running on what ports.

This list is used by a connecting machine to see what ports it wants to talk to access certain services.

27.

How To Check Nfs Server Version ?

Answer»

‘nfsstat -o all’ command SHOWS all INFORMATION about ACTIVE versions of NFS.

‘nfsstat -o all’ command shows all information about active versions of NFS.

28.

How To Check Iostat Of Nfs Mount Points ?

Answer»

Using command ‘nfsiostat‘ we can list iostat of nfs mount points. USE the below command :

# nfsiostat <interval> <count> <mount_point>

  • <interval> : specifies the amount of time in seconds between each REPORT. The first report contains statistics for the time since each FILE system was mounted. Each subsequent report contains statistics collected during the interval since the previous report.
  • <count> : If the <count> parameter is specified, the value of <count> determines the number of reports generated at seconds apart. if the interval parameter is specified WITHOUT the <count> parameter, the command generates reports CONTINUOUSLY.
  • <mount_point> : If one or more <mount point> names are specified, statistics for only these mount points will be displayed. Otherwise, all NFS mount points on the client are listed.

Using command ‘nfsiostat‘ we can list iostat of nfs mount points. Use the below command :

# nfsiostat <interval> <count> <mount_point>

29.

What Is The Difference Between Hard Mount &amp; Soft Mount In Nfs ?

Answer»

Difference between soft mount and HARD mount is listed below :

Soft Mount : Consider we have mounted a NFS share using ‘soft mount’ .When a program or application requests a file from the NFS filesystem, NFS CLIENT daemons will try to retrieve the data from the NFS server. But, if it doesn’t get any response from the NFS server (due to any CRASH or failure of NFS server), the NFS client will report an error to the process on the client machine requesting the file access. The advantage of this mechanism is “fast responsiveness” as it doesn’t wait for the NFS server to respond. But, the main disadvantage of this method is data corruption or loss of data. So, this is not a recommended option to use.

Hard Mount : Suppose we have mounted the NFS share using hard mount, it will repeatedly retry to contact the server. Once the server is BACK online the program will continue to execute undisturbed from the state where it was during server crash. We can use the mount option “intr” which ALLOWS NFS requests to be interrupted if the server goes down or cannot be reached. Hence the recommended settings are hard and intr options.

Difference between soft mount and hard mount is listed below :

Soft Mount : Consider we have mounted a NFS share using ‘soft mount’ .When a program or application requests a file from the NFS filesystem, NFS client daemons will try to retrieve the data from the NFS server. But, if it doesn’t get any response from the NFS server (due to any crash or failure of NFS server), the NFS client will report an error to the process on the client machine requesting the file access. The advantage of this mechanism is “fast responsiveness” as it doesn’t wait for the NFS server to respond. But, the main disadvantage of this method is data corruption or loss of data. So, this is not a recommended option to use.

Hard Mount : Suppose we have mounted the NFS share using hard mount, it will repeatedly retry to contact the server. Once the server is back online the program will continue to execute undisturbed from the state where it was during server crash. We can use the mount option “intr” which allows NFS requests to be interrupted if the server goes down or cannot be reached. Hence the recommended settings are hard and intr options.

30.

What Is Pnfs ?

Answer»

Parallel NFS (pNFS) as part of the NFS v4.1 standard is available as of Red Hat Enterprise Linux 6.4. The pNFS ARCHITECTURE improves the scalability of NFS, with possible improvements to performance. That is, when a server IMPLEMENTS pNFS as well, a client is able to access DATA through multiple SERVERS concurrently. It supports three storage protocols or layouts: files, OBJECTS, and blocks.

Parallel NFS (pNFS) as part of the NFS v4.1 standard is available as of Red Hat Enterprise Linux 6.4. The pNFS architecture improves the scalability of NFS, with possible improvements to performance. That is, when a server implements pNFS as well, a client is able to access data through multiple servers concurrently. It supports three storage protocols or layouts: files, objects, and blocks.

31.

How To List Available Nfs Share On Local Machine &amp; Remote Machine ?

Answer»
  • ‘showmount -E localhost’ : Shows the AVAILABLE shares on your local machine
  • ‘showmount -e &LT;Remoteserverip or HOSTNAME>‘: LISTS the available shares at the remote server

32.

What Are Different Options Used In /etc/exports File ?

Answer»

Below are list of options used in /etc/exports file :

  1. ro: The directory is shared read only; the client machine will not be able to write to it. This is the default.
  2. rw: The client machine will have read and write access to the directory.
  3. root_squash: By default, any file request made by user root on the client machine is treated as if it is made by user nobody on the server. (Exactly which UID the request is mapped to depends on the UID of user “nobody” on the server, not the client.)
  4. no_root_squash : if this option is used , then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications, although it may be necessary if you want to perform any administrative work on the client machine that involves the exported directories. You should not specify this option without a good reason.
  5. no_subtree_check : If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.
  6. SYNC : REPLIES to the NFS request only after all data has been written to disk. This is much safer than async, and is the default in all nfsutils versions after 1.0.0.
  7. async : Replies to requests before the data is written to disk. This improves performance, but results in lost data if the server goes down.
  8. no_wdelay : NFS has an optimization algorithm that delays disk writes if NFS deduces a likelihood of a related write request soon arriving. This SAVES disk writes and can speed performance
  9. wdelay : Negation of no_wdelay , this is default
  10. nohide : Normally, if a server exports TWO filesystems one of which is mounted on the other, then the client will have to mount both filesystems explicitly to get access to them. If it just mounts the parent, it will see an empty directory at the place where the other FILESYSTEM is mounted. That filesystem is “hidden”. Setting the nohide option on a filesystem causes it not to be hidden, and an appropriately authorised client will be able to move from the parent to that filesystem without noticing the change.
  11. hide : Negation of nohide This is the default

Below are list of options used in /etc/exports file :

33.

What Are Configuration Files Of Nfs Server ?

Answer»

‘/etc/exports’ is the MAIN configuration FILE that CONTROLS which file SYSTEMS are exported to remote hosts and SPECIFIES options.

‘/etc/sysconfig/nfs‘ is the file through which we can fix ports for RQUOTAD_PORT, MOUNTD_PORT, LOCKD_TCPPORT, LOCKD_UDPPORT and STATD_PORT

‘/etc/exports’ is the main configuration file that controls which file systems are exported to remote hosts and specifies options.

‘/etc/sysconfig/nfs‘ is the file through which we can fix ports for RQUOTAD_PORT, MOUNTD_PORT, LOCKD_TCPPORT, LOCKD_UDPPORT and STATD_PORT

34.

What Are Different Versions Of Nfs Server ?

Answer»

Currently, there are three versions of NFS. NFS version 2 (NFSv2) is older and widely supported. NFS version 3 (NFSv3) supports safe asynchronous writes and is more robust at error handling than NFSv2; it ALSO supports 64bit file sizes and offsets, allowing clients to ACCESS more than 2Gb of file DATA.

NFS version 4 (NFSv4) works through firewalls and on the Internet, no longer requires an rpcbind service, supports ACLs, and utilizes stateful operations. Red Hat Enterprise Linux 6.X & Centos 6.X supports NFSv2, NFSv3, and NFSv4 clients. When mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv4 by default, if the server supports it.

Currently, there are three versions of NFS. NFS version 2 (NFSv2) is older and widely supported. NFS version 3 (NFSv3) supports safe asynchronous writes and is more robust at error handling than NFSv2; it also supports 64bit file sizes and offsets, allowing clients to access more than 2Gb of file data.

NFS version 4 (NFSv4) works through firewalls and on the Internet, no longer requires an rpcbind service, supports ACLs, and utilizes stateful operations. Red Hat Enterprise Linux 6.X & Centos 6.X supports NFSv2, NFSv3, and NFSv4 clients. When mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv4 by default, if the server supports it.

35.

What Is The Default Port Of Nfs Server ?

Answer»

By DEFAULT NFS USES 2049 TCP PORT.

By default NFS uses 2049 TCP port.

36.

Why To Use Nfs ?

Answer»

A Network File System (NFS) allows remote machine to mount file SYSTEMS over a network and interact with those file systems as though they are mounted LOCALLY. This enables system ADMINISTRATORS to CONSOLIDATE resources onto CENTRALIZED servers over the network.

A Network File System (NFS) allows remote machine to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers over the network.

37.

Which Option Is Used With Exportfs Command To Re-export All Directories?

Answer»

EXPORTFS -R

exportfs -r

38.

What Is The Role Of “all_squash” Option?

Answer»

 Treat all CLIENT USERS as anonymous users. MAP all user and group IDS to the anonymous user and group ID.

 Treat all client users as anonymous users. Map all user and group IDs to the anonymous user and group ID.

39.

Explain Command “/usr/sbin/exportfs -f”?

Answer»

It will flush everything out of the kernels export table. Any clients that are active will GET new entries ADDED by mountd when they MAKE their NEXT REQUEST.

It will flush everything out of the kernels export table. Any clients that are active will get new entries added by mountd when they make their next request.

40.

What Do You Understand By “nfsstat -o All -234” Command?

Answer»

41.

What Do You Understand By “nfsstat –nfs –server -3” Command?

Answer»

It will SHOW STATISTICS for NFS version 3 SERVER.

It will show statistics for NFS version 3 server.

42.

How You Will Check “portmap” Service Is Running Or Not?

Answer»

<P>rpcinfo -p

rpcinfo -p

43.

I Am Unable To Mount A Nfs Share. How Will You Trace Out The Reason?

Answer»

<P>Firstly, check that you have PERMISSIONS to mount nfs share or not. Check /etc/exports file.

Secondly you can get RPC ERROR: Program Not Registered (or another “RPC” error)

For this check your NFS server and portmap service RUNNING or not by “rpcinfo -p”

Firstly, check that you have permissions to mount nfs share or not. Check /etc/exports file.

Secondly you can get RPC error: Program Not Registered (or another “RPC” error)

For this check your NFS server and portmap service running or not by “rpcinfo -p”

44.

Can I Modify Export Permissions Without Needing To Remount Clients In Order To Have Them Take Effect?

Answer»

YES. The safest thing to do is EDIT /etc/exports and RUN “exportfs -r”.

Yes. The safest thing to do is edit /etc/exports and run “exportfs -r”.

45.

Explain Nfs Mount Options ?

Answer»

Syntax to MOUNT NFS FS:

#mount -t vfstype [-o options] NFS Servername:/exporteddirectory /mount POINT
or
#mount -t nfs -o options host:/remote/export /local/directory

Mount options explained below :

  • -0 initr : This option is used in non reliable network, or network having more network congestion. NFS request will be interrupted when server is not reachable.
  • -o hard : If hard option is specified during nfs mount, USER cannot terminate the PROCESS waiting for NFS communication to resume. For ex ..if u ran LS a command on ur NFS mounted directory but that time ur NFS server went down means . The process wont get killed or stopped ..it will wait until the NFS server and mount point become available.
  • -o soft : If soft option is specified during nfs mount, user will get error alert when NFS server is not reachable. This is just inverse of hard mount option. It wont wait for reply if the NFS server went down , it will alert us and the process will go down.
  • -o Nfsvers=value : If this option is specified during nfs mount NFS client uses particular NFS protocol version to communicate.

For example TCP
# mount- t nfs -o tcp 192.168.1.4:/mnt/array1/RHEL5 /data/
# mount | grep -i tcp

192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,tcp,addr=192.168.1.4)

Syntax to mount NFS FS:

#mount -t vfstype [-o options] NFS Servername:/exporteddirectory /mount point
or
#mount -t nfs -o options host:/remote/export /local/directory

Mount options explained below :

For example TCP
# mount- t nfs -o tcp 192.168.1.4:/mnt/array1/RHEL5 /data/
# mount | grep -i tcp

192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,tcp,addr=192.168.1.4)

46.

What Is Hard And Soft Mount In Nfs ?

Answer»

In HARD MOUNT :

  • If the NFS file system is hard mounted, the NFS daemons will try repeatedly to contact the server. The NFS daemon retries will not time out, will affect system performance, and you cannot interrupt them
  • If you just mount a file system without specifying hard or soft, the default is a hard mount. Hard mounts are PREFERABLE because of the stateless nature of NFS.
  • If a client sends an I/O request to the server (such as an ls -LA), and the server gets rebooted, in client machine the process will keep on running. This preserves data transfers in the event of a server failure.

IN SOFT Mount :

  • A soft mount allows the client to stop TRYING an operation after a period of time. If the NFS server goes down at the time of data transfer , it will alert and the process will do down. This may cause the data corruption.
  • A soft link will return with an error and fail. you should only use soft mounts in the cases where client responsiveness is more important than data integrity. In another WORD soft mount will allow automatic unmount if the filesystem is idle for a specified time period.

In HARD mount :

IN SOFT Mount :

47.

What Is Autofs And Its Advantages?

Answer»
  • Autofs , is auto mounting filesystem on demand like when EVER you need it.
  • NFS is like mounting a complete partition remotely and you will have availability of whole content of the partition.
  • But there are few advantages with autofs over nfs.

Advantages of AutoFS :

  • Shares are accessed automatically and transparently when a user tries to access any files or directories under the DESIGNATED mount point of the remote filesystem to be mounted.
  • BOOTING time is significantly reduced because no mounting is done at boot time.
  • Network access and efficiency are IMPROVED by reducing the number of permanently active mount points.
  • Failed mount requests can be reduced by designating alternate SERVERS as the source of a filesystem.

Advantages of AutoFS :

48.

What Is Nfs? What Is Its Purpose?

Answer»

NFS is Network File system. It is a file system used for sharing of FILES over a network. Other resources like printers and storage devices can also be shared. This means that using NFS files can be accessed remotely. Nfs command in linux can be used to achieve this.

Purpose of NFS:

  • NFS can be used for sharing of files remotely.
  • Data can be STORED on a SINGLE machine and still remain accessible to others over the network.
  • REDUCTION of the number of removable media drives THROUGHOUT the network since they can be shared.

NFS is Network File system. It is a file system used for sharing of files over a network. Other resources like printers and storage devices can also be shared. This means that using NFS files can be accessed remotely. Nfs command in linux can be used to achieve this.

Purpose of NFS:

49.

Explain “nfsstat” Command?

Answer»

The nfsstat COMMAND DISPLAYS the STATISTICS about NFS client and NFS SERVER activity.

The nfsstat command displays the statistics about NFS client and NFS server activity.

50.

Is Rpc.mountd Daemon Supports Tcp_wrappers?

Answer»

Yes, The rpc.mountd daemon is PROTECTED by the tcp_wrappers. You have to give the clients access to rpc.mountd if they should be ALLOWED to use NFS SERVER.

Yes, The rpc.mountd daemon is protected by the tcp_wrappers. You have to give the clients access to rpc.mountd if they should be allowed to use NFS Server.