This cannot be done by the bootloader or kernel. The parameter to the kernel
root option such as in
root=/dev/sda1 looks like a standard Unix pathname, but such pathnames are interpreted according to currently mounted filesystem. At the time the
root option is interpreted, there are no mounted filesystems. Well, almost none. At kernel initialization time there is an instance of a minimal
ramfs filesystem called
rootfs mounted as the root for the initial process running
start_kernel(). The actual interpretation of the
root option parameter is done in a routine called
name_to_dev_t(). One of the supported syntaxes is the
/dev/name format, where the name is interpreted by doing a temporary mount of the
sysfs filesystem in the
rootfs root, and looking for a block device entry matching name under
/sys/block. This process is explained in more detail here.
The setup as described would need to be done by first booting into a minimal environment such as one provided by an
initrd, mount the real root filesystem from
/dev/sda1 at a temporary mountpoint, e.g.
/mnt/rootfs, then change the root directory to
This is somewhat similar to how the root filesystems for LinuX Containers (LXC) are setup. LXC is an operating system-level virtualization implementation for Linux. Operating system-level virtualization is commonly used in virtual hosting environments as a lightweight alternative to full virtualization managed by a hypervisor. In operating system-level virtualization, a single operating system kernel is shared among multiple isolated user-space instances. Each instance, often called container, jail, Virtual Private Server (VPE) or Virtual Environment (VE), is essentially a separate operating system installation housed in a directory of its own on the host system.