.. _Accessing Virtuozzo Storage Clusters via NFS:

Accessing Virtuozzo Storage Clusters via NFS
--------------------------------------------

To access a Virtuozzo Storage Cluster via NFS, you need to:

1. Create and mount a ploop with the ext4 file system.

2. Set up an NFS share using either the standard ``exportfs`` command or the ``/etc/exports`` file.

3. Access the NFS share on the remote computer.

The following sections describe these steps in detail.

.. _Preparing the Ploop:

Preparing the Ploop
~~~~~~~~~~~~~~~~~~~

Loopback block devices (ploops) allow you to attach any Virtuozzo Storage file as a block device and format it to a conventional file system like ext4. Since Virtuozzo Storage is not optimized for small files and does not use a POSIX-compliant file system, you can use ploops with ext4 when you need the aforementioned functionality.

To prepare the ploop, do the following:

1. Load the required modules:

   ::

       # modprobe ploop pfmt_ploop1 pio_kaio

2. Create the ploop:

   ::

       # mkdir /vstorage/ploop0
       # ploop init -s 1g -t ext4 /vstorage/ploop0/img0

   This command creates a 1 GB ploop with the ext4 file system.

3. Mount the ploop:

   ::

       # mkdir /mnt/ploop0
       # ploop mount -m /mnt/ploop0 /vstorage/ploop0/DiskDescriptor.xml

4. (Optional) Set up a permanent ploop mount using /etc/fstab:

   ::

       # cat >> /etc/fstab <<EOF
       /vstorage/ploop0/DiskDescriptor.xml        /mnt/ploop0     ploop           defaults 0 0
       EOF

.. _Setting Up the NFS Share:

Setting Up the NFS Share
~~~~~~~~~~~~~~~~~~~~~~~~

For the purpose of this example, let us assume that:

1. The source computer IP address is 192.168.0.1 and the destination computer IP address is 192.168.0.2.

2. The ``exportfs`` command is used to set up the NFS share

3. On the destination computer, the NFS share is mounted to the ``/nfsshare`` directory.

To share the created file system via NFS, do the following:

1. On the source computer, make sure the ``nfsd`` service is running.

2. On the source computer, run the ``exportfs`` command as follows:

   ::

       # exportfs 192.168.0.2:/mnt/ploop0

3. On the remote computer, mount the shared path as follows:

   ::

       # mount 192.168.0.1:/mnt/ploop0 /nfsshare

Now you can access the contents of the shared ext4 file system on the remote computer.

.. note:: More details on setting up NFS shares are provided in the *Red Hat Enterprise Linux Storage Administration Guide*.
