21.04 won't start from grub

anneranch

Active Member
Credits
1,078
I am puzzled by daily Ubuntu updates and still getting "system problem " on start-up.

Here is my best recollection what is happening.
I chose to update /upgrade ONE on my multitboot OS.
I got impatient with the snail pace of the upgrade so I "sudo reboot -f"
Now when I select in "grub" my original , working OS, it wants to "insert bootable device..."
So I run "recovery " -> check files -> go back to normal boot ....
That works as expected and runs the OS.

BUT
I have to run recovery, on EVERY boot!

questions:

Why / how is this happening ?
How can I get back to normal "grub" operation ?
Should I run "grub update " ?
 


kc1di

Well-Known Member
Credits
2,342
You should never interrupt an upgrade if possible. when you get in next time run this command in a terminal see if it fixes it. sudo dpkg --configure -a
 

Alexzee

Well-Known Member
Credits
9,213
I agree with kc1di, interrupting and upgrade is not a good practice.
Try the command he gave you to run and see if that helps.

IF that doesn't fix it you may need boot repair.

 

anneranch

Active Member
Credits
1,078
[email protected]:~$ sudo dpkg --configure -a
[sudo] password for qe:
[email protected]:~$

Now this looks suspicious , the command returns immediately .

I did update -grub with same results.
(on both OS )
Now I have several options
( BTW can anybody suggest how to make a hard copy of "grub " menu ?)

main /dev/sda6 which returns cannot find some file - name is irrelevant

then I have advanced options
again single /dev/sda6 gives same - no such file


then I have two more single options
I am using the first one - for now , and it eventually runs the correct OS
Using options which actually do something - for example "repair packages" made no difference.

Here are my basic questions

1. how did stopping upgrade in DIFFERENT OS caused this ?
I do not expect an answer , opinions / guesses are fine but won't be necessary
They do not not solve the issue .
2. if whatever file is missing, for whatever reason - why it remains in "grub" even after
update-grub has been run several times?
( and it is not the fastest Linux utility - it definitely has an issue with scanning large hard drives - 2 and more TB . )

Cheers
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
18,364
A couple of quick questions for you -

1. What is the name and version of the other OS, and is it just the 2 Linux on the box, or Windows as well?
2. Do you have Timeshift installed on either of the Linux Distros?

I have to go out in an hour but I will return.

Wizard
 

anneranch

Active Member
Credits
1,078
I am using only Linux Ubuntu in mutiboot configuration.
The failing one is 21.04 , so was the one I was upgrading and stopped it. It has been upgraded again.
I am very paranoid and do not want to go thru full OS reinstall ever again. So I an trying to keep two copies of OS with all the packages I keep adding when neccessry.
It sort of works.

The key is - I can keep my data from disappearing (RAID) , but I have not found a way to "backup entire OS" .
Adding OS to RAID array did not work.

That is why I have a multuboot of Linux, no Windoze.

NO Timeshift installed on ANY of the Linux Distros
 

kc1di

Well-Known Member
Credits
2,342
Did you install 21.04 after the other distro and was it the distro you were upgrading?
The last one you install usually controls grub.
 

anneranch

Active Member
Credits
1,078
Did you install 21.04 after the other distro and was it the distro you were upgrading?
I was using /dev/sda6 and it always started normal from grub.
I rebooted to /dev/sda? and after it started did "upgrade" on it.
Got frustrated with the pace and did "shutdown"
After PC power went down ... repowered.
Then after selecting /dev/sda6 grub complained it could not find the file
after I managed to restart /dev/sda6 I did
dd if=/dev/sda6 of=dev/sda22 and went to bed ...
that was an attempt to save /dev/sda6 OS

next morning any attempt to start /dev/sda6 ends up running /dev/sda22

I did several update-grub with same results.

Basically trying to make a duplicate of /dev/sda6 was sort of success - but now I cannot run /dev/sda6 from grub.

I did try timeshift , it looks a way to duplicate OS, but did not select specific partition - so it obviously run out of space ....
I;ll try "timeshift"on both /dev/sda6 and /dev/sda22

The last one you install usually controls grub.

