Page 1 of 1

[SOLVED] kernel versions

PostPosted: Oct 11th, '19, 01:23
by buncl
Since my installation of Mageia in July system update installed several new kernel versions in /boot:
Code: Select all
 6108 -rw-r--r--  1 root root  6252928 Jul  2 11:26 vmlinuz-5.1.14-desktop-1.mga7
 6140 -rw-r--r--  1 root root  6285696 Aug 12 11:17 vmlinuz-5.1.20-desktop-2.mga7
 6220 -rw-r--r--  1 root root  6367616 Sep 17 21:14 vmlinuz-5.2.13-desktop-2.mga7
 6288 -rw-r--r--  1 root root  6437248 Okt 10 15:36 vmlinuz-5.3.2-desktop-1.mga7

/lib/modules is also "complete":
Code: Select all
4 drwxr-xr-x  3 root root 4096 Jul  2 11:27 5.1.14-desktop-1.mga7/
4 drwxr-xr-x  3 root root 4096 Aug 12 11:17 5.1.20-desktop-2.mga7/
4 drwxr-xr-x  3 root root 4096 Sep 17 21:14 5.2.13-desktop-2.mga7/
4 drwxr-xr-x  3 root root 4096 Okt 10 15:36 5.3.2-desktop-1.mga7/

However there's only one initrd, the original (but updated) one:
Code: Select all
13744 -rw-------  1 root root 14072380 Okt 10 15:36 initrd-5.1.14-desktop-1.mga7.img

Obviously grub will not consider the newer kernels for its boot menue.
Is there an explanation for this?

Re: kernel versions

PostPosted: Oct 12th, '19, 09:38
by benmc
please advise output of as root
Code: Select all
update-grub2


also, if this is a multi boot system, you will need to update grub in your last installed system.

Re: kernel versions

PostPosted: Oct 13th, '19, 14:44
by doktor5000
But grub update will not (re)build the missing initrds and hence he cannot boot those kernels.

Please post the full output as root of either
Code: Select all
bootloader-config --action rebuild-initrds

or
Code: Select all
dracut -f

Re: kernel versions

PostPosted: Oct 13th, '19, 15:34
by buncl
Thank you for responding!

@benmmc
the problem I have apparently is not grub2 -related, as grub refuses to create a menuentry for a kernel without a corresponding initrd, the latter having to be built in the urpmi process, not by `grub-mkconfig` .
Note: Mageia is installed as the only OS on a bootable USB stick and besides the missing newer kernels it runs just fine. One of it's 'responsibilities' is to do borgbackup's for me.

@doktor5000 - here's some more information:
Code: Select all
[root@localhost ~]# ls -lasc /boot
insgesamt 56016
    4 drwxr-xr-x  4 root root     4096 Okt 10 15:36 ./
    4 drwxr-xr-x 19 root root     4096 Aug 12 11:22 ../
  216 -rw-r--r--  1 root root   218186 Jul  2 11:26 config-5.1.14-desktop-1.mga7
  216 -rw-r--r--  1 root root   218292 Aug 12 11:17 config-5.1.20-desktop-2.mga7
  224 -rw-r--r--  1 root root   227331 Sep 17 21:14 config-5.2.13-desktop-2.mga7
  228 -rw-r--r--  1 root root   229538 Okt 10 15:36 config-5.3.2-desktop-1.mga7
    4 drwxr-xr-x  2 root root     4096 Jul  2 11:26 dracut/
    4 drwxr-xr-x  6 root root     4096 Jul  2 12:23 grub2/
