Kernel panic

You could have a kernel panic problem, booting your SO (.i.g Linux).

A possible cause could be Virtualbox (an old release of it).
In this case you can try the followings steps

sudo apt remove --purge virtualbox virtualbox-dkms
sudo dkms remove virtualbox/7.0.16 --all || true

and

sudo apt --fix-broken install
sudo dpkg --configure -a

and (you can change the number of kernels, of course, to adapt them to your situation)

sudo apt install --reinstall \
 linux-image-generic-hwe-24.04 \
 linux-headers-generic-hwe-24.04 

Timeout of grub boot

You have to edit grub in /etc/default (i.g. with nano: sudo nano /etc/default/grub)

not only modifying this line: GRUB_TIMEOUT=3

but also adding (after that) this one: GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

Of course after these changes you have to do a

sudo update-grub

as explained here.

chroot in linux

Chroot is a very useful feature in Linux systems: you can update a Linux installation on your PC not within that installation, as usually we can do, but from another installation.

I.g. if you have Linux1 on /dev/sda2 and Linux2 on /dev/sda3 and you cannot login into Linux2, you can try to solve the problem by doing an update of Linux2 from Linux1. Using chroot.

There are very good guides on the web, but, let us repeat the essential steps

  • first of all be sure of the correct name of the partition you want chroot in (i.g. /dev/sda3, or /dev/sdb2)
  • create a /mnt where you will mount that installation, i.g. /mnt/chroot
  • mount that installation in /mnt/chroot: sudo mount -t ext4 /dev/sda3 /mnt/chroot (note that etx4 is if that is the filesystem, but it could be btrfs as well or another filesystem)
  • mount efi partion (if you have efi): sudo mount -t vfat /dev/sda1 /mnt/chroot/boot/efi/
  • mount virtual folders of that installation: for i in dev proc sys run; do sudo mount --bind /$i /mnt/chroot/$i; done
  • Do the chroot: sudo chroot /mnt/chroot

What you do now, within the terminal where you did the chroot is what you could do if you were in that installation (Linux2).
Typically you should do these commands

  • apt update (without sudo before apt: you are already acting as superuser)
  • apt upgrade (or apt full-upgrade)
  • update-grub

Afterwards you can exit with:

  • for i in /dev /proc /sys /run /; do sudo umount -l /mnt/chroot/$i; done
  • and: sudo umount /dev/sda2 /mnt/chroot/boot/efi/
  • and: sudo umount /dev/sda3 /mnt(chroot

Note that these last two commands could be not necessary.

Fast pre-boot

If your pre-boot (when you can choose among different SO) is too slow, you can reduce the time before the start of boot, modifying the file grub (in /etc/default), adding a line like this:

GRUB_RECORDFAIL_TIMEOUT=1

Indeed GRUB_TIMEOUT=0 could not work.

update-grub on btrfs bootable partition

Update-grub could not recognized as bootable a btrfs partition.

A workaround to make a btrfs (bootable) partition recognized by update-grub is to create symlinks to /boot and /etc folders, in this simple way:

  • go to the mounted btrfs partition
  • create symlink for boot
    ln -s @/boot boot
  • create symlink for etc
    ln -s @/etc etc
  • do update-grub

Install Kubuntu without EFI bootloader

If you have, i.g., another linux distro, such as KDE-Neon, and you want add Kubuntu as secondary SO, without changing your EFI, you do this way:

  • in Kubuntu (usb iso) menu -> try Kubuntu
  • in a terminal (once logged in): ubiquity -b
  • this will open the graphical installation tool letting you install Kubuntu without modifying existing EFI
  • don’t worry for the warnings (“the system could not start”)
  • after rebooting, in KDE-Neon do update-grub

If you get, with update-grub, an error such this:


Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.

You can solve adding or uncommenting this line in /etc/default/grub

GRUB_DISABLE_OS_PROBER=false


slow boot

You can check what apps cause a slowing of your boot, in Linux, with this command:

systemd-analyze blame

You should see something like the following

systemd-analyze blame
3.115s NetworkManager-wait-online.service
1.980s fwupd-refresh.service
1.928s fwupd.service
[…]

To disable NetworkManager-wait-online.service, i.g., you can type: sudo systemctl disable NetworkManager-wait-online.service.

other possible causes

Check also if your UUID (of swap partitions, i.g.) are correct. This can be a cause of a severe slowing.


grub rescue

It could happen that your PC, after some operations (i.g. with gdisk) doesn’t start booting and you are therefore in grub rescue prompt. A very unpleasant situation.

The steps to follow are:

  1. see what are the partitions, with the command ls
    • you should see something like: (hd0)(hd0,msdos1)(hd0,msdos2)(hd1)(hd1,gpt1)
  2. understand what is the right partition to boot (i.g. hd0,gpt2):
    • you can list a single partition to see what it contains, with the command ls (hd0,gpt2). You should be able to see if a partition is the right one.
  3. give the command set prefix=(hd0,gpt2)/boot/grub
  4. give the command set root=(hd0,gpt2)/ root=/dev/sda2 (if the right partition is hd0,gpt2 the name is /dev/sda2, if it was hd1,gpt3 it would be /dev/sdb3)
  5. give the command insmod normal
  6. give the command: normal (or boot)

In this way the system should start with the expected partition.