Does sysfs procfs devtmpfs mounted by kernel?

2019-09-10 03:34发布

I'm looking into systemd.

I thought systemd would mount sysfs(/sys), procfs(/proc), devtmpfs(/dev) during booting after kernel initialization.

But my systemd debugging log show that systemd doesn't mount such file systems.(it only mounts cgroups, securityfs, etc...)

By when, and whom does such file system is mounted? Does kernel mount sys, proc, dev?

2条回答
【Aperson】
2楼-- · 2019-09-10 04:01

Yes, those are mounted by systemd PID1, see src/core/mount-setup.c in the systemd sources.

查看更多
劳资没心,怎么记你
3楼-- · 2019-09-10 04:17

First point: the Linux kernel can't mount pseudo-filesystems at user-level. That's also the reason why, for example, all entries in dev/ must be created by a user-level counterpart (which does not happens for proc/ and sys/ where the kernel is capable of creating the entries on the mounted filesystem).

In Linux distributions the mounting of pseudo-filesystems is typically done at user-level by udev. Of course, the kernel must have been configured for supporting these filesystems (otherwise, mounting won't be possible).

查看更多
登录 后发表回答