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.

boot useful tips

  1. It is not necessary to start booting with EFI if you have GPT partitions (you could choose to have legacy boot with GPT partitions).
  2. It is not necessary that EFI partition be at the start of a disk: it could be in every place, provided that it has a) boot (esp) flags, and b) at least 110mb of space.

Flatpak bad installation

It could happen that a flatpak installation, from a link, goes bad and from a GUI you can’t fix the problem. In this case you can try with: sudo flatpak repair in a terminal.

At least, this was my experience with Bottles.