<tt><font size=2>Andrei Borzenkov <arvidjaar@gmail.com> wrote on
03/11/2015 08:44:28 PM:<br>
<br>
> From: Andrei Borzenkov <arvidjaar@gmail.com></font></tt>
<br><tt><font size=2>> To: Aaron_Wright@selinc.com</font></tt>
<br><tt><font size=2>> Cc: systemd-devel@lists.freedesktop.org</font></tt>
<br><tt><font size=2>> Date: 03/11/2015 08:44 PM</font></tt>
<br><tt><font size=2>> Subject: Re: [systemd-devel] initrd mount wrongly
unmounted during bootup</font></tt>
<br><tt><font size=2>> <br>
> В Wed, 11 Mar 2015 11:26:52 -0700<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>
> </font></tt>
<br>
<br><tt><font size=2>No. initrd is a custom script I wrote, and it mounts
devtmpfs for its devices.</font></tt>
<br><tt><font size=2><br>
> > I'm using systemd-219. The logs say that var.mount is bound to
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
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>
</font></tt>
<br><tt><font size=2>I was finally able to get /var to stay mounted when
I included the local-fs.target and local-fs-pre.target units on the device.
Apparently they are used magically by systemd. I'm not sure why or how,
but it does finally work, so I'm happy. This leads to my other question
about what units are required. I'll continue on that discussion on that
thread. </font></tt>