Sysfs layouts

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search

This page describes what problems can you have with sysfs


Sysfs can exist in two layouts. They are selected by the CONFIG_SYSFS_DEPRECATED_V2 config option. There are two main differences between them

  1. block devices are stored in the /sys/block or in the /sys/class/block
  2. some devices live in the /sys/devices or in the /sys/class

Although sysfs puts symlinks between old and new entries where possible, not all userspace can work with it.

Known issues[edit]

Old nash on new layout[edit]

Nash is a small shell used on initrd/initramdisk-s to boot the system.

With the new sysfs layout (i.e. the option is question is not set) the old nash tool (such as the one used in CentOS-5) cannot recognise the block devices. This results in inability to mount the root filesystem.

To workaround the issue you should turn the deprecated layout on in .config and rebuild the kernel. All OpenVZ kernel prior to 2.6.27 (and including one) are build with this layout.

New udev on old layout[edit]

With the old sysfs layout (i.e. with the option set to y) the udev used in newer distros (such as FC12) prints a warning about the old layout used.

Currently this doesn't bring any problems to user, but in future situation may change.

To workaround the issue you should turn the deprecated layout off in .config and rebuild the kernel.

Dynamic selection[edit]

In 2.6.32 OpenVZ kernel there's a boot option called old_sysfs which turns the deprecated layout on at boot. This one is off by default, so if you're using the 2.6.32 kernel on old distro, you should probably boot it with the option in question set.