13744 -rw-------  1 root root 14072380 Okt 10 15:36 initrd-5.1.14-desktop-1.mga7.img
    0 lrwxrwxrwx  1 root root       32 Jul  2 11:40 initrd.img -> initrd-5.1.14-desktop-1.mga7.img
  184 -rw-r--r--  1 root root   186052 Jul  2 11:26 symvers-5.1.14-desktop-1.mga7.xz
  184 -rw-r--r--  1 root root   186192 Aug 12 11:17 symvers-5.1.20-desktop-2.mga7.xz
  188 -rw-r--r--  1 root root   189248 Sep 17 21:14 symvers-5.2.13-desktop-2.mga7.xz
  188 -rw-r--r--  1 root root   191640 Okt 10 15:36 symvers-5.3.2-desktop-1.mga7.xz
 3888 -rw-r--r--  1 root root  3978900 Jul  2 11:26 System.map-5.1.14-desktop-1.mga7
 3940 -rw-r--r--  1 root root  4030778 Aug 12 11:17 System.map-5.1.20-desktop-2.mga7
 3996 -rw-r--r--  1 root root  4091692 Sep 17 21:14 System.map-5.2.13-desktop-2.mga7
 4048 -rw-r--r--  1 root root  4142859 Okt 10 15:36 System.map-5.3.2-desktop-1.mga7
    0 lrwxrwxrwx  1 root root       29 Jul  2 11:40 vmlinuz -> vmlinuz-5.1.14-desktop-1.mga7
 6108 -rw-r--r--  1 root root  6252928 Jul  2 11:26 vmlinuz-5.1.14-desktop-1.mga7
 6140 -rw-r--r--  1 root root  6285696 Aug 12 11:17 vmlinuz-5.1.20-desktop-2.mga7
 6220 -rw-r--r--  1 root root  6367616 Sep 17 21:14 vmlinuz-5.2.13-desktop-2.mga7
 6288 -rw-r--r--  1 root root  6437248 Okt 10 15:36 vmlinuz-5.3.2-desktop-1.mga7


Code: Select all
[root@localhost ~]# rpm -qa | grep ^kernel | sort
kernel-desktop-5.1.14-1.mga7-1-1.mga7
kernel-desktop-5.1.20-2.mga7-1-1.mga7
kernel-desktop-5.2.13-2.mga7-1-1.mga7
kernel-desktop-5.3.2-1.mga7-1-1.mga7
kernel-desktop-latest-5.3.2-1.mga7
kernel-firmware-20190603-1.mga7
kernel-firmware-nonfree-20190926-1.mga7.nonfree
kernel-userspace-headers-5.3.2-1.mga7


Code: Select all
[bunc@localhost ~]$ urpmq --fuzzy kernel

...
mine are contained therein
...

Code: Select all
[root@localhost ~]# bootloader-config --action rebuild-initrds
INTERNAL ERROR: unknown device sdg
MDK::Common::Various::internal_error() called from /usr/lib/libDrakX/devices.pm:131
devices::entry() called from /usr/lib/libDrakX/devices.pm:146
devices::make() called from /usr/lib/libDrakX/partition_table/raw.pm:60
partition_table::raw::typeOfMBR() called from /usr/lib/libDrakX/bootloader.pm:307
bootloader::read() called from /usr/sbin/bootloader-config:64


hmmm - some inconsistencies, perhaps due to the USB stick boot, but what prevents urpmi from building initrd's?

and finally:
Code: Select all
  [root@localhost ~]# dracut -f
dracut: Executing: /usr/bin/dracut -f
dracut: dracut module 'bootchart' will not be installed, because command '/sbin/bootchartd' could not be found!
dracut: dracut module 'systemd' will not be installed, because it's in the list to be omitted!
dracut: dracut module 'systemd-bootchart' will not be installed, because command '/usr/lib/systemd/systemd-bootchart' could not be found!
dracut: systemd-initrd needs systemd in the initramfs
dracut: dracut module 'caps' will not be installed, because command 'capsh' could not be found!
dracut: systemd-networkd needs systemd in the initramfs
dracut: dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
dracut: dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut: dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut: dracut module 'ifcfg' depends on 'network', which can't be installed
dracut: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsistart' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found!
dracut: dracut-systemd needs systemd-initrd in the initramfs
dracut: dracut module 'caps' will not be installed, because command 'capsh' could not be found!
dracut: dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
dracut: dracut module 'ifcfg' depends on 'network', which can't be installed
dracut: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsistart' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: *** Including module: bash ***
dracut: *** Including module: dash ***
dracut: *** Including module: i18n ***
dracut: *** Including module: drm ***
dracut: *** Including module: plymouth ***
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: resume ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies ***
dracut: *** Installing kernel module dependencies done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing GenuineIntel.bin ****
dracut: *** Store current command line parameters ***
dracut: Stored kernel commandline:
dracut:  resume=UUID=5ba34985-b92a-4e9c-9ec7-f7c763266cb8
dracut:  root=UUID=6381f318-7e77-43ca-b8c8-c05006865e5f rootfstype=ext4 rootflags=rw,relatime
dracut: *** Creating image file '/boot/initrd-5.1.14-desktop-1.mga7.img' ***
dracut: *** Creating initramfs image file '/boot/initrd-5.1.14-desktop-1.mga7.img' done ***


