Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Ploop/Mount helpers

2,057 bytes added, 02:07, 21 November 2013
created
Despite the fact that ploop is not a file system, a trick exist
to make it look and feel like so -- i.e. to use usual <code>mount</code>
and <code>umount</code> commands rather than the {{Man|ploop|8}} tool.
This article describes why and how, and lists caveats and limitation.

== Introduction ==

ploop is not a filesystem per se, but a kernel [[w:loop device]] driver, providing a way
to represent a ploop image (or a set of stacked images) as a
[[w:Device file system#Block_devices|block device]].
On top of that block device provided by ploop, an ext4 file system
is created and used, for example, for storing files of a specific
container.

Therefore a complete ploop mount consists of two steps:
# "mount" ploop image(s) to create a ploop device (/dev/ploopNNNNN)
# mount a filesystem residing on this ploop device to a mount point

For simplicity, these two are usually wrapped to be done together in one step (say when you use ploop mount with -m option).
In reality, step 1 is kernel assembling a device out of image(s), and step 2 is the real mount.

== Mounting ==

Normally, ploop is mounted by <code>ploop mount</code> command.

You can use the following syntax to mount a ploop device and the filesystem inside it:

mount -t ploop [option ...] /path/to/DiskDescriptor.xml /mount/point

The following options are supported:

<code>-r</code>, <code>-o ro</code>
: mount read-only

<code>-v</code>, <code>--verbose</code>
: be more verbose

<code>-f</code>, <code>--fake</code>
: do everything except for the actual mount

<code>-n</code>, <code>--no-mtab</code>, <code>-s</code>
: these options are deliberately ignored

== Unmounting ==

Normally, ploop is unmounted by <code>ploop umount</code> command.

But if the following is true, usual <code>umount</code> can be used:
# /etc/mtab is a separate file (not a symlink to /proc/mounts);
# mounting should have been done using <code>mount</code> (not <code>ploop mount</code>).

Any of the following can be used:

umount /path/to/DiskDescriptor.xml
umount /mount/point

[[Category: ploop]]