Next: , Previous: , Up: Configuration   [Contents][Index]


6.2 Root Identifcation Heuristics

If the target operating system uses the Linux kernel, grub-mkconfig attempts to identify the root file system via a heuristic algoirthm. This algorithm selects the identification method of the root file system by considering three factors. The first is if an initrd for the target operating system is also present. The second is ‘GRUB_DISABLE_LINUX_UUID’ and if set to ‘true’, prevents grub-mkconfig from identifying the root file system by its UUID. The third is ‘GRUB_DISABLE_LINUX_PARTUUID’ and if set to ‘true’, prevents grub-mkconfig from identifying the root file system via the UUID of its enclosing partition. If the variables are assigned any other value, that value is considered equivalent to ‘false’. The variables are also considered to be set to ‘false’ if they are not set.

When booting, the Linux kernel will delegate the task of mounting the root filesystem to the initrd. Most initrd images determine the root file system by checking the Linux kernel’s command-line for the ‘root’ key and use its value as the identification method of the root file system. To improve the reliability of booting, most initrd images also allow the root file system to be identified by its UUID. Because of this behavior, the grub-mkconfig command will set ‘root’ to ‘root=UUID=...’ to provide the initrd with the filesystem UUID of the root file system.

If no initrd is detected or ‘GRUB_DISABLE_LINUX_UUID’ is set to ‘true’ then grub-command will identify the root filesystem by setting the kernel command-line variable ‘root’ to ‘root=PARTUUID=...’ unless ‘GRUB_DISABLE_LINUX_PARTUUID’ is also set to ‘true’. If ‘GRUB_DISABLE_LINUX_PARTUUID’ is also set to ‘true’, grub-command will identify by its Linux device name.

The following table summarizes the behavior of the grub-mkconfig command.

Initrd detectedGRUB_DISABLE_LINUX_PARTUUID Set ToGRUB_DISABLE_LINUX_UUID Set ToLinux Root ID Method
falsefalsefalsepart UUID
falsefalsetruepart UUID
falsetruefalsedev name
falsetruetruedev name
truefalsefalsefs UUID
truefalsetruepart UUID
truetruefalsefs UUID
truetruetruedev name

Remember, ‘GRUB_DISABLE_LINUX_PARTUUID’ and ‘GRUB_DISABLE_LINUX_UUID’ are also considered to be set to ‘true’ and ‘false’, respectively, when they are unset.


Next: , Previous: , Up: Configuration   [Contents][Index]