So does "update / upgrade " when it feels like it.
yes, that is very frustrating - running update-grub skips the OS it is running on - somewhat obvious , but ...
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
18,364
OK thanks for that info. So we have two (2) iterations of Ubuntu 21.04 'Hirsute Hippo' on your system, configured in a RAID setup. One is on /dev/sda6 and the other on /dev/sda22. (Correct me if I get anything incorrectly).

/dev/sda6 was the one you were upgrading, and you interrupted the process, which generated the current difficulties with your Grub Menu and access in general.

You can access /dev/sda6 with difficulty, through Recovery Option taken through Advanced Options on the Grub Menu, and get a session going, and from there you are communicating with us.

I may be incorrect a little with the first paragraph because you have said

after I managed to restart /dev/sda6 I did
dd if=/dev/sda6 of=dev/sda22 and went to bed ...
that was an attempt to save /dev/sda6 OS
So the 2nd Ubuntu may reside on a different partition or drive, can you tell us about that?

I take it you are aware that Ubuntu 21.04 is a point release, that is it only has support for 9 months, ending in January 2022. The last LTS (Long Term Support Release) was 20.04, valid for 5 years, and the next scheduled is April next with 22.04.

I have to take a couple of hundred kilometres (Road Trip -added, Wiz) on my Saturday morning, so I have a few suggestions to tide you over until I return, but by all means take what assistance you can get, meantime. :)

SUGGESTIONS

1. You could let us know whether you have a Home folder within your Ubuntu partition, or a discrete Home Partitition. In either case, from a working Ubuntu session, I would take a backup of it using the inbuilt Backup utility Ubuntu provides. Preferred destination would be to another Drive or to an external source.

I have to leave now, but have more suggestions tomorrow.

Cheers

Wizard
 
Last edited:

kc1di

Well-Known Member
Credits
2,342
This page may be of help I would run it on sda6 first see if it works. Ubuntu Handbook
Other alternative would be to use the live Dvd/usb to copy all important files to a seperate external source or use the backup utility to do that. and do a complete reinstall.
Good Luck.
 

anneranch

Active Member
Credits
1,078
Here is a little more to add to the mess.
1. Somewhere, very basic, I have read that sdx numbers are subject to change.
on grub menu I have /dev/sda6 which was perfectly working OS
2. Using advanced setting on grub I select /dev/sda6 - with Linux number ending with 22
That runs OS BUT "df" reports it is running "/dev/sda22"
3. sda22 is where dd output file was selected ''

That is one of the miseries - simply put
if grub option is "sda6" , so how do I end up running "sda22 "

In some obscure way sda22 t was last OS installation

4. Initially I did not identify the failing Linux version
It is many digits # but the important part is
main sda6 and one of the advanced options fails because it cannot find
Linux version ending with 25
5. Assuming the "25" is the latest as far as Ubuntu goes

How did it get lost?
And most importantly - how do I get it back ?
update / upgrade does not get it back


After mess like this I usually end up installing clean OS using USB stick with ISO.
And that is how I loose all the packages installed recently and working on the LAST good OS.
 

anneranch

Active Member
Credits
1,078
I have downloaded clean 21.04 both to USB stick and to my current /dev/sda
I now have a clean OS on sda25 and it uses Linux image xx -yy -zz ending with #25 .
Same issue - /dev/sda6 will only run with image # 20.
Somehow /sda6 lost an access to image ending with # 25 and I cannot get it back.

I am not sure I be able to gain acess to my data (RAID) with either sda25 OS or
with sda6 using older version of Linux.

Just FYI
installing clean OS on USB stick is a royal pain - it takes forever and executing OS from such USB stick is no better as far as speed goes.
I have three >2TB HDD and removing two of them made installing OS from USB ISO stick little , but noticeably , faster.

BTW
Personally - I like to learn more about how "modern" software scans disks for files.
I can see noticeable speed search difference between installing from ISO which does look for "multiple OS " on HDD and speed of gparted which looks for partitions
(Not a complaint - I really like to learn)
 

anneranch

Active Member
Credits
1,078
This page may be of help I would run it on sda6 first see if it works. Ubuntu Handbook
Other alternative would be to use the live Dvd/usb to copy all important files to a seperate external source or use the backup utility to do that. and do a complete reinstall.
Good Luck.
Well it is a same old story - how do you "backup" data from different application?
I will not post a list of them...
So far my "solution" is to have "important files " on RAID and just manually copy entire folders, almost daily.

