Every time I do a clean install, it always corrupts the following Monday, then can only boot via grub menu

Asked by Paul Reddy

Why can I only boot via the grub menu after clean install once a new week has started (Monday). Also getting update failed because of grub issues!

I'm having all sorts of problems XSane scanner software won't install, can't get the scanner to be seen by programs, printer (Cannon MP280) won't work.

But the main problem is the grub menu issue. I think it might have something to do with the fact that I'm booting from a 2.5" SSD attached via a ASMedia PCIe card? ubuntu seem's to like removing support for hardware that's more than a few years old, surely this is not a good idea given the current and future trend for keeping hardware going for long periods of time and stopping this disposable culture as it is very damaging to the environment.....

Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Paul Reddy (paulreddy) said :
#2

This is the same issue as with the bug report I uploaded. No matter what day of the week I do a clean install, the following Monday I get the same refusal to boot normally, from then on will only boot from the GRUB menu.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Details, please!

Which operating system are you running and which release?

"from then on will only boot from the GRUB menu."
What happens if you try booting normally?
What do you have to select in Grub that you can boot?

Revision history for this message
Paul Reddy (paulreddy) said :
#4

Ubuntu 20.04.3 LTS

There is no option to boot normally, after the BIOS screens it goes straight to the GRUB menu.

The top option in the GRUB menu.

Some times I have to do a manual fsck (boot from disc) to repair the file system.

Can changing the device name after a clean install cause this problem?

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Do I understand correctly:
When booting, the grub menu is shown. Just hitting "enter" to select the first entry ("Ubuntu") is enough to successfully continue booting.
Or, if I misunderstood you, what exactly is happening and what do you have to do to successfully boot?

I know two reasons for the grub menu to be shown:
1. a selection in the grub settings (e.g. in /etc/default/grub)
2. because of a crash in the previous session

Is this an Ubuntu-only system, or a dual boot with other operating system(s) available on the disks?

"Also getting update failed because of grub issues!"
Maybe there is something wrong with your grub installation.
What error messages do you get when doing updates?

How did you change device names after the install?

Revision history for this message
Paul Reddy (paulreddy) said :
#6

As you said, after the BIOS screens the system goes straight to the GRUB menu, and pressing entre to select the first entre Ubuntu mostly boots the system, but some times it refuses to behave and even trying the recover option doesn't work and then I have to boot from the disc and repair the file system.

This is a Ubuntu only system, with only one install of Ubuntu 20.04.3 LTS, no other operating systems are installed on the desktop computer.

2. because of a crash in the previous session: must be after trying to start the system on Mondays.

I get error messages when trying to install aps, but after a reboot they are installed, and I think it is the same with updates.

Unable to install "Document Scanner": Error while installing package: Installed grub-common package post-installation script subprocess returned error exit status 1

