Adding a recovery mode

Hello folks,

is there a reason why the recovery mode (single mode) is disabled by default and only a fallback kernel is there? It would be so much easier to solve common problems here without the need of a boot disk. Like this one on ubuntu: https://launchpad.net/ubuntu/+source/friendly-recovery

For example:

  1. Set fsck to force check / or check other partitions.
  2. Clean reinstall nvidia drivers.
  3. Check packages… clean cache…
  4. repair grub
  5. get systeminformation (inxi) and upload it if needed.
  6. Try to free up space.

I mean you cannot expect that everyone has a flash drive ready everywhere.

5 Likes

That could be cool to have something like that, but I guess, as the solution I opted for, there is an issue when GRUB is broken?

Yeah, but it depends… If grub is broken, then you cannot boot the recovery kernel, thats true. I am thinking also of a a really small recovery partition (about 500MB), which has its own bootloader, which can be installed optional. But I need more tests on this.

I know, it is a similar solution like WinRE, but however, the idea of having a recovery boot option (at least a friendly one with a menu) is a good idea.

Just brainstorming:

  1. Linux boots into single mode.
  2. It starts a menu on login as root. (Maybe with systemd?)
  3. Tools like chroot, fsck, inxi, pacman, mhwd, grub, efibootmgr, parted should do auto checks there and repair common problems with default installations.
  4. If it is not a default one, then root access with chroot should be provided.
  5. Extra section for BTRFS, if needed.
  6. A Live-ISO will be the second option to repair your system, if not possible here.

Maybe the one from Ubuntu can be modified and extended.

Just wanted to run fsck in recovery mode and figured out that there is no recovery mode :confused:

ok, it is more offtopic, but well just for the record…

Force check and repair on boot (that includes also / ):

GRUB_CMDLINE_LINUX_DEFAULT="fsck.mode=force fsck.repair=yes"

(Works with systemd this way)

Activate plain recovery mode:

GRUB_DISABLE_RECOVERY=false

It adds a menu entry which boots into single mode. (It adds only single to the boot parameter)

File: /etc/default/grub

Always run sudo update-grub after changing this file.

1 Like