And again , as in this case - how do you backup entire OS so when it bombs like this one did you do not loose an array of packages ?

I just build a simple HF circuit in EAGLE / spice and it is gone....

Of course partially because Windowze / Wine puts stuff in drives and Linux wants it in folders.
Perhaps another post after I get this resolved.

PS
I did check the link.
I am not sure if mounting the faulty sda6 is the problem.
And I did do several update-grub and it did not change a thing.
Perhaps I am overanalysing the problem and should just try as the link did -
I got nothing to loose.


ADDENDUM
Here is my LAST update-grub mainly posted for those who (desperately) NEED to know EXACT
number of Linux image file.
I should see all /dev/x in grub menu , with an execptiuon of the last installed - sda25

grub found all including "25" but sda6 cannot connect with it.

[email protected]:~$ sudo update-grub
[sudo] password for qe:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
/usr/bin/grub-editenv: error: invalid environment block.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.0-25-generic
Found initrd image: /boot/initrd.img-5.11.0-25-generic
Found linux image: /boot/vmlinuz-5.11.0-22-generic
Found initrd image: /boot/initrd.img-5.11.0-22-generic
Found linux image: /boot/vmlinuz-5.11.0-17-generic
Found initrd image: /boot/initrd.img-5.11.0-17-generic
Found Ubuntu 21.04 (21.04) on /dev/sda25
Found Ubuntu 21.04 (21.04) on /dev/sda3
Found Ubuntu 21.04 (21.04) on /dev/sda6
Found Ubuntu 21.04 (21.04) on /dev/sdb2
Found Ubuntu 20.10 (20.10) on /dev/sdb20
Found Ubuntu 21.04 (21.04) on /dev/sdb22
Found Ubuntu 21.04 (21.04) on /dev/sdb24
Found Ubuntu 21.04 (21.04) on /dev/sdc31
Found Ubuntu 21.04 (21.04) on /dev/sdc32
Found Ubuntu 21.04 (21.04) on /dev/sdc6
Adding boot menu entry for UEFI Firmware Settings
done
[email protected]:~$


So I rebooted and expected to see all OS in grub menu .
No so , only dev/sdax, and grub run sda25 - as default , as expected .

The question is - why update-grub finds ALL Ubuntu OS
on ALL HDD and grub menus does not show all?

Could this be a problem indicator ?

/usr/bin/grub-editenv: error: invalid environment block.

Can that file be edited ? (let me try )
No silly - its binary file
 
Last edited:

anneranch

Active Member
Credits
1,078
BUMP

I would like to rephrase the question:
Facts:

These image files exists , per grub
Found linux image: /boot/vmlinuz-5.11.0-25-generic
Found initrd image: /boot/initrd.img-5.11.0-25-generic

OS located on /dev/sda6 cannot find then - click on "normal " selection in grub or in advanced selection gives "no kernel found..." ERROR .


using
Found linux image: /boot/vmlinuz-5.11.0-22-generic
Found initrd image: /boot/initrd.img-5.11.0-22-generic
on /dev/sda6 works as expected

Is there away to "upgrade" /dev/sda6 OS to
linux image: /boot/vmlinuz-5.11.0-25-generic
nitrd image: /boot/initrd.img-5.11.0-25-generic

Due to difficulty with some form members preferring to get of the SUBJECT , please only

YES - AND THIS IS HOW ....


NO JUST FORGET IT!


Thanks for understanding
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
18,364
YES - AND THIS IS HOW ....

NO JUST FORGET IT!
There is a 3rd alternative -

A. Why? There is no need to do any of that, it will not help your situation.

The answers that follow, if you choose to take the steps involved, will sort everything out.

Next Post or two I will pick up from where I left off.

However, there are questions I have asked which you have left unanswered, and they are -

1.
I may be incorrect a little with the first paragraph because you have said

So the 2nd Ubuntu may reside on a different partition or drive, can you tell us about that?
2.
I take it you are aware that Ubuntu 21.04 is a point release, that is it only has support for 9 months, ending in January 2022. The last LTS (Long Term Support Release) was 20.04, valid for 5 years, and the next scheduled is April next with 22.04.
... an info comment, certainly, but invites a response.

3. this from Suggestion 1.

