<div dir="ltr">The error that I get is:<div><br></div><div><div>(00.048051)      1: Error (files-reg.c:862): Can&#39;t open file dev/null on restore: No such file or directory</div></div><div><br></div><div>In my case, I think that files in /dev are manually created by Docker *after* the filesystem is set up.  IOW, they are not part of the AUFS or UnionFS branches.  When we dump the process, causing it to exit, the filesystem is dismantled.  Right now, I am re-creating the filesystem before restore so I have to do the same thing that Docker does (i.e., creating /dev/null).  Once there is native support in Docker for dump and restore, Docker itself would set up the filesystem before calling criu to restore, and this problem will go away.</div>
<div><br></div><div>Haven&#39;t had time to dig deeper.  But does the above explanation make sense to you?</div><div><br></div><div>--Saied</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Aug 28, 2014 at 9:07 AM, Pavel Emelyanov <span dir="ltr">&lt;<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 08/28/2014 07:43 PM, Saied Kazemi wrote:<br>
&gt; I have seen a similar case where /dev/null is missing (Docker using UnionFS).  While this patch fixes<br>
&gt; the issue, I am wondering why the target file should be missing to start with and whether *always*<br>
&gt; recreating missing target files could be masking more serious issues.  Any thoughts?<br>
<br>
</div>+1  I&#39;d also like to know the reasons why the mountpoint target doesn&#39;t exist.<br>
AFAIK rmdir/unlink doesn&#39;t work on dirs/files that are mountpoints.<br>
<br>
&gt; --Saied<br>
<div class="">&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Aug 28, 2014 at 8:27 AM, Tycho Andersen &lt;<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a> &lt;mailto:<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a>&gt;&gt; wrote:<br>

&gt;<br>
&gt;     If the target of a bind mount doesn&#39;t exist, create it. In particular, this<br>
&gt;     happens with /dev/ptmx across hosts under LXC. We could also mkdir -p any path<br>
&gt;     to the target, although I&#39;m not sure if that is a case that occurrs in the<br>
&gt;     wild.<br>
&gt;<br>
</div>&gt;     Signed-off-by: Tycho Andersen &lt;<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a> &lt;mailto:<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a>&gt;&gt;<br>

<div><div class="h5">&gt;     ---<br>
&gt;      mount.c | 18 ++++++++++++++++++<br>
&gt;      1 file changed, 18 insertions(+)<br>
&gt;<br>
&gt;     diff --git a/mount.c b/mount.c<br>
&gt;     index 9bb8a17..2108907 100644<br>
&gt;     --- a/mount.c<br>
&gt;     +++ b/mount.c<br>
&gt;     @@ -1346,6 +1346,24 @@ static int do_bind_mount(struct mount_info *mi)<br>
&gt;                     root = rpath;<br>
&gt;      do_bind:<br>
&gt;                     pr_info(&quot;\tBind %s to %s\n&quot;, root, mi-&gt;mountpoint);<br>
&gt;     +<br>
&gt;     +               if (access(mi-&gt;mountpoint, F_OK)) {<br>
&gt;     +                       if (errno == ENOENT) {<br>
&gt;     +                               FILE *f;<br>
&gt;     +<br>
&gt;     +                               f = fopen(mi-&gt;mountpoint, &quot;w&quot;);<br>
&gt;     +                               if (!f) {<br>
&gt;     +                                       pr_perror(&quot;couldn&#39;t write 0 length %s&quot;, mi-&gt;mountpoint);<br>
&gt;     +                                       return -1;<br>
&gt;     +                               }<br>
&gt;     +<br>
&gt;     +                               fclose(f);<br>
&gt;     +                       } else {<br>
&gt;     +                               pr_perror(&quot;Couldn&#39;t access %s&quot;, mi-&gt;mountpoint);<br>
&gt;     +                               return -1;<br>
&gt;     +                       }<br>
&gt;     +               }<br>
&gt;     +<br>
&gt;                     if (mount(root, mi-&gt;mountpoint, NULL,<br>
&gt;                                             MS_BIND, NULL) &lt; 0) {<br>
&gt;                             pr_perror(&quot;Can&#39;t mount at %s&quot;, mi-&gt;mountpoint);<br>
&gt;     --<br>
&gt;     1.9.1<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     CRIU mailing list<br>
</div></div>&gt;     <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a> &lt;mailto:<a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a>&gt;<br>
&gt;     <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; CRIU mailing list<br>
&gt; <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
&gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>