<tt><font size=1>I applied commit 628c89cc68ab96fce2de7ebba5933725d147aecc
- core: rework device state logic, but now I'm left with a random chance
to boot or not.</font></tt>
<br>
<br><tt><font size=1>Some boots it comes up with "/var mounted"
and lots of nice colored "[ OK ]"s.</font></tt>
<br>
<br><tt><font size=1>Some boots it comes up with "Unit var.mount is
bound to inactive unit /dev/mapper/<name>. Stopping, too." and
no colored "[ OK ]"s and about half the logs; only the "systemd[1]"
messages, and it just hangs at some point; it never reaches the default
target.</font></tt>
<br>
<br><tt><font size=1>I create /dev/mapper/<name> in initrd with cryptsetup,
and then mount it to /newroot/var before switching root to /newroot and
running systemd. I don't use systemd in initrd.</font></tt>
<br>
<br><tt><font size=1>Am I going about this wrong? What am I doing wrong
here? What is the best way to mount /var in initrd and make systemd happy?</font></tt>
<br>
<br>
<br><tt><font size=1>PS - I also added a commit to log what the inactive
unit was.</font></tt>
<br>
<br><tt><font size=1>"Aaron Wright" <Aaron_Wright@selinc.com>
wrote on 03/12/2015 08:42:15 AM:<br>
> Andrei Borzenkov <arvidjaar@gmail.com> wrote on 03/11/2015 08:44:28
PM:<br>
> > Aaron_Wright@selinc.com пишет:<br>
> > <br>
> > > I'm working with an embedded device that mounts / and /var
in initrd. It <br>
> > > then switches root and fires up systemd. Early in the boot,
after paths <br>
> > > target, /var gets unmounted. I want systemd to not do that,
but I can't <br>
> > > figure out how to stop it.<br>
> > > I would like systemd to leave /var mounted, but still unmount
it during <br>
> > > shutdown. I would rather not move the mounting of /var out
of initrd. Is <br>
> > > this possible?<br>
> > > I'm trying to use a very stripped down systemd. As minimal
as possible. <br>
> > <br>
> > Do you use udev in initrd?<br>
> > <br>
> <br>
> No. initrd is a custom script I wrote, and it mounts devtmpfs for
its devices.<br>
> <br>
> > > I'm using systemd-219. The logs say that var.mount is bound
to <br>
> an inactive <br>
> > > unit, and it is stopping too. I assume that is why /var
gets unmounted, <br>
> > > but I don't know what to do to stop it. There is no /etc/fstab
<br>
> file. There <br>
> > > is no var.mount file.<br>
> > > I assume I'm either missing something simple, or it is not
possible.<br>
> > <br>
> > Did you try this commit?<br>
> > <br>
> > <br>
> > commit 628c89cc68ab96fce2de7ebba5933725d147aecc<br>
> > ...snip...<br>
> > <br>
> <br>
> I was finally able to get /var to stay mounted when I included the
<br>
> local-fs.target and local-fs-pre.target units on the device. <br>
> Apparently they are used magically by systemd. I'm not sure why or
<br>
> how, but it does finally work, so I'm happy. This leads to my other
<br>
> question about what units are required. I'll continue on that <br>
> discussion on that thread. </font></tt>
<br><tt><font size=1><br>
</font></tt>