Skip to contentSkip to conversation

when to remount sysfs ?

DISCUSSION ishare 2 participants 2 messages May 5, 2013 – May 6, 2013

lore
Share & tools
lore

ishare

author
#0 lore raw

Hi:

As i know , when kernel is booting , sysfs is mounted at /sys before the real root fs is mounted .

Then , after the real root fs is mounted , when does i need to remount sysfs at the new /sys location ?

I know the devfs is remounted by do_mount ("none", "/dev", "devfs", 0, "") , so how is that for sysfs?

Thanks!

#1 lore raw
Quoted 7 lines · ishare

Hi:

As i know , when kernel is booting , sysfs is mounted at /sys before the real root fs is mounted .

Then , after the real root fs is mounted , when does i need to remount sysfs at the new /sys location ?

I know the devfs is remounted by do_mount ("none", "/dev", "devfs", 0, "") , so how is that for sysfs?

It depends on initramfs, for example switch_root(8) command from util-linux or "systemctl switch-root" (systemd reimplementation) moves /dev, /proc, /sys and /run to the new root by MS_MOVE mount(2) operation.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com