Fix a broken installation

This guide explains how to fix a broken installation of Clear Linux* OS using a live desktop image on a USB.

Overview

This guide assumes you have installed Clear Linux OS on a target system, but the OS does not boot or function properly.

The process described in this guide can only verify and fix files that swupd owns in /usr and /var. Files outside of this path, such as /home/, /etc, etc., cannot be repaired by this process.

Prerequisites

Boot a live desktop image to fix target system

  1. Boot the Clear Linux OS live desktop image.

  2. Select Clear Linux OS in the boot menu.

Mount root partition, verify, and fix

  1. Ensure the system is connected to the Internet in order to access the the Clear Linux OS update server.

  2. Open a terminal window.

  3. Find the Clear Linux OS root partition by using the lsblk command with these options: -o NAME,LABEL,PARTTYPE,PARTLABEL.

    lsblk -o NAME,LABEL,PARTTYPE,PARTLABEL
    

    Example output:

    NAME          SIZE LABEL       PARTTYPE                             PARTLABEL
    /dev/loop0  643.6M
    /dev/sda     14.3G CLR_ISO
    ├─/dev/sda1   835M CLR_ISO     0x0
    └─/dev/sda2   100M "CLEAR_EFI" 0xef
    /dev/sdb     74.5G
    ├─/dev/sdb1   142M boot        c12a7328-f81f-11d2-ba4b-00a0c93ec93b EFI
    ├─/dev/sdb2   244M swap        0657fd6d-a4ab-43c4-84e5-0933c84b4f4f linux-swap
    └─/dev/sdb3  74.2G root        4f68bce3-e8cd-4db1-96e7-fbcaf984b709 /
    

    In the example above, /dev/sdb3/ is the root partition.

  4. Next, mount the root partition.

    sudo mount /dev/sdb3 /mnt
    
  5. Verify that you mounted the correct root partition by verifying the content of /mnt/usr/lib/os-release looks similar to the example below.

    cat /mnt/usr/lib/os-release
    

    Example output:

    NAME="Clear Linux OS"
    VERSION=1
    ID=clear-linux-os
    ID_LIKE=clear-linux-os
    VERSION_ID=32150
    PRETTY_NAME="Clear Linux OS"
    ANSI_COLOR="1;35"
    HOME_URL="https://clearlinux.org"
    SUPPORT_URL="https://clearlinux.org"
    BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
    PRIVACY_POLICY_URL="http://www.intel.com/privacy"
    
  6. Next, run swupd repair to fix any issues on the target system.

    sudo swupd repair --picky --path=/mnt --statedir=/mnt/var/lib/swupd
    

    Learn more about how swupd works.

  7. After the process is complete, unmount the root partition.

    sudo umount /mnt
    
  8. Reboot the system, remove the live desktop USB drive, and boot into the repaired system.

    sudo reboot