Public bug reported: The current switch_root does a sanity check to ensure that it does not wipe out the new root filesystem by checking the device id of the parent and child directories. If they are the same, then the child directory is not considered a mount point and the contents are deleted recursively.
This presents a problem because non-block device mounted file systems such as tmpfs and ramfs both report the same device id from struct stat. Which is '0'. So if you have your to-be root filesystem contained in a non-block device (/proc/filesystems: nodev entries), it will be wiped out before chroot/execve ever happens. This can be verified by running stat against the root and to-be root filesystems in the initramfs. Releases affected = All Versions affected = All ** Affects: util-linux (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/917446 Title: switch_root does not allow switching to a non-block device as the new root filesytem To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/917446/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs