Difference between revisions of "Man/ploop.8"
Botinki Kira (talk | contribs) (Automated import of articles) |
Botinki Kira (talk | contribs) (Automated import of articles *** existing text overwritten ***) |
||
Line 81: | Line 81: | ||
<p style="margin-top: 1em">{ <b>-f</b> <i>format</i> | | <p style="margin-top: 1em">{ <b>-f</b> <i>format</i> | | ||
<b>-v</b> <i>version</i> } <i>DiskDescriptor.xml</i></p></td></tr> | <b>-v</b> <i>version</i> } <i>DiskDescriptor.xml</i></p></td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="20%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop check</b></p></td> | ||
+ | <td width="69%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-left:11%;">[<b>--force</b>] | ||
+ | [<b>--hard-force</b>] [<b>--check</b>] [<b>--ro</b>] | ||
+ | [<b>--silent</b>] [<b>--drop-inuse</b>] [<b>--raw</b>] | ||
+ | [<b>--blocksize </b><i>size</i>] | ||
+ | [<b>--repair-sparse</b>] <i>DiskDescriptor.xml</i> | | ||
+ | <i>image_file</i></p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop info</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="35%"> | ||
+ | |||
+ | <p style="margin-top: 1em">[<b>-s</b>] | ||
+ | <i>DiskDescriptor.xml</i></p> </td> | ||
+ | <td width="37%"> | ||
+ | </td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop list</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="35%"> | ||
+ | |||
+ | <p style="margin-top: 1em">[<b>-a</b>]</p></td> | ||
+ | <td width="37%"> | ||
+ | </td></tr> | ||
</table> | </table> | ||
Line 103: | Line 144: | ||
<p style="margin-top: 1em"><b>ploop snapshot-merge</b></p> </td> | <p style="margin-top: 1em"><b>ploop snapshot-merge</b></p> </td> | ||
− | <td width=" | + | <td width="51%"> |
− | <p style="margin-top: 1em">[<b>-u </b><i>uuid</i>] | + | <p style="margin-top: 1em">[<b>-u </b><i>uuid </i>| <b>-A</b>] |
<i>DiskDescriptor.xml</i></p> </td> | <i>DiskDescriptor.xml</i></p> </td> | ||
− | <td width=" | + | <td width="6%"> |
</td></tr> | </td></tr> | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
Line 114: | Line 155: | ||
<p style="margin-top: 1em"><b>ploop snapshot-switch</b></p> </td> | <p style="margin-top: 1em"><b>ploop snapshot-switch</b></p> </td> | ||
− | <td width=" | + | <td width="51%"> |
<p style="margin-top: 1em"><b>-u</b> <i>uuid | <p style="margin-top: 1em"><b>-u</b> <i>uuid | ||
DiskDescriptor.xml</i></p> </td> | DiskDescriptor.xml</i></p> </td> | ||
− | <td width=" | + | <td width="6%"> |
</td></tr> | </td></tr> | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
Line 125: | Line 166: | ||
<p style="margin-top: 1em"><b>ploop snapshot-delete</b></p> </td> | <p style="margin-top: 1em"><b>ploop snapshot-delete</b></p> </td> | ||
− | <td width=" | + | <td width="51%"> |
<p style="margin-top: 1em"><b>-u</b> <i>uuid | <p style="margin-top: 1em"><b>-u</b> <i>uuid | ||
DiskDescriptor.xml</i></p> </td> | DiskDescriptor.xml</i></p> </td> | ||
− | <td width=" | + | <td width="6%"> |
</td></tr> | </td></tr> | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
Line 136: | Line 177: | ||
<p style="margin-top: 1em"><b>ploop snapshot-list</b></p> </td> | <p style="margin-top: 1em"><b>ploop snapshot-list</b></p> </td> | ||
− | <td width=" | + | <td width="51%"></td> |
− | <td width=" | + | <td width="6%"> |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 145: | Line 186: | ||
[<b>-o </b><i>field</i>[,<i>field</i>...]] | [<b>-o </b><i>field</i>[,<i>field</i>...]] | ||
<i>DiskDescriptor.xml</i></p> | <i>DiskDescriptor.xml</i></p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop copy</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="57%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>-s</b> <i>device</i> | ||
+ | [<b>-F </b><i>stop_command</i>] | ||
+ | [<b>-d </b><i>file</i>]</p> </td> | ||
+ | <td width="15%"> | ||
+ | </td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop copy</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="57%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>-d</b> <i>file</i></p></td> | ||
+ | <td width="15%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop balloon discard</b></p> <td width="45%"></td> | ||
+ | <td width="55%"> | ||
+ | |||
+ | <p style="margin-top: 1em">[<b>--automount</b>] | ||
+ | [<b>--to-free </b><i>size</i>] | ||
+ | [<b>--min-block </b><i>min_size</i>] | ||
+ | <i>DiskDescriptor.xml</i></p> </td></tr> | ||
+ | </table> | ||
== DESCRIPTION == | == DESCRIPTION == | ||
Line 168: | Line 250: | ||
the form with DiskDescriptor.xml.</p> | the form with DiskDescriptor.xml.</p> | ||
− | === | + | == OPTIONS == |
+ | |||
+ | <p style="margin-left:11%; margin-top: 1em">Run | ||
+ | <b>ploop</b> without any options to show a short synopsys, | ||
+ | including a list of commands.</p> | ||
+ | |||
+ | <p style="margin-left:11%; margin-top: 1em">Run | ||
+ | <b>ploop</b> <i>command</i> to show synopsys and a short | ||
+ | description for a particular <i>command</i>.</p> | ||
+ | |||
+ | === Basic commands === | ||
==== init ==== | ==== init ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Create and initalize a ploop |
− | initalize a ploop image file and a corresponding | + | image file and a corresponding <b>DiskDescriptor.xml</b> |
− | <b>DiskDescriptor.xml</b> file.</p> | + | file.</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 213: | Line 305: | ||
<td width="72%"> | <td width="72%"> | ||
− | <p>Image format. See <b> | + | <p>Image format. See <b>Image formats</b> below.</p></td></tr> |
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
Line 224: | Line 316: | ||
<p>Image version, can be <b>1</b> or <b>2</b>. Default is | <p>Image version, can be <b>1</b> or <b>2</b>. Default is | ||
<b>2</b>, if supported by the kernel.</p></td></tr> | <b>2</b>, if supported by the kernel.</p></td></tr> | ||
− | + | </table> | |
− | |||
− | |||
− | <p><b>-t</b> < | + | <p style="margin-left:11%;"><b>-t |
− | + | none</b>|<b>ext3</b>|<b>ext4</b></p> | |
− | |||
− | <p>File system type. | + | <p style="margin-left:28%;">File system type to create, |
+ | default is <b>ext4</b>. Unless <b>none</b> is specified, a | ||
partition, a filesystem, and a balloon file will be created | partition, a filesystem, and a balloon file will be created | ||
− | inside the image | + | inside the image. Using <b>ext3</b> is not recommended.</p> |
− | |||
− | |||
<p style="margin-left:11%;"><b>-b</b> <i>blocksize</i></p> | <p style="margin-left:11%;"><b>-b</b> <i>blocksize</i></p> | ||
Line 265: | Line 353: | ||
==== mount ==== | ==== mount ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Assemble a ploop device from one |
− | ploop device from one or more delta images, start it, and | + | or more delta images, start it, and optionally mount the |
− | optionally mount the file system residing on the device.</p> | + | file system residing on the device.</p> |
− | <p style=" | + | <p style="margin-top: 1em">Two forms of this command are |
− | this command are provided. The first one accepts a list of | + | provided. The first one accepts a list of delta images to be |
− | delta images to be used for assembling the ploop device, | + | used for assembling the ploop device, while the second one |
− | while the second one is using information from a | + | is using information from a DiskDescriptor.xml file. Please |
− | DiskDescriptor.xml file. Please note that not all mount | + | note that not all mount options are applicable to both |
− | options are applicable to both forms.</p> | + | forms.</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 355: | Line 443: | ||
<td width="71%"> | <td width="71%"> | ||
− | <p>Ploop device to use, e.g. | + | <p>Ploop device to use, e.g. <b>/dev/ploop0</b>. If not |
− | specified, | + | specified, a randomly numbered ploop device will be |
+ | used.</p> </td></tr> | ||
</table> | </table> | ||
Line 409: | Line 498: | ||
==== umount ==== | ==== umount ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Unmount a ploop device. Since a |
− | device. Since a mounted ploop device consists of an image | + | mounted ploop device consists of an image (or multiple |
− | (or multiple images), a device, and a file system mounted to | + | images), a device, and (optionally) a file system mounted to |
a directory, one can refer to any of the above entities to | a directory, one can refer to any of the above entities to | ||
specify what to unmount. The recommended way is to use | specify what to unmount. The recommended way is to use | ||
Line 437: | Line 526: | ||
<td width="69%"> | <td width="69%"> | ||
− | <p>Ploop device, e.g., <b>/dev/ploop0</b> | + | <p>Ploop device, e.g., <b>/dev/ploop0</b>.</p></td></tr> |
− | |||
</table> | </table> | ||
Line 469: | Line 557: | ||
==== resize ==== | ==== resize ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Resize a ploop image. Both |
− | + | online (i.e. when ploop is mounted and used) and offline | |
− | grow or shrink the ploop image and the underlying file | + | resize is supported, and the tool can either grow or shrink |
− | system.</p> | + | both the ploop image and the underlying file system.</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 507: | Line 595: | ||
==== convert ==== | ==== convert ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Convert either ploop image |
− | + | format or version (but not both at the same time). | |
+ | Conversion can only be performed offline (i.e. image should | ||
+ | not be in use).</p> | ||
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 530: | Line 620: | ||
<td width="68%"> | <td width="68%"> | ||
− | <p>Image format. See <b> | + | <p>Image format. See <b>Image formats</b> below.</p></td></tr> |
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
Line 539: | Line 629: | ||
<td width="68%"> | <td width="68%"> | ||
− | <p>Image version, can be <b>1</b> or <b>2</b>. | + | <p>Image version, can be <b>1</b> or <b>2</b>.</p></td></tr> |
− | image | + | </table> |
+ | |||
+ | ==== check ==== | ||
+ | |||
+ | <p style="margin-top: 1em">Check the internal consistency | ||
+ | of (and possibly repair) a ploop image (or images). Note | ||
+ | that image(s) to be tested should not be in use. If | ||
+ | <i>DiskDescriptor.xml</i> is supplied, all the images one by | ||
+ | one are checked.</p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="17%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop check</b></p></td> | ||
+ | <td width="1%"></td> | ||
+ | <td width="71%"> | ||
+ | |||
+ | <p style="margin-top: 1em">[<b>--force</b>] | ||
+ | [<b>--hard-force</b>] [<b>--check</b>] [<b>--ro</b>] | ||
+ | [<b>--silent</b>] [<b>--drop-inuse</b>] [<b>--raw</b>] | ||
+ | [<b>--blocksize </b><i>size</i>] | ||
+ | [<b>--repair-sparse</b>] <i>DiskDescriptor.xml</i> | | ||
+ | <i>image_file</i></p> </td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="17%"> | ||
+ | |||
+ | <p><b>-f</b>, <b>--force</b></p></td> | ||
+ | <td width="1%"></td> | ||
+ | <td width="71%"> | ||
+ | |||
+ | <p>Force check even if image’s dirty flag is not | ||
+ | set.</p> </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>-F</b>, | ||
+ | <b>--hard-force</b></p> | ||
+ | |||
+ | <p style="margin-left:29%;">Same as <b>-f</b>, plus try to | ||
+ | fix even fatal errors (can be dangerous).</p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="17%"> | ||
+ | |||
+ | <p><b>-c</b>, <b>--check</b></p></td> | ||
+ | <td width="1%"></td> | ||
+ | <td width="63%"> | ||
+ | |||
+ | <p>Check for duplicated blocks and holes.</p></td> | ||
+ | <td width="8%"> | ||
+ | </td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="17%"> | ||
+ | |||
+ | <p><b>-r</b>, <b>--ro</b></p></td> | ||
+ | <td width="1%"></td> | ||
+ | <td width="63%"> | ||
+ | |||
+ | <p>Read-only access, do not modify image(s).</p></td> | ||
+ | <td width="8%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>-s</b>, <b>--silent</b></p> | ||
+ | |||
+ | <p style="margin-left:29%;">Be more silent, only report | ||
+ | errors.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>-d</b>, | ||
+ | <b>--drop-inuse</b></p> | ||
+ | |||
+ | <p style="margin-left:29%;">Drop image "in use" | ||
+ | flag.</p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="14%"> | ||
+ | |||
+ | <p><b>-R</b>, <b>--raw</b></p></td> | ||
+ | <td width="4%"></td> | ||
+ | <td width="71%"> | ||
+ | |||
+ | <p>Specifies that <i>image_file</i> is a raw ploop | ||
+ | image.</p> </td></tr> | ||
</table> | </table> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>-b</b>, <b>--blocksize</b> | ||
+ | <i>size</i></p> | ||
+ | |||
+ | <p style="margin-left:29%;">Image cluster block size, in | ||
+ | sectors (for raw images).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>-S</b>, | ||
+ | <b>--repair-sparse</b></p> | ||
+ | |||
+ | <p style="margin-left:29%;">Repair sparse image(s).</p> | ||
+ | |||
+ | === Miscellaneous commands === | ||
+ | |||
+ | ==== info ==== | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop info</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="27%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><i>DiskDescriptor.xml</i></p></td> | ||
+ | <td width="45%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p>Show information about disk space and inodes usage and | ||
+ | limits on the inner ploop filesystem, somewhat similar to | ||
+ | [[Man/vzquota.8|<b>vzquota</b>(8)]] <b>stat</b> or <b>show</b> commands.</p> | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop info</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="32%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>-s</b> | ||
+ | <i>DiskDescriptor.xml</i></p> </td> | ||
+ | <td width="40%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p>Show information about ploop device size, block size, | ||
+ | and format version.</p> | ||
+ | |||
+ | ==== list ==== | ||
+ | |||
+ | <table width="100%" border="0" rules="none" frame="void" | ||
+ | cellspacing="0" cellpadding="0"> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="15%"> | ||
+ | |||
+ | <p style="margin-top: 1em"><b>ploop list</b></p></td> | ||
+ | <td width="2%"></td> | ||
+ | <td width="6%"> | ||
+ | |||
+ | <p style="margin-top: 1em">[<b>-a</b>]</p></td> | ||
+ | <td width="66%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-top: 1em">Shows a list of running ploop | ||
+ | devices (first column) and their corresponding base images. | ||
+ | With option <b>-a</b> it also shows a mount point (third | ||
+ | column).</p> | ||
+ | |||
+ | === Working with snapshots === | ||
+ | |||
+ | <p style="margin-top: 1em">Ploop snapshots is a mechanism | ||
+ | for creating and managing instant states of a running file | ||
+ | system. Creating a snapshot leads to creating a new empty | ||
+ | ploop image which is layered on top of an old one, then all | ||
+ | writes are ending up in the top image, and reads are falling | ||
+ | through to a lower level. There can be up to 126) stacked | ||
+ | ploop images (or snapshots). Online snapshot merging is also | ||
+ | supported.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">Snapshots are identified by a | ||
+ | unique UUID. A snapshot can be mounted using <b>ploop mount | ||
+ | -u</b> <i>UUID</i> command, see above.</p> | ||
==== snapshot ==== | ==== snapshot ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Create a ploop snapshot.</p> |
− | snapshot.</p> | ||
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 576: | Line 847: | ||
==== snapshot-merge ==== | ==== snapshot-merge ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Merge a snapshot with its |
− | snapshot with its parent.</p> | + | parent.</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 589: | Line 860: | ||
<td width="57%"> | <td width="57%"> | ||
− | <p style="margin-top: 1em">[<b>-u </b><i>uuid</i>] | + | <p style="margin-top: 1em">[<b>-u </b><i>uuid </i>| <b>-A</b>] |
<i>DiskDescriptor.xml</i></p> </td></tr> | <i>DiskDescriptor.xml</i></p> </td></tr> | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
Line 616: | Line 887: | ||
==== snapshot-switch ==== | ==== snapshot-switch ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Switch to the specified |
− | + | snapshot. This operation can only be performed while ploop | |
− | while ploop is not running (i.e. is unmounted). The current | + | is not running (i.e. is unmounted). The current top delta |
− | top delta image will be removed.</p> | + | image will be removed.</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 646: | Line 917: | ||
==== snapshot-delete ==== | ==== snapshot-delete ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">Delete the specifed snapshot. |
− | specifed snapshot. This operation can only be performed if | + | This operation can only be performed if the specified |
− | the specified snapshot is not active. In case snapshot | + | snapshot is not active. In case snapshot doesn’t have |
− | doesn’t have any children, it will simply be removed. | + | any children, it will simply be removed. In case snapshot |
− | In case snapshot has a single child, it will be merged to | + | has a single child, it will be merged to that child. |
− | that child. Deleting a snapshot that has multiple children | + | Deleting a snapshot that has multiple children is currently |
− | is currently not supported (but can be performed manually in | + | not supported (but can be performed manually in an iterative |
− | an iterative fashion).</p> | + | fashion).</p> |
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 680: | Line 951: | ||
==== snapshot-list ==== | ==== snapshot-list ==== | ||
− | <p style=" | + | <p style="margin-top: 1em">List available snapshots.</p> |
− | snapshots.</p> | ||
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 727: | Line 997: | ||
• <b>fname</b> - snapshot image file name.</p> | • <b>fname</b> - snapshot image file name.</p> | ||
− | === | + | === Image copying === |
− | ==== | + | <p style="margin-top: 1em"><b>ploop copy</b> is a mechanism |
+ | of effective copying of a top ploop image with the help of | ||
+ | build-in ploop kernel driver feature called write tracker. | ||
+ | Write tracker is a feature that lets <b>ploop copy</b> to | ||
+ | iteratively obtain a list of modified image blocks from the | ||
+ | kernel. Two <b>ploop copy</b> processes are required for | ||
+ | iterative top delta transfer. These are used by | ||
+ | <b>vzmigrate(8).</b></p> | ||
+ | |||
+ | ==== copy (sending) ==== | ||
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 735: | Line 1,014: | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
− | <td width=" | + | <td width="15%"> |
− | <p style="margin-top: 1em"><b>ploop | + | <p style="margin-top: 1em"><b>ploop copy</b></p></td> |
<td width="2%"></td> | <td width="2%"></td> | ||
− | <td width=" | + | <td width="57%"> |
+ | |||
+ | <p style="margin-top: 1em"><b>-s</b> <i>device</i> | ||
+ | [<b>-F </b><i>stop_command</i>] | ||
+ | [<b>-d </b><i>file</i>]</p> </td> | ||
+ | <td width="15%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-top: 1em">This command enables the | ||
+ | in-kernel write tracker for the specified ploop | ||
+ | <i>device,</i> then sends all the data blocks from the top | ||
+ | delta image to stdout (supposedly read by destination | ||
+ | <b>ploop copy</b>) or a <i>file</i>. After that, it | ||
+ | iteratively gets the list of the modified data blocks from | ||
+ | the kernel and sends those blocks again. After a number of | ||
+ | iterations (or when the list is empty), it executes the | ||
+ | <i>stop_command</i> (this could be <b>vzctl stop</b> or | ||
+ | <b>vzctl chkpnt</b>) and does the last iteration of sending | ||
+ | the modified data blocks. Finally, it checks that the data | ||
+ | were not modified, error is returned otherwise.</p> | ||
+ | |||
+ | ==== copy (receiving) ==== | ||
− | < | + | <table width="100%" border="0" rules="none" frame="void" |
− | + | cellspacing="0" cellpadding="0"> | |
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
− | <td width=" | + | <td width="15%"> |
− | <p><b> | + | <p style="margin-top: 1em"><b>ploop copy</b></p></td> |
<td width="2%"></td> | <td width="2%"></td> | ||
− | <td width=" | + | <td width="10%"> |
+ | |||
+ | <p style="margin-top: 1em"><b>-d</b> <i>file</i></p></td> | ||
+ | <td width="62%"> | ||
+ | </td></tr> | ||
+ | </table> | ||
+ | |||
+ | <p style="margin-top: 1em">Reads the data block (provided | ||
+ | by the source <b>ploop copy</b>) from the <b>stdin</b> and | ||
+ | writes them to the <i>file</i>.</p> | ||
+ | |||
+ | === Ballooning === | ||
+ | |||
+ | <p style="margin-top: 1em">Since there is no online shrink | ||
+ | support in <b>ext4</b> file system, ploop internally uses a | ||
+ | technique called "ballooning" as a work around to | ||
+ | shrink its images.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">Ballooning operation consists of | ||
+ | inflating a special balloon file (invisible for ordinary | ||
+ | users), loading fiemap info of the inflated balloon to the | ||
+ | kernel, relocating blocks of the image file from the tail to | ||
+ | the space specified by fiemap info, and truncating the tail | ||
+ | of the image file. Result is the image file of a smaller | ||
+ | size.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">However, it is quite possible | ||
+ | that inflated balloon file will only span blocks that were | ||
+ | never touched before. Those will look like "not | ||
+ | allocated" space from the kernel ploop point of view. | ||
+ | In this case nothing will be relocated and nothing | ||
+ | truncated.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">So, if balloon operation | ||
+ | succeeded, it’s only guaranteed that a user of ploop | ||
+ | device won’t be able to consume more space than the | ||
+ | initial block device size minus the size of the inflated | ||
+ | balloon. On the other hand, if a user of block device used a | ||
+ | lot of space on it, then freed the significant part of used | ||
+ | space, balloon operation will result in significant truncate | ||
+ | of image file.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">All the ploop ballooning logic | ||
+ | is hidden from the end user, so while a number of low-level | ||
+ | commands exist for working with ploop ballooning, those are | ||
+ | not needed and therefore are not documented here, except for | ||
+ | a single command.</p> | ||
− | + | ==== balloon discard ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <p><b> | + | <p style="margin-top: 1em">In a situation when a lot of |
− | + | disk space were freed on an in-ploop filesystem, use | |
− | + | <b>ploop balloon discard</b> to optimize the ploop image | |
+ | size.</p> | ||
− | < | + | <table width="100%" border="0" rules="none" frame="void" |
+ | cellspacing="0" cellpadding="0"> | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
− | <td width=" | + | <td width="32%"> |
− | <p>< | + | <p style="margin-top: 1em"><b>ploop balloon discard</b></p> </td> |
<td width="2%"></td> | <td width="2%"></td> | ||
− | <td width=" | + | <td width="55%"> |
− | <p> | + | <p style="margin-top: 1em">[<b>--automount</b>] |
− | + | [<b>--to-free </b><i>size</i>] | |
− | + | [<b>--min-block </b><i>min_size</i>] | |
+ | <i>DiskDescriptor.xml</i></p> </td></tr> | ||
</table> | </table> | ||
− | = | + | <p style="margin-top: 1em">Iteratively try to relocate and |
+ | discard unused blocks from a ploop image, reducing its | ||
+ | size.</p> | ||
− | <p style="margin- | + | <p style="margin-top: 1em">Note that ploop device and its |
− | image formats are currently supported.</p> | + | inner file system should be mounted. If not, one can use |
+ | <b>--automount</b> option to automatically mount ploop for | ||
+ | the duration of the operation.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">Option <b>--to-free</b> can be | ||
+ | used to specify a maximum disk space to be freed. In other | ||
+ | words, stop the process once freed space exceeded requested | ||
+ | <i>size</i>. Default is 0, meaning to try to free as much | ||
+ | space as possible.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">Option <b>--min-block</b> can be | ||
+ | used to specify a minimum size of an extent to free. The | ||
+ | smallest possible extent is 1 cluster (currently 1 MB), one | ||
+ | can specify higher value to speed up the whole discarding | ||
+ | operation.</p> | ||
+ | |||
+ | <p style="margin-top: 1em">Note that the same functionality | ||
+ | is available by means of <b>vzctl compact</b> command.</p> | ||
+ | |||
+ | === Image formats === | ||
+ | following image formats are currently supported.</p> | ||
<table width="100%" border="0" rules="none" frame="void" | <table width="100%" border="0" rules="none" frame="void" | ||
Line 787: | Line 1,152: | ||
<tr valign="top" align="left"> | <tr valign="top" align="left"> | ||
<td width="11%"></td> | <td width="11%"></td> | ||
− | <td width=" | + | <td width="24%"> |
− | <p | + | <p><b>raw</b></p></td> |
− | <td width=" | + | <td width="10%"></td> |
− | <td width=" | + | <td width="55%"> |
+ | |||
+ | <p>Raw format, with 1:1 mapping between the image file and | ||
+ | the ploop device.</p></td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="24%"> | ||
− | <p | + | <p><b>ploop1</b>, <b>expanded</b></p></td> |
− | + | <td width="10%"></td> | |
+ | <td width="55%"> | ||
+ | |||
+ | <p>Expanded format. The image will grow according to the | ||
+ | needs of the underlying file system. This format is the | ||
+ | default. Names ’<b>ploop1</b>’ and | ||
+ | ’<b>expanded</b>’ are aliases.</p></td></tr> | ||
+ | <tr valign="top" align="left"> | ||
+ | <td width="11%"></td> | ||
+ | <td width="24%"> | ||
+ | |||
+ | <p><b>preallocated</b></p></td> | ||
+ | <td width="10%"></td> | ||
+ | <td width="55%"> | ||
+ | |||
+ | <p>This is the same as ’<b>ploop1</b>’ or | ||
+ | ’<b>expanded</b>’, the only difference is all | ||
+ | the file blocks are allocated during creation.</p></td></tr> | ||
</table> | </table> | ||
− | <p style="margin-left:11%;"><b> | + | == EXIT STATUS == |
+ | |||
+ | <p style="margin-left:11%; margin-top: 1em"><b>ploop</b> | ||
+ | exits with status 0 in case of successful execution. Any | ||
+ | status greater than 0 signifies an error. <b><br> | ||
+ | 1</b>, <b>SYSEXIT_CREAT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error creating a file.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>2</b>, <b>SYSEXIT_DEVICE</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error getting or opening a | ||
+ | ploop device.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>3</b>, <b>SYSEXIT_DEVIOC</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error doing <b>ioctl</b>(2) on | ||
+ | ploop device.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>4</b>, <b>SYSEXIT_OPEN</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error opening a file.</p> | ||
− | <p style="margin-left: | + | <p style="margin-left:11%;"><b>5</b>, <b>SYSEXIT_MALLOC</b></p> |
− | |||
− | |||
− | |||
− | |||
− | <p style="margin-left: | + | <p style="margin-left:22%;">Not enough memory (error from |
+ | <b>malloc</b>(3), <b>realloc</b>(3), <b>calloc</b>(3), or | ||
+ | <b>posix_memalign</b>(3)).</p> | ||
− | <p style="margin-left:22%;"> | + | <p style="margin-left:11%;"><b>6</b>, <b>SYSEXIT_READ</b></p> |
− | ’<b> | + | |
− | ’<b> | + | <p style="margin-left:22%;">Error during read.</p> |
− | + | ||
+ | <p style="margin-left:11%;"><b>7</b>, <b>SYSEXIT_WRITE</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error during write.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>9</b>, <b>SYSEXIT_SYSFS</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error reading from a sysfs file | ||
+ | (usually under <b>/sys/block/ploop...</b>).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>11</b>, <b>SYSEXIT_PLOOPFMT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Corrupted ploop image | ||
+ | detected.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>12</b>, <b>SYSEXIT_SYS</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Other system error.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>13</b>, <b>SYSEXIT_PROTOCOL</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Broken protocol (unexpected | ||
+ | value received).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>14</b>, <b>SYSEXIT_LOOP</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;"><b>pcopy</b> command | ||
+ | can’t finalize copying (frozen filesystem is | ||
+ | changing).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>15</b>, <b>SYSEXIT_FSTAT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>stat</b>(2), | ||
+ | <b>fstat</b>(2), or <b>statfs</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>16</b>, <b>SYSEXIT_FSYNC</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>fsync</b>(2) or | ||
+ | <b>syncfs</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>17</b>, <b>SYSEXIT_EBUSY</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Can’t continue, another | ||
+ | operation is in progress.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>18</b>, <b>SYSEXIT_FLOCK</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>flock</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>19</b>, <b>SYSEXIT_FTRUNCATE</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>ftruncate</b>(2) | ||
+ | or <b>truncate</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>20</b>, <b>SYSEXIT_FALLOCATE</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from | ||
+ | <b>fallocate</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>21</b>, <b>SYSEXIT_MOUNT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Can’t mount ploop image | ||
+ | or file system.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>22</b>, <b>SYSEXIT_UMOUNT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Can’t unmount ploop image | ||
+ | or file system.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>23</b>, <b>SYSEXIT_LOCK</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Locking failed (another | ||
+ | operation in progress?).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>24</b>, <b>SYSEXIT_MKFS</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Can’t create file | ||
+ | system.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>26</b>, <b>SYSEXIT_RESIZE_FS</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Utility <b>resizefs</b> | ||
+ | failed.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>27</b>, <b>SYSEXIT_MKDIR</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>mkdir</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>28</b>, <b>SYSEXIT_RENAME</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from | ||
+ | <b>rename</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>29</b>, <b>SYSEXIT_ABORT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Operation aborted.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>30</b>, <b>SYSEXIT_RELOC</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Block relocation failed.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>33</b>, <b>SYSEXIT_CHANGE_GPT</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error resizing GPT partition | ||
+ | table.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>35</b>, <b>SYSEXIT_UNLINK</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from | ||
+ | <b>unlink</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>36</b>, <b>SYSEXIT_MKNOD</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>mknod</b>(2).</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>37</b>, <b>SYSEXIT_PLOOPINUSE</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Image is already in use.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>38</b>, <b>SYSEXIT_PARAM</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Invalid parameter.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>39</b>, <b>SYSEXIT_DISKDESCR</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Problem with DiskDescriptor.xml | ||
+ | file.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>40</b>, <b>SYSEXIT_DEV_NOT_MOUNTED</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Ploop image is not mounted.</p> | ||
+ | |||
+ | <p style="margin-left:11%;"><b>41</b>, <b>SYSEXIT_FSCK</b></p> | ||
+ | |||
+ | <p style="margin-left:22%;">Error from <b>fsck</b>(8).</p> | ||
== SEE ALSO == | == SEE ALSO == | ||
− | <p style="margin-left:11%; margin-top: 1em">[[Man/vzctl.8|<b>vzctl</b>(8)]].</p> | + | <p style="margin-left:11%; margin-top: 1em">[[Man/vzctl.8|<b>vzctl</b>(8)]], |
+ | [[Man/vzmigrate.8|<b>vzmigrate</b>(8)]], <b>http://openvz.org/Ploop</b>.</p> |
Revision as of 19:44, 17 December 2013
Contents
NAME
ploop − ploop device management utility
SYNOPSYS
ploop init |
-s size [-f format] [-v version] [-t fstype] [-b blocksize] [-B fsblocksize] delta_file | |
ploop mount |
[-r] [-F] [-f format] [-b blocksize] [-d device] [-m mount_point] [-o mount_options] [-t fstype] base_delta [... top_delta] | |
ploop mount |
[-r] [-F] [-d device] [-m mount_point] [-o mount_options] [-t fstype] [-u uuid] DiskDescriptor.xml |
ploop umount |
{ -d device | -m mount_point | DiskDescriptor.xml | image_file } | |
ploop resize |
-s size DiskDescriptor.xml | |
ploop convert |
{ -f format | -v version } DiskDescriptor.xml | |
ploop check |
[--force] [--hard-force] [--check] [--ro] [--silent] [--drop-inuse] [--raw] [--blocksize size] [--repair-sparse] DiskDescriptor.xml | image_file
ploop info |
[-s] DiskDescriptor.xml |
|||
ploop list |
[-a] |
ploop snapshot
[-u uuid] DiskDescriptor.xml |
ploop snapshot-merge |
[-u uuid | -A] DiskDescriptor.xml |
||
ploop snapshot-switch |
-u uuid DiskDescriptor.xml |
||
ploop snapshot-delete |
-u uuid DiskDescriptor.xml |
||
ploop snapshot-list |
[-H] [-u uuid] [-o field[,field...]] DiskDescriptor.xml
ploop copy |
-s device [-F stop_command] [-d file] |
|||
ploop copy |
-d file |
ploop balloon discard
[--automount] [--to-free size] [--min-block min_size] DiskDescriptor.xml |
DESCRIPTION
ploop is a kernel block device, similar to the traditional loop device (which is controlled by losetup(8)) but with more features added, such as dynamic disk space allocation, stackable images, online resize, snapshotting, and live migration helper (write tracker). This manual page describes the ploop user space tool which is used to perform various operations related to ploop devices and images.
Note that this ploop tool is not aware of container entities. Commands that have DiskDescriptor.xml as an argument work with an XML file that contains meta-information about a particular ploop device configuration: device characteristics (block size etc.), storage information (names and formats of images used for the device), snapshot information, etc. If a particular command can be used both with and without the DiskDescriptor.xml argument, it is strongly advised to use the form with DiskDescriptor.xml.
OPTIONS
Run ploop without any options to show a short synopsys, including a list of commands.
Run ploop command to show synopsys and a short description for a particular command.
Basic commands
init
Create and initalize a ploop image file and a corresponding DiskDescriptor.xml file.
ploop init |
-s size [-f format] [-v version] [-t fstype] [-b blocksize] [-B fsblocksize] delta_file | ||
-s size |
Image size. If no suffix is specified, the size is in sector units (one sector is 512 bytes). One can specify optional K, M, G or T suffix to set the size in kilo-, mega-, giga- or terabytes. | ||
-f format |
Image format. See Image formats below. | ||
-v version |
Image version, can be 1 or 2. Default is 2, if supported by the kernel. |
-t none|ext3|ext4
File system type to create, default is ext4. Unless none is specified, a partition, a filesystem, and a balloon file will be created inside the image. Using ext3 is not recommended.
-b blocksize
Device block size, in 512 byte sectors. Default block size is 2048 sectors, or 1 megabyte.
-B fsblocksize
Filesystem block size, in bytes. Default is 4096 bytes.
delta_file |
Path to a non-existent image file to be created. |
mount
Assemble a ploop device from one or more delta images, start it, and optionally mount the file system residing on the device.
Two forms of this command are provided. The first one accepts a list of delta images to be used for assembling the ploop device, while the second one is using information from a DiskDescriptor.xml file. Please note that not all mount options are applicable to both forms.
ploop mount |
[-r] [-F] [-f format] [-b blocksize] [-d device] [-m mount_point] [-o mount_options] [-t fstype] base_delta [... top_delta] | ||
ploop mount |
[-r] [-F] [-d device] [-m mount_point] [-o mount_options] [-t fstype] [-u uuid] DiskDescriptor.xml | ||
-r |
Mount as read-only. | ||
-F |
Run fsck(8) on inner filesystem before mounting it. This option is ignored if -m is not used. | ||
-f format |
Image format. Ignored if DiskDescriptor.xml is specified. Otherwise, one need to specify raw as an argument, if raw image format is used. |
-b blocksize
Device block size, in 512 byte sectors. Ignored if DiskDescriptor.xml is specified. Otherwise, required for raw images.
-d device |
Ploop device to use, e.g. /dev/ploop0. If not specified, a randomly numbered ploop device will be used. |
-m mount_point
If this option is specified, ploop goes on to mount the file system to directory denoted by mount_point.
-o mount_options
Any additional mount options, comma-separated. Used if -m is set.
-t fstype |
File system type used for mounting. Used if -m is set. The default is ext4. |
-u uuid | base
GUID of the image from the DiskDescriptor.xml to be mounted. By default, top GUID is used. The special ’base’ value can be used to mount the base (lower-level) image.
base_delta [... top_delta]
List of image files to mount, with the first one being the base delta and the last one being the top delta (i.e. the one that will be writable unless -r is specified).
DiskDescriptor.xml
Path to the DiskDescriptor.xml file with information about images.
umount
Unmount a ploop device. Since a mounted ploop device consists of an image (or multiple images), a device, and (optionally) a file system mounted to a directory, one can refer to any of the above entities to specify what to unmount. The recommended way is to use DiskDescriptor.xml.
ploop umount |
{ -d device | -m mount_point | DiskDescriptor.xml | image_file } | ||
-d device |
Ploop device, e.g., /dev/ploop0. |
-m mount_point
Mount point of a ploop device to unmount.
DiskDescriptor.xml
Path to the DiskDescriptor.xml file with information about images.
image_file |
Path to a mounted image file. |
resize
Resize a ploop image. Both online (i.e. when ploop is mounted and used) and offline resize is supported, and the tool can either grow or shrink both the ploop image and the underlying file system.
ploop resize |
-s size DiskDescriptor.xml | ||
-s size |
Image size. If no suffix is specified, size is in sector units (one sector is 512 bytes). One can specify optional K, M, G or T suffix to set the size in kilo-, mega-, giga- or terabytes. |
DiskDescriptor.xml
Path to the DiskDescriptor.xml file with information about images.
convert
Convert either ploop image format or version (but not both at the same time). Conversion can only be performed offline (i.e. image should not be in use).
ploop convert |
{ -f format | -v version } DiskDescriptor.xml | ||
-f format |
Image format. See Image formats below. | ||
-v version |
Image version, can be 1 or 2. |
check
Check the internal consistency of (and possibly repair) a ploop image (or images). Note that image(s) to be tested should not be in use. If DiskDescriptor.xml is supplied, all the images one by one are checked.
ploop check |
[--force] [--hard-force] [--check] [--ro] [--silent] [--drop-inuse] [--raw] [--blocksize size] [--repair-sparse] DiskDescriptor.xml | image_file | ||
-f, --force |
Force check even if image’s dirty flag is not set. |
-F, --hard-force
Same as -f, plus try to fix even fatal errors (can be dangerous).
-c, --check |
Check for duplicated blocks and holes. |
|||
-r, --ro |
Read-only access, do not modify image(s). |
-s, --silent
Be more silent, only report errors.
-d, --drop-inuse
Drop image "in use" flag.
-R, --raw |
Specifies that image_file is a raw ploop image. |
-b, --blocksize size
Image cluster block size, in sectors (for raw images).
-S, --repair-sparse
Repair sparse image(s).
Miscellaneous commands
info
ploop info |
DiskDescriptor.xml |
Show information about disk space and inodes usage and limits on the inner ploop filesystem, somewhat similar to vzquota(8) stat or show commands.
ploop info |
-s DiskDescriptor.xml |
Show information about ploop device size, block size, and format version.
list
ploop list |
[-a] |
Shows a list of running ploop devices (first column) and their corresponding base images. With option -a it also shows a mount point (third column).
Working with snapshots
Ploop snapshots is a mechanism for creating and managing instant states of a running file system. Creating a snapshot leads to creating a new empty ploop image which is layered on top of an old one, then all writes are ending up in the top image, and reads are falling through to a lower level. There can be up to 126) stacked ploop images (or snapshots). Online snapshot merging is also supported.
Snapshots are identified by a unique UUID. A snapshot can be mounted using ploop mount -u UUID command, see above.
snapshot
Create a ploop snapshot.
ploop snapshot |
[-u uuid] DiskDescriptor.xml | ||
-u uuid |
Specify a uuid for a new snapshot. If option is not given, uuid is generated automatically. To generate uuid manually, one can use the uuidgen(1) utility. Note that UUID must be enclosed in curly brackets. |
snapshot-merge
Merge a snapshot with its parent.
ploop snapshot-merge |
[-u uuid | -A] DiskDescriptor.xml | ||
-u uuid |
Specify a snapshot uuid to merge. If this option is not specified, the top delta will be used. | ||
-A |
Merge all snapshots down to base delta. If some snapshots have more than a single child, they will be impossible to merge. |
snapshot-switch
Switch to the specified snapshot. This operation can only be performed while ploop is not running (i.e. is unmounted). The current top delta image will be removed.
ploop snapshot-switch |
-u uuid DiskDescriptor.xml | ||
-u uuid |
Specify a snapshot uuid to switch to. |
snapshot-delete
Delete the specifed snapshot. This operation can only be performed if the specified snapshot is not active. In case snapshot doesn’t have any children, it will simply be removed. In case snapshot has a single child, it will be merged to that child. Deleting a snapshot that has multiple children is currently not supported (but can be performed manually in an iterative fashion).
ploop snapshot-delete |
-u uuid DiskDescriptor.xml | ||
-u uuid |
Specify a snapshot uuid to be deleted. |
snapshot-list
List available snapshots.
ploop snapshot-list |
[-H] [-u uuid] [-o field[,field...]] DiskDescriptor.xml | ||
-H, --no-header |
Suppress displaying the header row. Usable for scripts. |
-u, --uuid, --id uuid
Filter the output to a specified uuid.
-o, --output field[,field...]
Display only the specified
fields. Possible fields are:
• uuid - snapshot’s UUID;
• parent_uuid - snapshot’s parent UUID;
• current - if this snapshot is the current one;
• fname - snapshot image file name.
Image copying
ploop copy is a mechanism of effective copying of a top ploop image with the help of build-in ploop kernel driver feature called write tracker. Write tracker is a feature that lets ploop copy to iteratively obtain a list of modified image blocks from the kernel. Two ploop copy processes are required for iterative top delta transfer. These are used by vzmigrate(8).
copy (sending)
ploop copy |
-s device [-F stop_command] [-d file] |
This command enables the in-kernel write tracker for the specified ploop device, then sends all the data blocks from the top delta image to stdout (supposedly read by destination ploop copy) or a file. After that, it iteratively gets the list of the modified data blocks from the kernel and sends those blocks again. After a number of iterations (or when the list is empty), it executes the stop_command (this could be vzctl stop or vzctl chkpnt) and does the last iteration of sending the modified data blocks. Finally, it checks that the data were not modified, error is returned otherwise.
copy (receiving)
ploop copy |
-d file |
Reads the data block (provided by the source ploop copy) from the stdin and writes them to the file.
Ballooning
Since there is no online shrink support in ext4 file system, ploop internally uses a technique called "ballooning" as a work around to shrink its images.
Ballooning operation consists of inflating a special balloon file (invisible for ordinary users), loading fiemap info of the inflated balloon to the kernel, relocating blocks of the image file from the tail to the space specified by fiemap info, and truncating the tail of the image file. Result is the image file of a smaller size.
However, it is quite possible that inflated balloon file will only span blocks that were never touched before. Those will look like "not allocated" space from the kernel ploop point of view. In this case nothing will be relocated and nothing truncated.
So, if balloon operation succeeded, it’s only guaranteed that a user of ploop device won’t be able to consume more space than the initial block device size minus the size of the inflated balloon. On the other hand, if a user of block device used a lot of space on it, then freed the significant part of used space, balloon operation will result in significant truncate of image file.
All the ploop ballooning logic is hidden from the end user, so while a number of low-level commands exist for working with ploop ballooning, those are not needed and therefore are not documented here, except for a single command.
balloon discard
In a situation when a lot of disk space were freed on an in-ploop filesystem, use ploop balloon discard to optimize the ploop image size.
ploop balloon discard |
[--automount] [--to-free size] [--min-block min_size] DiskDescriptor.xml |
Iteratively try to relocate and discard unused blocks from a ploop image, reducing its size.
Note that ploop device and its inner file system should be mounted. If not, one can use --automount option to automatically mount ploop for the duration of the operation.
Option --to-free can be used to specify a maximum disk space to be freed. In other words, stop the process once freed space exceeded requested size. Default is 0, meaning to try to free as much space as possible.
Option --min-block can be used to specify a minimum size of an extent to free. The smallest possible extent is 1 cluster (currently 1 MB), one can specify higher value to speed up the whole discarding operation.
Note that the same functionality is available by means of vzctl compact command.
Image formats
following image formats are currently supported.
raw |
Raw format, with 1:1 mapping between the image file and the ploop device. | ||
ploop1, expanded |
Expanded format. The image will grow according to the needs of the underlying file system. This format is the default. Names ’ploop1’ and ’expanded’ are aliases. | ||
preallocated |
This is the same as ’ploop1’ or ’expanded’, the only difference is all the file blocks are allocated during creation. |
EXIT STATUS
ploop
exits with status 0 in case of successful execution. Any
status greater than 0 signifies an error.
1, SYSEXIT_CREAT
Error creating a file.
2, SYSEXIT_DEVICE
Error getting or opening a ploop device.
3, SYSEXIT_DEVIOC
Error doing ioctl(2) on ploop device.
4, SYSEXIT_OPEN
Error opening a file.
5, SYSEXIT_MALLOC
Not enough memory (error from malloc(3), realloc(3), calloc(3), or posix_memalign(3)).
6, SYSEXIT_READ
Error during read.
7, SYSEXIT_WRITE
Error during write.
9, SYSEXIT_SYSFS
Error reading from a sysfs file (usually under /sys/block/ploop...).
11, SYSEXIT_PLOOPFMT
Corrupted ploop image detected.
12, SYSEXIT_SYS
Other system error.
13, SYSEXIT_PROTOCOL
Broken protocol (unexpected value received).
14, SYSEXIT_LOOP
pcopy command can’t finalize copying (frozen filesystem is changing).
15, SYSEXIT_FSTAT
Error from stat(2), fstat(2), or statfs(2).
16, SYSEXIT_FSYNC
Error from fsync(2) or syncfs(2).
17, SYSEXIT_EBUSY
Can’t continue, another operation is in progress.
18, SYSEXIT_FLOCK
Error from flock(2).
19, SYSEXIT_FTRUNCATE
Error from ftruncate(2) or truncate(2).
20, SYSEXIT_FALLOCATE
Error from fallocate(2).
21, SYSEXIT_MOUNT
Can’t mount ploop image or file system.
22, SYSEXIT_UMOUNT
Can’t unmount ploop image or file system.
23, SYSEXIT_LOCK
Locking failed (another operation in progress?).
24, SYSEXIT_MKFS
Can’t create file system.
26, SYSEXIT_RESIZE_FS
Utility resizefs failed.
27, SYSEXIT_MKDIR
Error from mkdir(2).
28, SYSEXIT_RENAME
Error from rename(2).
29, SYSEXIT_ABORT
Operation aborted.
30, SYSEXIT_RELOC
Block relocation failed.
33, SYSEXIT_CHANGE_GPT
Error resizing GPT partition table.
35, SYSEXIT_UNLINK
Error from unlink(2).
36, SYSEXIT_MKNOD
Error from mknod(2).
37, SYSEXIT_PLOOPINUSE
Image is already in use.
38, SYSEXIT_PARAM
Invalid parameter.
39, SYSEXIT_DISKDESCR
Problem with DiskDescriptor.xml file.
40, SYSEXIT_DEV_NOT_MOUNTED
Ploop image is not mounted.
41, SYSEXIT_FSCK
Error from fsck(8).