View Available Exports on an NFS server

View Available Exports on an NFS server

Tags :

Category : How-to

Get Social!

Linux penguinThere is a handy command called showmount which displays all the active folder exports on an NFS server. This can be handy when trying to connect to a new NFS export from a remote machine as you can see if the export is available in the NFS server.

Run the showmount command with the server name to check which NFS exports are available. In this example, localhost is the server name.

showmount -e localhost

The output shows the available exports and the IP which they are available from. The below example shows 3 exports available from the 10.10.10.0 IP range.

Export list for localhost:
/tmp                 10.10.10.0/24
/zfs/volume1         10.10.10.0/24
/zfs/volume2         10.10.10.0/24

Mount NFS volume in a Proxmox OpenVZ container

Category : How-to

Get Social!

openvz-logo-150px_new_3There are various options for adding additional storage to an OpenVZ container. You can add additional storage to the containers root volume to simply increase the overall storage available to the container. For external storage, or storage on another disk to the root partition of the container there are bind mounts.

With some light work you can also use NFS mounts inside an OpenVZ container. Before NFS will work in a container a command needs to be ran on the host to enable NFS features in the container.

If you do not enable NFS on the container, you will get the following error:

mount: unknown filesystem type 'nfs'

Open a Terminal on the host machine and run the below command to check that the modules are loaded in the kernel:

modprobe nfs

Then run the below command to enable NFS on the container. Make sure container is turned off or restart the container after issuing the command.

vzctl set 998 --features "nfs:on" --save

This writes a change to the containers config file. To avoid using the command, you could simply edit the config file directly and add the below text to the bottom of the file:

FEATURES="nfs:on"

Start the container and make sure that the required packages are installed.

apt-get install nfs-common

If you do not have the required packages installed you may receive the following error

mount: wrong fs type, bad option, bad superblock on 192.168.50.252:/dspool/compressed,
 missing codepage or helper program, or other error
 (for several filesystems (e.g. nfs, cifs) you might
 need a /sbin/mount.<type> helper program)
 In some cases useful info is found in syslog - try
 dmesg | tail or so

Finally, run the mount command to mount your NFS directory.

mount -t nfs 10.10.10.5:/storage/compressed /mnt/testmount

NFS Mount Error on OEL

Category : How-to

Get Social!

oelI have been using an Oracle Enterprise Linux (OEL) OpenVZ container in Proxmox for installing some Oracle software. The easiest and least interfering way I have found is to mount an NFS share which contains the binaries directly to the container. See my NFS blog post for more information on setting up an OpenVZ container for NFS.

After the service and container was set up for NFS I tried to mount the NFS share. I received the below error after running the mount command.

[root@localhost ~]# mount -a
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

This was because the rpcbind daemon was not running. Run the below command to start the rpcbind daemon.

service rpcbind start

The service will display that the daemon is now running.

Starting rpcbind: [ OK ]

You can set rpcbind to start automatically by adding it to the startup group.

chkconfig rpcbind on

Retry the mount command and your NFS share should be mounted.

mount -a

You may need to check that you have the NFS client packages installed.

yum install nfs-utils

Visit our advertisers

Quick Poll

Do you use ZFS on Linux?

Visit our advertisers