Difference between revisions of "Ploop/sparse"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(missed closing bracket)
(more info)
Line 2: Line 2:
  
 
While ploop is never creating sparse image files, they can be accidentally made so when tools such as <code>rsync --sparse</code> or <code>cp --sparse=always</code> are used to copy images. So, one should not use backup or copy tools that create sparse files out of non-sparse ones.
 
While ploop is never creating sparse image files, they can be accidentally made so when tools such as <code>rsync --sparse</code> or <code>cp --sparse=always</code> are used to copy images. So, one should not use backup or copy tools that create sparse files out of non-sparse ones.
 +
 +
== Kernel warning ==
 +
 +
In case sparse file is detected by the kernel, it gives a warning in dmesg, for example:
 +
 +
Nov 21 20:37:27 sun kernel: [43451.057489] ploop(24002): a hole in image file detected (0)
 +
 +
In case there are no other ploop-related warnings or errors immediately after, this one is harmless ({{B|2825}}).
 +
 +
== How to fix ==
  
 
Since [[Download/ploop/1.10|ploop-1.10]], ploop images are checked for being sparse and are automatically fixed on mount, in case DiskDescriptor.xml is used. Otherwise, you can use <code>ploop check --repair-sparse</code> to check for and repair such images.
 
Since [[Download/ploop/1.10|ploop-1.10]], ploop images are checked for being sparse and are automatically fixed on mount, in case DiskDescriptor.xml is used. Otherwise, you can use <code>ploop check --repair-sparse</code> to check for and repair such images.
 +
 +
Alternatelely, you can just do something like this to get rid of holes. Make sure ploop file is not used!
 +
 +
cat root.hdd > root.hdd2 && mv root.hdd2 root.hdd
  
 
== See also ==
 
== See also ==

Revision as of 21:45, 16 December 2013

Sparse file is a file that contains blocks of zeroes that are not allocated on disk (see w:Sparse file). By design, ploop images can't contain such non-allocated blocks.

While ploop is never creating sparse image files, they can be accidentally made so when tools such as rsync --sparse or cp --sparse=always are used to copy images. So, one should not use backup or copy tools that create sparse files out of non-sparse ones.

Kernel warning

In case sparse file is detected by the kernel, it gives a warning in dmesg, for example:

Nov 21 20:37:27 sun kernel: [43451.057489] ploop(24002): a hole in image file detected (0)

In case there are no other ploop-related warnings or errors immediately after, this one is harmless (#2825).

How to fix

Since ploop-1.10, ploop images are checked for being sparse and are automatically fixed on mount, in case DiskDescriptor.xml is used. Otherwise, you can use ploop check --repair-sparse to check for and repair such images.

Alternatelely, you can just do something like this to get rid of holes. Make sure ploop file is not used!

cat root.hdd > root.hdd2 && mv root.hdd2 root.hdd

See also