So it's building only the 5.1.14 -initrd.
I can live with that, but still ....

Re: kernel versions

PostPosted: Oct 14th, '19, 07:47
by doktor5000
buncl wrote:
Code: Select all
[root@localhost ~]# bootloader-config --action rebuild-initrds
INTERNAL ERROR: unknown device sdg
MDK::Common::Various::internal_error() called from /usr/lib/libDrakX/devices.pm:131
devices::entry() called from /usr/lib/libDrakX/devices.pm:146
devices::make() called from /usr/lib/libDrakX/partition_table/raw.pm:60
partition_table::raw::typeOfMBR() called from /usr/lib/libDrakX/bootloader.pm:307
bootloader::read() called from /usr/sbin/bootloader-config:64


hmmm - some inconsistencies, perhaps due to the USB stick boot, but what prevents urpmi from building initrd's?


Exactly the issue above, that bootloader-config does not complete. This is what's being called during kernel installation/update, and as it fails no initrd is generated.

Can you please post what you have in /boot/grub2/install.sh ?

Re: kernel versions

PostPosted: Oct 14th, '19, 14:54
by buncl
Thank you doktor5000:

Code: Select all
[root@localhost ~]# cat /boot/grub2/install.sh
grub2-install /dev/sdg


Code: Select all
[root@localhost ~]# df -Th
Dateisystem    Typ      Größe Benutzt Verf. Verw% Eingehängt auf
...
/dev/sdb1      ext4       27G    8,8G   17G   35% /
...


So in my current environment the boot partition is /dev/sdb1, therefore I might do something like
Code: Select all
vi  /boot/grub2/install.sh     # change sdg to sdb
chattr -i /boot/grub2/i386-pc/core.img
grub2-install --target=i386-pc --debug --force /dev/sdb
chattr +i /boot/grub2/i386-pc/core.img


My concern though is that on another machine sdb might be wrong again. Yet the
Code: Select all
vi /boot/grub2/install.sh
&&
grub2-install
&&
bootloader-config --action rebuild-initrds

might do the trick, i.e. provide missing initrd's ?!

Note: I just tried - now it gives
Code: Select all
[root@localhost ~]# bootloader-config --action rebuild-initrds
Creating: target|kernel|dracut args|basicmodules
remove-boot-splash: Format of /boot/initrd-5.1.14-desktop-1.mga7.img not recognized

and leaves my /boot -directory with
Code: Select all
[root@localhost ~]# ls -lasc /boot/init*
13756 -rw------- 1 root root 14086044 Okt 14 14:37 /boot/initrd-5.1.14-desktop-1.mga7.img
13744 -rw------- 1 root root 14071798 Okt 14 14:36 /boot/initrd-5.1.14-desktop-1.mga7.img.old
    0 lrwxrwxrwx 1 root root       32 Jul  2 11:40 /boot/initrd.img -> initrd-5.1.14-desktop-1.mga7.im


I just wonder how - before - the system every time after a kernel upgrade succeeded building the initrd-5.1.14-desktop-1.mga7.img but skiped the newer ones?!

Re: kernel versions

PostPosted: Oct 30th, '19, 13:22
by buncl
With the arrival of
Code: Select all
kernel-desktop-5.3.7-4.mga7-1-1.mga7

the problem disappeared: it installed the corresponding
Code: Select all
initrd-5.3.7-desktop-4.mga7.img

and thus boots successfully. I have manually urpme'd 5.1.20-2, 5.2.13-2 and 5.3.2-1 but kept 5.1.14-1. The latter is listed as orhaned, nevertheless still recognized by grub and usable.
Thanks for the attention - the thread may be marked solved now ...

Re: kernel versions

PostPosted: Oct 30th, '19, 13:57
by isadora
...
You can do so by editing the title/subject of the first message in the topic.
Place [SOLVED] in front of subject/title.

Thanks ahead. :)

[solved] kernel versions

PostPosted: Oct 30th, '19, 17:40
by buncl
thank you for advising isadora - I've done as you said ...