You could let us know whether you have a Home folder within your Ubuntu partition, or a discrete Home Partitition. In either case, from a working Ubuntu session, I would take a backup of it using the inbuilt Backup utility Ubuntu provides. Preferred destination would be to another Drive or to an external source.
Most recently, you have said

using
Found linux image: /boot/vmlinuz-5.11.0-22-generic
Found initrd image: /boot/initrd.img-5.11.0-22-generic
on /dev/sda6 works as expected
...so if by doing that you are getting a working environment, stick with using, in Advanced Options
the 5.11.0-22-generic kernel, then use that for now and we will resolve all the other problems as we can.

I have to take a 500 km road trip tomorrow for my wife's medical appointments, so I may not be available again until my Tuesday.

The line from your update-grub output

/usr/bin/grub-editenv: error: invalid environment block.
... is because you interrupted your updates prematurely, perhaps while it was updating grub. Something you should not do again in a hurry. It can adversely compromise a file called

grubenv

in your /boot/grub/

I do not guarantee the following, but if you cannot wait until I get back, the following MIGHT resolve that.

Before any attempt to do so, safeguard your valuable data by plugging in one of those 2 TB drives we have only just learned about, format a sizable partition and use the Ubuntu backups solution to backup /home/qe to the new partition on the 2 TB drive.

If you can't access Backups by clicking an icon in Show Applications (9 dots in a square shape) without the computer going on the fritz, open a Terminal with Ctrl-Alt-t and type in and enter

Code:
deja-dup
STEPS

1. At the grub boot menu, choose Advanced Options and then choose the Recovery option line using 5.11.0-25-generic kernel reference

2. Arrow down to a line saying something like "Drop to Root Shell" so it is highlighted, then use Tab to highlight OK and press Enter, this will drop you to a prompt, where you will be root (no need for sudo).

If this is in /dev/sda6, you can check that you are by entering

Code:
lsblk
and where there is a / that is where you are rooted to.

Then type and enter the following

Code:
cd /boot/grub
cp grubenv grubenv_save
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
grub-editenv grubenv list
update-grub
reboot
and report back (if you can :)) with how it went.

I have not the time right now to duplicate your situation so there is no guarantee this will temporarily fix your situation - your choice.

When I get back, I will outline a blow-by-blow on a long-term resolution to your problems, and it will involve blowing away the RAID setup, which is clearly not implemented correctly, and reinstalling, and then making correct use of Timeshift to in future, resolve such problems with a few clicks.

And if you have the time, start reading my Thread here

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/

because that is where we will deal with Timeshift safeguards.

Don't bump - it's rude and you won't get answers any faster.

Cheers

Wizard

BTW - edited backup instructions omitted previously. Regrets on delay.
 
Last edited:

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
18,364
Just a note to the above, missed something in my haste

If you can't access Backups by clicking an icon in Show Applications (9 dots in a square shape) without the computer going on the fritz, open a Terminal with Ctrl-Alt-t and type in and enter
should have at the end

Code:
deja-dup
I have edited the Post.

Wizard
 

anneranch

Active Member
Credits
1,078
Well, I really appreciate you sticking with the problem.
I tried to clean-up a decent size partition to do the backup.
gparted did not cooperate - would not let me delete "busy" partition.
I ended up attaching my first backup to another , large , folder.
I did follow the instruction and removed / edited the grub related file.
That got rid of the "enviroment" issue, but after reboot grub still cannot find the -25 version.

I think the only way to recover will be another version of Ubuntu - after 21.04
 

Alexzee

Well-Known Member
Credits
9,213
Hmm... Have you tried 'boot-repair'? The automated repair is usually pretty good at finding any existent OSes and fixing grub.
I suggested boot repair in the beginning.
It can't hurt to try it, if it fails than that's more information we and OP have to think over.

If this were my machine I would back up everything and perform a fresh installation.
Halting a upgrade is never a good practice as I'm sure you will agree.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Credits
28,392
Halting a upgrade is never a good practice as I'm sure you will agree.
I really can't think of a good reason to do so and I missed the boot-repair recommendation. I wonder if they tried. It's surprisingly successful in many situations and, if not, it has a great report you can share with us to help diagnose the issue. It's actually one of the first tools I'd reach for in this situation.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top