Ubuntu Core 20 is inherently robust. But if data-corruption issues do occur, even on boot or data partitions, it can still access a recovery mode to help repair, restore or reinstall an impaired device.
The following recovery functions are currently available:
- Run normally: restart and run the boot process (run mode)
- Recover: reboot into recovery mode for data retrieval
- Reinstall: initialise the device from an onboard system image
See Using recovery modes (below) for more details on the above, and to access recovery functionality, either:
Start or reboot the device with the ‘1’ key held on a connected keyboard
run 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’ or ‘reboot’ functions.
Note: Device manufacturers using Ubuntu Core 20 may choose to implement alternative methods to access recovery functionality. These will be specific to those devices.
To access the recovery chooser, 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).
sudo snap reboot to reboot the system, the following arguments can be added to select a recovery mode with or without an additional system label for the target system:
The recover and run modes are only available for the current system.
When called without a system label, reboot will use the current system to enter the given mode. System labels are listed with the
snap recovery command:
$ sudo snap recovery Label Brand Model Notes 20201117 <user-name> ubuntu-core-20-amd64 current
To reboot the above system into recovery mode, for example, enter the following:
$ sudo snap reboot --recover 20201117 Broadcast message from root@ubuntu (Wed 2020-11-25 13:15:51 UTC): reboot scheduled to update the system The system is going down for reboot at Wed 2020-11-25 13:25:51 UTC! Reboot into "20201117" "recover" mode.
Using recovery modes
When booting in run mode, the device will attempt to boot normally, with no option to recover or reinstall the system.
In recovery mode, the device operates as it would from a pristine initial installation, including its snaps, via a temporary file system. 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.
Rebooting from recovery mode will return the system to run mode.
If install is selected, all existing user data on the device will be removed and the device will be initialised from the system version image dated and listed in the reinstall text.
TPM provision failures:
Re-installation can fail if a device’s TPM is assigned to a previous installation. To solve this issue, reset or clear the TPM assignment from the device’s BIOS before selecting reinstall as a recovery mode.
Select ‘Confirm’ continue. You will then need to step through the installation process of network configuration and account credentials again:
After a brief initialisation period, “Press enter to configure” will appear on the display.
Press enter to continue. The display will update to show some Ubuntu Core introductory text and a prompt to set up the network and administrator account. Press tab or cursor down to highlight OK, and press return to move on to the next step.
The next step configures the network connection. The default options will configure the ethernet port to use DHCP to connect to your local network. Use the cursor keys to navigate to the network device and ‘Enter’ to change the configuration, or select ‘Done’ to complete the process and move on to the next step.
Finally, enter the email address for the Ubuntu SSO account. This will link the SSH keys registered on the account to the new device deployment and allow you to connect without any further device configuration. The connection details are shown on the next page, and with each successive reboot, alongside SSH host key fingerprints for the device. You can now connect using SSH with your Ubuntu SSO username and the IP address of the device.
It’s not uncommon for the device to reboot several times during the installation process as various system components are updated and installed.