Difference between revisions of "External bind mounts"

From CRIU
Jump to navigation Jump to search
(Created page with "Typical external resource when dumping a container (especially LXC/Docker) -- is a mount point whose root sits outside of the container's root. This situation was intended to ...")
 
Line 17: Line 17:
  
 
The columns 4 and 5 are root and mountpoint respectively. You can see, that the / is /root file from /dev/sda1 device and /bar file is a mountpoint with the root being /foo file from the same device.
 
The columns 4 and 5 are root and mountpoint respectively. You can see, that the / is /root file from /dev/sda1 device and /bar file is a mountpoint with the root being /foo file from the same device.
 +
 +
== How to teach CRIU to dump them ==
 +
 +
By default CRIU doesn't dump such mountpoints, because there's no way CRIU will be able to restore it -- the root of these mounts is out of the scope of what CRIU dumped. In the logs you would see the message like
 +
 +
34:/bar doesn't have a proper root mount
 +
 +
which will mean, that the mountpoint /bar has inaccessible root.

Revision as of 12:54, 17 June 2014

Typical external resource when dumping a container (especially LXC/Docker) -- is a mount point whose root sits outside of the container's root. This situation was intended to be resolved using plugins but turned out to be so frequent, that we introduced a non-plugin way of handling them.

What is external bind mount

The way to create such is simple as

mkdir /root
mount --bind /foo /root/bar
chroot /root

This is it. From now on, the /bar file is a mountpoint whose root (the source) is not accessible directly.

If you look at the /proc/$pid/mountinfo file of a task seeing such you would see smth like

11 23 8:3 /root / ... - ext4 /dev/sda1 ...
23 34 8:3 /foo /bar ... - ext4 /dev/sda1 ...

The columns 4 and 5 are root and mountpoint respectively. You can see, that the / is /root file from /dev/sda1 device and /bar file is a mountpoint with the root being /foo file from the same device.

How to teach CRIU to dump them

By default CRIU doesn't dump such mountpoints, because there's no way CRIU will be able to restore it -- the root of these mounts is out of the scope of what CRIU dumped. In the logs you would see the message like

34:/bar doesn't have a proper root mount

which will mean, that the mountpoint /bar has inaccessible root.