Does sysfs procfs devtmpfs mounted by kernel?

醉酒当歌 提交于 2019-12-25 05:50:05

问题


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?


回答1:


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




回答2:


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).



来源:https://stackoverflow.com/questions/34306899/does-sysfs-procfs-devtmpfs-mounted-by-kernel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!