What to do when Ubuntu recovery mode not working? If you want to restore Ubuntu from terminal you can boot Ubuntu into recovery mode. Learn how:
Traditionally, the following 3 kinds of booting modes are currently available on boot (Linux OS):
- Run mode: Normal boot mode
- Recovery mode: reboot into recovery mode for maintenance or repairing the system
- Reinstall mode: initialise the device from an onboard system image
NOTE: Recovery modes are available on Ubuntu Core 20 and later. After a clean Ubuntu Core installation, a first recovery system is created.
Recovery Mode
In recovery mode, the device boots to a temporary system and operates as it would from a pristine initial installation, including its snaps. This allows you to log in to the system using prior credentials to recover your data, either via SSH or locally after setting up a password for the user. It must be noted that all the modifications done to the system during recovery mode are temporary and are lost once the device is rebooted.
These recovery modes can be accessed in three different ways:
- Boot into the system mode selection menu: Start or reboot the device with the ‘1’ key held on a connected keyboard
- Snap reboot: Run snap reboot on the device with either –recover or –install arguments.
- Snapd REST API: Use the REST API to call either the recover, install, factory-reset or reboot functions.
How To Access Recovery Boot Menu
To access the system mode selection menu, start or reboot the device with the ‘1’ key held on a connected keyboard. If the chooser fails to launch, try pressing 1 repeatedly from boot. It needs to be captured by Ubuntu Core boot process.
After the initial boot process completes, a status screen will appear showing “System mode selection triggered. Proceed to select one of the available systems and actions.”
The menu system requires that you tab or cursor to highlight your chosen option. Ensure ‘OK’ is highlighted and press Enter to continue, after which you’ll be presented first with the recovery chooser and the option to either run normally, enter recovering mode, or reinstall.
Selecting an option followed by ‘Confirm’ will reboot the device into the selected mode (see below).
NOTE:
- If “Run normally” has been selected, the system boots in run mode.
- If “Recover” has been selected, the system boots in recovery mode.
- If “Reinstall” has been selected, the system boots in reinstall mode.
How To Exit Recovery Boot Menu
For exiting recovery mode, you can use any of the following options:
Enter the following command
snap reboot --run
You can power off and on the system to exit reovery mode.