[systemd-devel] How many times is the root mounted in boot up?

Mantas Mikulėnas grawity at gmail.com
Mon Jun 1 10:43:24 PDT 2015


On Mon, Jun 1, 2015 at 5:56 PM, cee1 <fykcee1 at gmail.com> wrote:

> Hi all,
>
> In case of no initrd and mounting the root by specifying
> "root=/dev/sdaN" in kernel command line, how many time is the root
> mounted in systemd?
>

It's only mounted once, by the kernel. systemd won't mount it again, it
doesn't need to. It will however _remount_ it if needed, to apply the new
options like rw.

I find:
> 1. systemd will generate a "-.mount" unit from /proc/self/mountsinfo
> 2. systemd will generate a "-.mount" unit by systemd-fstab-generator
>
> Q:
> * Which one takes priority?
>

The latter, because it's a real unit, not just an in-memory representation
of the current state.


> * For 1, it will not do the mount action, but 2 will. Am I right? If
> so, why we mount root here(again)?
>

No. If it's already mounted, then it's mounted.


> And systemd-remount-fs.service will remount the root again, thus apply
> options in fstab?
>

Yes, such as rw.


> BTW, where are the units generated by generators?
>

/run/systemd/generator*/

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150601/7bc5b1ee/attachment.html>


More information about the systemd-devel mailing list