Article ID: 118708, created on Nov 18, 2013, last review on Jun 17, 2016

  • Applies to:
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor


Is it possible to create byte-to-byte copy of container's underlying device using dd utility?


It's impossible with vzfs-based containers (containers running over /dev/vzfs), but possible with ploop-based containers (running over /dev/ploopXXXXXp1).

vzfs-based container

Device /dev/vzfs is only available from inside of a container, while on the Hardware Node side it doesn't exist, it's a dummy device. From HN perspective it's only a bindmount:

[root@vz ~]# cat /proc/mounts | grep 6000 | grep vzfs
/vz/template:/vz/private/6000/fs /vz/root/6000 vzfs rw,relatime,usrquota,grpquota,/vz/template:/vz/private/6000/fs 0 0

Since device itself doesn't exist - it's impossible to access it with dd (which is meant to operate with files\block devices).

If you need to create a copy of vzfs-based container you can use one of the following methods:

  1. Create .tar-archive of container's private area (container should be stopped first):

    [root@vz ~]# tar -czf CTID.tgz /vz/private/CTID

    NOTE: If resulting archive is intended to be unpacked on another host it's necessary to have template area in sync between source and destination hosts.

  2. Create clone of the container:

    [root@vz ~]# vzmlocal -C <CTID>:<new_CTID>

ploop-based container

For ploop-based containers However, this is possible on Parallels Cloud Server, where vzfs concept is replaced with ploop devices, but only if you explicitly provide your client with control over his ploop device:

  1. Find out what ploop device it is:

    [root@pcs ~]# cat /proc/mounts | grep 721
    /dev/ploop23551p1 /vz/root/721 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
  2. Provide access to the device:

    [root@pcs ~]# vzctl set 721 --devnodes ploop23551p1:rw --save
    Setting permissions 60007 dev 0x5e60b6b1
    Saved parameters for Container 721

    NOTE: you may provide "read only" access to ploop in order to avoid damage, "rw" is used only as an example.

  3. Create the image:

    [root@pcs ~]# vzctl enter 721
    entered into Container 721
    CT-721-bash-4.1# su -
    [root@container ~]# ls -la /dev/ploop*
    brw----r-x 1 root root 182, 386737 Nov 11 22:34 /dev/ploop23551p1
    [root@container ~]#  dd if=/dev/ploop23551p1 of=/root/myimage bs=1M count=1
    1+0 records in
    1+0 records out
    1048576 bytes (1.0 MB) copied, 0.000552581 s, 1.9 GB/s

Search Words






a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF