Update lsblk commands to make it easier to identify devices. (#1000)

Closes #984

Signed-off-by: Bun K Tan <bun.k.tan@intel.com>
This commit is contained in:
bktan8
2020-01-23 14:59:29 -08:00
committed by michael vincerra
parent 6627f3105a
commit c0981002a6
3 changed files with 115 additions and 79 deletions
+26 -35
View File
@@ -39,45 +39,33 @@ Burn the |CL| image onto a USB drive
#. Plug in the USB drive.
#. Identify the USB drive using the :command:`lsblk` command. This shows all
#. Identify the USB drive using the :command:`lsblk` command with these options:
``-po NAME,SIZE,TYPE,FSTYPE,PARTLABEL,MOUNTPOINT,VENDOR,MODEL``. This shows all
drives attached to the system, including the primary hard disk. In the
example output below, there are 4 drives
(`/dev/sda`, `/dev/sdb`, `/dev/sdc`, and `/dev/sdd`) attached, where
`/dev/sda` is the primary drive. The remaining are three USB drives. The output
also shows the mounted partitions (under the `MOUNTPOINT` column) for each
drive.
example output below, there are 3 drives (`/dev/sda`, `/dev/sdb`, and `/dev/sdc`)
attached, where `/dev/sda` is the primary drive and the remaining are USB drives.
.. code-block:: bash
lsblk
.. note::
Alternatively, enter the command: `lsblk -S`
lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL,MOUNTPOINT,VENDOR,MODEL
Example output:
.. code-block:: console
:emphasize-lines: 1-5
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdd 8:48 1 15G 0 disk
├─sdd2 8:50 1 5G 0 part /run/media/user1/960c184f-3bb7-42b7-bcaf-0c1282
├─sdd3 8:51 1 8G 0 part /run/media/user1/704f3382-b26d-4f34-af1b-cb9aab
└─sdd1 8:49 1 2G 0 part
sdb 8:16 1 14.8G 0 disk
└─sdb1 8:17 1 14.8G 0 part /run/media/user1/PATRIOT_USB
sdc 8:32 1 7.3G 0 disk
└─sdc1 8:33 1 7.3G 0 part /run/media/user1/LINUX MINT
sda 8:0 0 335.4G 0 disk
├─sda4 8:4 0 28G 0 part
├─sda2 8:2 0 3.7G 0 part [SWAP]
├─sda7 8:7 0 6G 0 part /home
├─sda5 8:5 0 1G 0 part /boot
├─sda3 8:3 0 954M 0 part /boot/efi
├─sda1 8:1 0 28G 0 part
├─sda8 8:8 0 30G 0 part /
└─sda6 8:6 0 7.9G 0 part [SWAP]
NAME SIZE VENDOR MODEL TRAN TYPE PARTLABEL MOUNTPOINT
/dev/sda 119.2G ATA SAMSUNG_MZ7PC128HAFU-000 sata disk
├─/dev/sda1 450M part Basic data partition
├─/dev/sda2 100M part EFI system partition
├─/dev/sda3 16M part Microsoft reserved partition
├─/dev/sda4 97.2G part Basic data partition
├─/dev/sda5 142M part EFI
├─/dev/sda6 245M part linux-swap [SWAP]
└─/dev/sda7 21.1G part / /
/dev/sdb 7.5G General UDisk usb disk
└─/dev/sdb1 7.5G part Microsoft Basic Data /run/media/clear/CENA_X64FRE
/dev/sdc 15G Patriot_Memory usb disk
└─/dev/sdc1 15G part /run/media/clear/U
.. note::
@@ -85,18 +73,19 @@ Burn the |CL| image onto a USB drive
#. If the USB drive you want to use is mounted, it must be umounted before
burning an image onto it. Use the :command:`umount` command followed by
the device identifier/partition. For example, to unmount all /dev/sdd
partitions:
the device identifier/partition. For example, to unmount all of the
``/dev/sdc`` partitions:
.. code-block:: bash
sudo umount /dev/sdd*
sudo umount /dev/sdc*
#. Burn the image onto the USB drive. This example burns an image onto `/dev/sdd`. The device name of the USB may vary.
#. Burn the image onto the USB drive. This example burns an image onto ``/dev/sdc``.
The device name of the USB may vary.
.. code-block:: bash
sudo dd if=./clear-[version number]-live-[desktop | server].iso of=/dev/sdd oflag=sync bs=4M status=progress
sudo dd if=./clear-[version number]-live-[desktop | server].iso of=/dev/sdc oflag=sync bs=4M status=progress
.. caution::
@@ -196,6 +185,8 @@ Burn the |CL| image onto a USB drive
For other image tools, verify the `Volume label` is set to :guilabel:`CLR_ISO` **Do not change the label as installer relies on it.**
#. In the dialog, navigate to where the |CL| ISO image was downloaded and select it.
#. Click the :guilabel:`START` button. See Figure 2.
.. figure:: /_figures/bootable-usb/bootable-usb-windows-02.png
@@ -3,7 +3,8 @@
Fix a broken installation
#########################
This guide explains how to fix a broken installation of |CL-ATTR| using a live desktop image on a USB.
This guide explains how to fix a broken installation of |CL-ATTR| using a live
desktop image on a USB.
.. contents::
:local:
@@ -16,7 +17,9 @@ This guide assumes you have installed |CL| 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
:ref:`swupd<swupd-guide>` owns in :file:`/usr` and :file:`/var`. Files outside of this path, such as :file:`/home/`, :file:`/etc`, etc., cannot be repaired by this process.
:ref:`swupd<swupd-guide>` owns in :file:`/usr` and :file:`/var`. Files outside
of this path, such as :file:`/home/`, :file:`/etc`, etc., cannot be
repaired by this process.
Prerequisites
*************
@@ -34,35 +37,66 @@ Boot a live desktop image to fix target system
Mount root partition, verify, and fix
*************************************
#. Open a Terminal window.
#. Ensure the system is connected to the network.
#. Mount the systems root partition.
#. Open a terminal window.
#. To find the root partition, run:
#. Find the |CL| root partition by using the :command:`lsblk` command with
these options: ``-o NAME,LABEL,PARTTYPE,PARTLABEL``.
.. code-block:: bash
.. code-block:: bash
lsblk -o NAME,LABEL,PARTTYPE,PARTLABEL
lsblk -o NAME,LABEL,PARTTYPE,PARTLABEL
We'll use :file:`/dev/sda3/` as the root partition example.
Example output:
#. Next, mount the root partition to the :file:`/mnt` folder.
.. code-block:: console
:emphasize-lines: 10
.. code-block:: bash
clrlinux@clr-live~ $ lsblk -po NAME,SIZE,LABEL,PARTTYPE,PARTLABEL
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 /
sudo mount /dev/sda3 /mnt
In the example above, ``/dev/sdb3/`` is the root partition.
#. Verify that you mounted the correct root partition by checking for some
files commonly found on |CL| systems.
#. Next, mount the root partition.
.. code-block:: bash
sudo mount /dev/sdb3 /mnt
#. Verify that you mounted the correct root partition by verifying the content
of ``/usr/lib/os-release`` looks similar to the example below.
.. code-block:: bash
cat /mnt/usr/lib/os-release
ls /mnt/usr/share/clear/bundles
#. Next, run swupd to fix any issues on the target system.
Example output:
.. code-block:: console
clrlinux@clr-live~ $ cat /mnt/usr/lib/os-release
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"
#. Next, run :command:`swupd` to fix any issues on the target system.
.. code-block:: bash
@@ -82,5 +116,3 @@ Mount root partition, verify, and fix
.. code-block:: bash
sudo reboot
**Congratulations!** You successfully restored |CL|.
+39 -26
View File
@@ -153,27 +153,27 @@ If you prefer not to use your BIOS to load the :guilabel:`Boot Menu` and select
.. code-block:: bash
lsblk -po NAME,SIZE,TYPE,PARTLABEL
lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
Example output:
.. code-block:: console
:emphasize-lines: 6,8,9,11
clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,PARTLABEL
NAME SIZE TYPE PARTLABEL
/dev/loop0 2.3G loop
clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
NAME SIZE TYPE FSTYPE PARTLABEL
/dev/loop0 2.3G loop squashfs
/dev/sda 335.4G disk
├─/dev/sda1 450M part Basic data partition
├─/dev/sda2 100M part EFI system partition
├─/dev/sda3 16M part Microsoft reserved partition
├─/dev/sda4 286G part Basic data partition
├─/dev/sda5 143M part EFI
├─/dev/sda6 244M part linux-swap
└─/dev/sda7 48.5G part /
sdb 8:16 1 7G 0 disk
├─sdb1 8:17 1 2.5G 0 part
└─sdb2 8:18 1 100M 0 part
├─/dev/sda1 450M part ntfs Basic data partition
├─/dev/sda2 100M part vfat EFI system partition
├─/dev/sda3 16M part Microsoft reserved partition
├─/dev/sda4 286G part ntfs Basic data partition
├─/dev/sda5 143M part vfat EFI
├─/dev/sda6 244M part swap linux-swap
└─/dev/sda7 48.5G part ext4 /
sdb 7G disk iso9660
├─/dev/sdb1 2.7G part iso9660
└─/dev/sdb2 100M part vfat
The example output shows:
@@ -182,6 +182,12 @@ If you prefer not to use your BIOS to load the :guilabel:`Boot Menu` and select
* /dev/sda5 is the EFI system partition created by |CL|
* /dev/sda7 is the |CL| root partition
.. note::
To help narrow down a partition even more, you add the ``PARTTYPE``
option to :command:`lsblk` and cross-reference against the
`partition type GUIDs wiki`_.
#. Create mount points.
.. code-block:: bash
@@ -330,26 +336,32 @@ Install Windows 10 OS
.. code-block:: bash
lsblk -po NAME,SIZE,TYPE,PARTLABEL
lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
Example output:
.. code-block:: console
:emphasize-lines: 5
clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,PARTLABEL
NAME SIZE TYPE PARTLABEL
/dev/loop0 2.3G loop
clrlinux@clr-live~ $ lsblk -po NAME,SIZE,TYPE,FSTYPE,PARTLABEL
NAME SIZE TYPE FSTYPE PARTLABEL
/dev/loop0 2.3G loop squashfs
/dev/sda 100G disk
├─/dev/sda1 150M part CLR_BOOT
├─/dev/sda2 250M part CLR_SWAP
├─/dev/sda3 8G part CLR_ROOT
├─/dev/sda4 16M part Microsoft reserved partition
├─/dev/sda5 91.6G part Basic data partition
sdb 8:16 1 7G 0 disk
├─sdb1 8:17 1 2.5G 0 part
└─sdb2 8:18 1 100M 0 part
├─/dev/sda1 150M part vfat CLR_BOOT
├─/dev/sda2 250M part swap CLR_SWAP
├─/dev/sda3 8G part ext4 CLR_ROOT
├─/dev/sda4 16M part Microsoft reserved partition
├─/dev/sda5 91.6G part ntfs Basic data partition
sdb 7G disk iso9660
├─/dev/sdb1 2.7G part iso9660
└─/dev/sdb2 100M part vfat
.. note::
To help narrow down a partition even more, you add the
``PARTTYPE`` option to :command:`lsblk` and
cross-reference against the `partition type GUIDs wiki`_.
#. Make a mount point for |CL|.
.. code-block:: bash
@@ -385,3 +397,4 @@ Install Windows 10 OS
sudo umount /mnt/clearlinux/boot
sudo umount /mnt/clearlinux
.. _partition type GUIDs wiki: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs