This had me going crazy. I couldn’t for the life of me figure out what was changing my root device mid-boot. It kept coming back after I removed the offending lines in the initrd and other boot scripts. I had to grep my whole boot volume looking for it. Especially confusing since I uninstalled the urbackup client from this computer months ago. This screws up the ubuntu update-grup script which sets the root volume in grub.cfg to the mapped volume, that doesn’t get mapped till after root is mounted, which causes boot to fail.
Sry, yeah, I ran into that update-grub on kernel update problem myself as well (and improved the error somewhat in that case, but wasn’t able to make grub discover the real device).
Will definitely add a remove on uninstall…
I think the only proper solution is to have the whole thing integrated in grub and/or Debian/Ubuntu.
It would be nice to maybe throw a “UrBackup setting root device to $devicename” or something like that into the system log so that if things do go screwy they’re easier to track down.
@nixcamic@uroni How exactly did you end up fixing the issue with your root device. I seem to have run into the same thing on linux mint and i really dont know enough about the boot system to figure out how to fix it.
Ran into this exact issue and am here to pay it forward with my at least partial solution. I still have not figured out how to remove whatever is creating the script in local-top so I’m going to have to run these steps every time until i can find a way to fix my update-grub… but I’ve found a way to help people get back into their device if they were stuck at initramfs like I was all day:
During boot, when grub appears, press c to access the grub command line.
If you’re somehow exactly like me and your root filesystem is on (hd0,1) and are running Linux image 6.1.0-8 on an AMD chip then type these lines exactly:
set setup-snapshot=0
set root=(hd0,1)
linux /boot/vmlinuz-6.1.0-8-amd64 root=/dev/sda1
initrd /boot/initrd.img-6.1.0-8-amd64
boot
and that should get you into your OS,
If you’re in any way different, consult below:
If you’re multibooting and want to determine what drive to use, type ls to list drive options in grub. Then you may type cat (hd0,1)/etc/issue , substituting the (hd0,1) for whatever option you’re checking. If you get something that reads similar to “Debian GNU/Linux 12 \n \l” (I’m running Debian so thats what mine says) its the right one.
If you’re not on (hd0,1) then you’ll need to change the root= value off of /dev/sda1, that value can be extrapolated from the hd value.
hd1,1 is sdb1
hd1,2 is sdb2
hd2,2 is sdc2 and so on
Find your /boot/vmlinuz by tabbing to autocomplete whatever you have in the /boot directory, same for the initrd file.
If anyone finds a way to get rid of the local-top scripts please let me know
Hi,
After installation of UrBackup agent for Linux Ubuntu I got the same error when booting into Linux Ubuntu pc.
Linux Ubuntu pc couln’t boot properly and was stuck in initramfs ash shell.
some kind of new boot partition was created which overrode all menuentries inside /boot/grub/grub.cfg, all /dev/sda3 entries were replaced by
/dev/mapper/root-96d1f8c1f425
unfortunately I couldn’t fix this issue using commands in grub because I was stuck on below error and couldn’t quite get around that
linux /boot/vmlinuz-6.5.0-35-generic root=/dev/sda3
error: can’t allocate kernel.
boot
error: you need to load the kernel first
However, steps described in this topic helped me solve my problem.
Also additional important fix is to just manually overwrite every occurrence in /boot/grub/grub.cfg of /dev/mapper/root-96d1f8c1f425 by /dev/sda3 (or other partition where is Your whole Linux filesystem)
and then try to avoid updating grub. After overwriting grub.cfg Linux will stop booting into /dev/mapper/root-96d1f8c1f425
Just in case someone else stumbles upon similar problem, here is some other useful information about grub
useful grub commands
to make it possible to scroll down in file contents using cat
set pager=1
to display all set variables
set
lsmod
displaying the drives/partitions in grub
ls
example of displaying content of partitions in grub
ls -al (hd0,1)/
example of displaying files in grub
cat (hd0,1)/boot/grub/grub.cfg