grub-common.service - Record successful boot for GRUB
     Loaded: loaded (/lib/systemd/system/grub-common.service; enabled vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-09-14 10:27:29 BST 23ms ago
     Process: 3822 ExecStartPre=/bim/sh -c [ -s /boo/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub (code=exited, status=/success)
     Process: 3824 ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset recordfail (code=exited, status=1/FAILURE)
     Main:PID: 3824 (code=exited, status=1/FAILURE)

There is another 4 lines which basically say: /user/bin/grub-editenv: error: invalid environment block.

I wish I could upload screen shots, because I've got a few of them from different error messages.

I changed the device name to Host's-PC from hosts-pc after the install was complete!

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

Oh, you changed the system name, not the name of a (storage) device.
If done correctly (e.g. with the hostnamectl command), this should not have any effect on booting.

Posting images is not possible in Launchpad questions (only in bugs).
If you want to show a screen image, you have to upload it to any image hosting service of your choice (do a web search for "free image hosting") and put a link to the image into your message.

For the error messages with updates and installs:
What is the output of the following commands:

sudo dpkg --audit
sudo apt update
sudo apt install --reinstall grub-common

Revision history for this message
Paul Reddy (paulreddy) said (last edit ):
#8

Yep, I changed the system name in setting, I have never changed the name of any storage devices.
I do have two 1TB Seagate (Barracuda's), and one 1TB Samsung mechanical hard drive 7200 rpm with NTFS partitions on them, they are old data drives from my Windows 7 days, but I moved to Ubuntu 18.04 first and then to Ubuntu 20.04. I stopped using Windows 7 when all the support stopped 14th January 2020!

root@hostspc:~# sudo dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 grub-pc GRand Unified Bootloader, version 2 (PC/BIOS version)
 grub-pc-bin GRand Unified Bootloader, version 2 (PC/BIOS modules)
 grub2-common GRand Unified Bootloader (common files for version 2)

The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 grub-common GRand Unified Bootloader (common files)

Revision history for this message
Paul Reddy (paulreddy) said :
#9

root@hostspc:~# sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-proposed InRelease
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://archive.canonical.com/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up-to-date.

Revision history for this message
Paul Reddy (paulreddy) said (last edit ):
#10

root@hostspc:~# sudo apt install --reinstall grub-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm11
Use 'sudo apt autoremove' to remove it.
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for grub-common:amd64

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

Sorry, my fault, should have been grub2-common instead of grub-common, but that does not matter.

The root problem is: dpkg complains that the grub-packages are not correctly installed.

What is the output of the following command

sudo dpkg --configure -a

Revision history for this message
Paul Reddy (paulreddy) said :
#12

root@hostspc:~# sudo dpkg --configure -a
Setting up grub-common (2.04-1ubuntu26.13) ...
Job for grub-initrd-fallback.service failed because the control process exited with error code.
See "systemctl status grub-initrd-fallback.service" and "journalctl -xe" for details.
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Job for grub-common.service failed because the control process exited with error code.
See "systemctl status grub-common.service" and "journalctl -xe" for details.
invoke-rc.d: initscript grub-common, action "restart" failed.
● grub-common.service - Record successful boot for GRUB
     Loaded: loaded (/lib/systemd/system/grub-common.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-09-20 18:38:26 BST; 17ms ago
    Process: 13614 ExecStartPre=/bin/sh -c [ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub (code=exited, status=0/SUCCESS)
    Process: 13616 ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset recordfail (code=exited, status=1/FAILURE)
   Main PID: 13616 (code=exited, status=1/FAILURE)

Sep 20 18:38:26 hostspc systemd[1]: Starting Record successful boot for GRUB...
Sep 20 18:38:26 hostspc grub-editenv[13616]: /usr/bin/grub-editenv: error: invalid environment block.
Sep 20 18:38:26 hostspc systemd[1]: grub-common.service: Main process exited, code=exited, status=1/FAILURE
Sep 20 18:38:26 hostspc systemd[1]: grub-common.service: Failed with result 'exit-code'.
Sep 20 18:38:26 hostspc systemd[1]: Failed to start Record successful boot for GRUB.
dpkg: error processing package grub-common (--configure):
 installed grub-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of grub2-common:
 grub2-common depends on grub-common (= 2.04-1ubuntu26.13); however:
  Package grub-common is not configured yet.

dpkg: error processing package grub2-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc-bin:
 grub-pc-bin depends on grub-common (= 2.04-1ubuntu26.13); however:
  Package grub-common is not configured yet.

dpkg: error processing package grub-pc-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc:
 grub-pc depends on grub-common (= 2.04-1ubuntu26.13); however:
  Package grub-common is not configured yet.
 grub-pc depends on grub2-common (= 2.04-1ubuntu26.13); however:
  Package grub2-common is not configured yet.
 grub-pc depends on grub-pc-bin (= 2.04-1ubuntu26.13); however:
  Package grub-pc-bin is not configured yet.

dpkg: error processing package grub-pc (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-common
 grub2-common
 grub-pc-bin
 grub-pc

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

What is the output of the commands

cat /boot/grub/grubenv
sudo rm /boot/grub/grubenv
sudo dpkg --configure -a

Revision history for this message
Paul Reddy (paulreddy) said :
#14

root@hostspc:~# cat /boot/grub/grubenv
root@hostspc:~# cat /boot/grub/grubenv
root@hostspc:~# cat /boot/grub/grubenv
nothing happened???

root@hostspc:~# sudo rm /boot/grub/grubenv
again nothing happened

root@hostspc:~# sudo dpkg --configure -a
Setting up grub-common (2.04-1ubuntu26.13) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up grub2-common (2.04-1ubuntu26.13) ...
Setting up grub-pc-bin (2.04-1ubuntu26.13) ...
Setting up grub-pc (2.04-1ubuntu26.13) ...
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.0-35-generic
Found initrd image: /boot/initrd.img-5.11.0-35-generic
Found linux image: /boot/vmlinuz-5.11.0-34-generic
Found initrd image: /boot/initrd.img-5.11.0-34-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

Revision history for this message
Manfred Hampl (m-hampl) said :
#15

Ok, the package installation finally seems complete.
Remark: deleting the apparently broken /boot/grub/grubenv file was already recommended by Julian Andres Klode in https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1943557/comments/2

I suggest that you check whether everything is working as expected now, and then wait for the next Monday.

For verification you can issue the commands
systemctl status grub-initrd-fallback.service
systemctl status grub-common.service
but I assume that they now show success.

Revision history for this message
Paul Reddy (paulreddy) said (last edit ):
#16

That is 2 Mondays in a row now when it takes over 3 minutes to boot into Ubuntu (normally (any other day of the week) will boot in less than 30 seconds), and then I have to do a restart because the Ethernet (Realtek RTL8111) is not available (greyed out with a question mark icon over it).

As I am quite new to Linux and would like to learn more about command line codes, and I am really skint at the moment, can you point me in the right direction where I can find a good quantity of reading material please, as that would be much appreciated.

Revision history for this message
Manfred Hampl (m-hampl) said :
#17
Revision history for this message
Paul Reddy (paulreddy) said :
#18

I had another weird boot today!

It looked like it was not booting, but it was because the Ubuntu logo screen was left over from the boot, and I could not see the desktop UI
https://www.how2shout.com/wp-content/uploads/2020/04/New-Ubuntu-20.04-Boot-splash-screen.png

First with the busy wheel, and then without.

So after leaving it for about 27 minutes, I held in the power button for five second to switch of the pc, then restarted.

In the next boot, I got the message:
Invalid Environment Block
Press any key to continue

Then it seemed to boot ok.

Revision history for this message
Manfred Hampl (m-hampl) said :
#19

The messages at boot time
Invalid Environment Block
Press any key to continue
indicate that again something is wrong with the contents of the configuration file /boot/grub/grubenv

Are you manually modifying that file?

Revision history for this message
Paul Reddy (paulreddy) said :
#20

No, of course not!

I have not done anything!

It must be something to do with updates, or the operating system falling over its self!!!!!

Do you think I am some sort of weirdo looking for attention? because I can assure you I am not, and I find it very insulting that you should suggest it!!!!!

The next time I do a clean install, I will not enable: Other Software, Canonical Partners, Software packages by Canonical for their partners.

Revision history for this message
Manfred Hampl (m-hampl) said :
#21

I am sorry, if my last message was felt like an insult by you. This was not my intention.

Revision history for this message
Paul Reddy (paulreddy) said :
#22

I just booted up again after the pc being switched off for the last 6 hours, and now it is booting from the grub menu again?????

Revision history for this message
Manfred Hampl (m-hampl) said :
#23

What is now the exact status?

Do you receive that "Invalid Environment Block" message again?
Can you continue booting despite that message or boot with advanced option?

When you have booted, you should be able to repair the situation (if necessary) with the commands

sudo rm /boot/grub/grubenv
sudo apt install --reinstall grub-common

Revision history for this message
Paul Reddy (paulreddy) said (last edit ):
#24

New day, pc/desktop has been off all night (unplugged), boot up still via grub.

No, I only received the "Invalid Environment Block" message once.

I'll try those commands and let you know!

Motherboard: Gigabyte GA-P41T-D3P
Processor: Intel Q6700 LGA775
Memory: Corsair 8GB XMS3 DDR3 CMX8GX3M2B1600C9
Graphics: Asus EAH4850

Revision history for this message
Paul Reddy (paulreddy) said :
#25

root@hostspc:~# sudo rm /boot/grub/grubenv
root@hostspc:~# sudo apt install --reinstall grub-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm11
Use 'sudo apt autoremove' to remove it.
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
Need to get 1,875 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 grub-common amd64 2.04-1ubuntu26.13 [1,875 kB]
Fetched 1,875 kB in 0s (3,930 kB/s)
Preconfiguring packages ...
(Reading database ... 168692 files and directories currently installed.)
Preparing to unpack .../grub-common_2.04-1ubuntu26.13_amd64.deb ...
Unpacking grub-common (2.04-1ubuntu26.13) over (2.04-1ubuntu26.13) ...
Setting up grub-common (2.04-1ubuntu26.13) ...
update-rc.d: warning: start and stop actions are no longer supported; falling ba
ck to defaults
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.13) ...
root@hostspc:~#

Revision history for this message
Manfred Hampl (m-hampl) said :
#26

No errors shown. The question now is whether the system will automatically boot or again will end up on the grub prompt.

There is an already resolved bug that shows problem with unsuccessful modifications of the /boot/grub/grubenv file - Bug #1910815

There is a diagnostic command in that bug report that in my opinion should no more show errors, because the bug was resolved by a modification of the grub packages

journalctl -b -u grub-initrd-fallback -u grub-common

What output does the command produce on your system?

Revision history for this message
Paul Reddy (paulreddy) said :
#27

root@hostspc:~# journalctl -b -u grub-initrd-fallback -u grub-common
-- Logs begin at Sat 2021-08-07 11:20:41 BST, end at Tue 2021-11-02 14:45:45 GM>
Nov 02 12:47:08 hostspc systemd[1]: Starting Record successful boot for GRUB...
Nov 02 12:47:08 hostspc systemd[1]: grub-common.service: Succeeded.
Nov 02 12:47:08 hostspc systemd[1]: Finished Record successful boot for GRUB.
Nov 02 12:47:08 hostspc systemd[1]: Starting GRUB failed boot detection...
Nov 02 12:47:08 hostspc systemd[1]: grub-initrd-fallback.service: Succeeded.
Nov 02 12:47:08 hostspc systemd[1]: Finished GRUB failed boot detection.
lines 1-7/7 (END)

Revision history for this message
Manfred Hampl (m-hampl) said :
#28

It's as expected. Nothing wrong.

Does the system successfully boot now

Revision history for this message
Paul Reddy (paulreddy) said :
#29

Nope!

I just had another weird boot!

It looked like it was booting ok, but then when it would usually flick from a blank screen into the Ubuntu Logo screen
https://www.how2shout.com/wp-content/uploads/2020/04/New-Ubuntu-20.04-Boot-splash-screen.png
it sent the monitor into power save instead.
I thought it hadn't booted (maybe I should have tried switching the monitor back on (new monitor, still getting used to it)), so I held the power button in for five seconds to switch off, then I switched it back on again, and it seems to have booted ok this time.

Can you help with this problem?

Provide an answer of your own, or ask Paul Reddy for more information if necessary.

To post a message you must log in.