What you might want to change for future, on the kernel command line (the "options" line in your /boot/loader/entries/arch.conf file), you might want to change the "root=..." option to using UUIDs instead of something like /dev/sdb2 or /dev/sda2. This makes it so it will always be able to boot, no matter if the drive is sometimes called /dev/sda or /dev/sdb. That letter can change when you connect or disconnect drives to your PC.
About how to do this, if you currently have for example something like the following in your config file:
...
options root=/dev/sda2 ...
You would change it to something like this (I got this UUID out of that 'lsblk -f' output you shared):
Even better to give the partition a label and then use that. More human readable and now you don't have to edit the .conf if the partition ever changes
Such as when upgrading the disk for example, happened to me many times. By using a label its trivial to just set the same label on the new disk after copying all the data, and then you're off to the races again. Just gotta remember to not have two disks with the same partlabel, change its label if the old disk is staying in the system.
Your problem can be easy determined from your screenshot, because error is "kernel can't find root partition which is set in options string in arch.conf".
I have checked the fstab and it contains the accurate UUIDs. I bypass the problem by typing in the new root, but I need help with a permanent solution.
19 comments
What you might want to change for future, on the kernel command line (the "options" line in your /boot/loader/entries/arch.conf file), you might want to change the "root=..." option to using UUIDs instead of something like /dev/sdb2 or /dev/sda2. This makes it so it will always be able to boot, no matter if the drive is sometimes called /dev/sda or /dev/sdb. That letter can change when you connect or disconnect drives to your PC.
About how to do this, if you currently have for example something like the following in your config file:
You would change it to something like this (I got this UUID out of that 'lsblk -f' output you shared):
Even better to give the partition a label and then use that. More human readable and now you don't have to edit the .conf if the partition ever changes
Such as when upgrading the disk for example, happened to me many times. By using a label its trivial to just set the same label on the new disk after copying all the data, and then you're off to the races again. Just gotta remember to not have two disks with the same partlabel, change its label if the old disk is staying in the system.
Thank you... That's a valuable suggestion
You can set human-readable partlabels with cgdisk program. It will be like
options root=PARTLABEL=root_fs ...
I have the same problem occasionally. Thanks!
You can edit your fstab file.
Never mind problem solved there was an error in my /boot/loader/entries/arch.conf file
Your problem can be easy determined from your screenshot, because error is "kernel can't find root partition which is set in options string in arch.conf".
I have checked the fstab and it contains the accurate UUIDs. I bypass the problem by typing in the new root, but I need help with a permanent solution.
How about your boot cmdline? Are you specifiying the correct UUID in the 'root' parameter?
I am not sure what you mean by 'boot cmdline'. Pasting 'lsblk' and 'fstab' outputs below.
lsblk -f output
sda
├─sda1 vfat C3B5-C8F1 /boot
├─sda2 ext4 root 3bd8cf37-3f76-463e-91a4-16c60dc593c4 /
├─sda3 ext4 var 1e3c56fe-c3ab-4b6c-884b-fb3abd454a17 /var
├─sda4 ext4 home a3323ed4-31a1-4e91-8516-93b415ae70d4 /home
└─sda5 swap 34a9b5c5-666d-496d-808c-a135613b7537 [SWAP]
/etc/fstab output
/dev/sda2 LABEL=root UUID=3bd8cf37-3f76-463e-91a4-16c60dc593c4 / ext4 rw,relatime,data=ordered 0 1
/dev/sda1 UUID=C3B5-C8F1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
/dev/sda3 LABEL=var UUID=1e3c56fe-c3ab-4b6c-884b-fb3abd454a17 /var ext4 rw,relatime,data=ordered 0 2
/dev/sda4 LABEL=home UUID=a3323ed4-31a1-4e91-8516-93b415ae70d4 /home ext4 rw,relatime,data=ordered 0 2
/dev/sda5 UUID=34a9b5c5-666d-496d-808c-a135613b7537 none swap defaults 0 0
Show arch.conf
From GloriousEggroll's blog: https://www.gloriouseggroll.tv/arch-linux-efi-install-guide/
"In particular the one that has / as the mountpoint. In our case it was sda3. To add this to our boot loader we next type:
echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sdb3) rw" >> /boot/loader/entries/arch.conf
Please note it is VERY important that you type >> and NOT >, >> adds a line to a file while > overwrites the file."
This worked for me. No need to copy and paste when you can make the computer do it for you :)