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

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.