Skip to content

libmount utab mount options get lost when we switch root, and thus x-initrd.mount vanishes during initrd transitions #15266

@fbuihuu

Description

@fbuihuu

x-initrd.mount (for instance) is used for setting mounts up in initrd. This "application" option is recorded in "utab" so applications (such as systemd) can figure out later which application options have been used for a given mount.

However in initrd, mount points described in fstab are usually mounted under /sysroot, therefore mount paths in utab are usually prefixed with "/sysroot". A typical entry in utab looks like:

SRC=/dev/vdb1 TARGET=/sysroot/mnt ROOT=/ OPTS=x-initrd.mount,_netdev

The problem appears after swithing to the main system: PID1 tries to retrieve the mount options (via mnt_fs_get_options()) for /mnt (not /sysroot/mnt) but nothing is found since the relevant entry has TARGET=/sysroot/mnt.

The previous example is based on x-initrd.mount but the issue can also happen with any other x-* options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingnot-our-bugpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions