Methods of payment Abuse

How to fix an incorrect Grub root partition name

12.10.2023, 21:53

The Grub root partition name is the path to the root partition (usually denoted as /) in the Linux operating system. Grub (GRand Unified Bootloader) is a Linux operating system bootloader that allows you to select and load operating systems at computer startup.

The role of the root partition name

When the computer boots up, Grub looks for a specified root partition that contains the operating system's main files. The root partition name is usually specified in the grub.cfg boot loader configuration file or other configuration files that are customized during the Linux operating system installation process.

The value of the Grub root partition name may vary depending on the specific configuration of your computer and the operating system installed. For example, if you have a single operating system installed, the root partition may be simply /, but if you have multiple operating systems or partitions installed, the name may be more complex, such as /dev/sda1 or /dev/nvme0n1p2. By the way, in case the error vfs unable to mount root fs on unknown block appears, very often it is due to an incorrect name of the root partition. We told you how to fix the problem here, but there is one more way.

How to fix the problem?

In many distributions, in the Grub configuration file, the root partition name is passed to the kernel in UUID format. But there is a problem with this. If you change the root partition in any way, such as changing its size, the UUID will change. And if you reboot without updating the Grub configuration, the system won't work because the kernel simply can't find the right partition.

So how do you fix the problem? If you know exactly which partition the root is on, you can fix the configuration right in the Grub menu. In the menu, use the up and down arrows to select the desired item and then press the E button. This will open the configuration editor. You need to find a line like this one:

linux /boot/vmlinuz-4.15.0-36-generic root=UUID=9d8d92de-74a6-4e64-8281-b8548c690e0c ro quiet splash $vt_handoff

Имя корневого раздела Grub

In the line, change UUID=9d8d92de-74a6-4e64-8281-b8548c690e0c to the usual root partition name, such as /dev/sda2. Press F10 to start booting. If the system boots, then that was the problem. Going forward, you can simply update the Grub configuration:

sudo update-grub

You can also tell Grub to no longer use the UUID to designate the root partition:

sudo vi /etc/default/grub

GRUB_DISABLE_LINUX_UUID=true

Корневой раздел Grub

Did the error go away, but the system still won't boot? Systemd can use the /etc/fstab file to mount file systems. And if the root file system is not correctly specified there, the system will not boot. You can use Ubuntu recovery mode. Here, too, you need to change the UUID to a normal entry or to the correct UUID.