Skip to content

Instantly share code, notes, and snippets.

@itsmikita
Created May 31, 2024 10:34
Show Gist options
  • Save itsmikita/1b9be062849107100b45191818b85406 to your computer and use it in GitHub Desktop.
Save itsmikita/1b9be062849107100b45191818b85406 to your computer and use it in GitHub Desktop.
Install Arch Linux on Microsoft Surface Laptop (linux-surface)

If you get error Failed to read disk ... with lsblk when installi9ng Arch Linux with archinstall, try this:

  1. Boot archiso.

  2. Run lsblk:

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 705.6M  1 loop /run/archiso/airootfs
sda           8:0    1  29.9G  0 disk
└─sda2        8:2    1    15M  0 part
nvme0n1     259:0    0 476.9G  0 disk
├─nvme0n1p1 259:1    0   100M  0 part
├─nvme0n1p2 259:2    0   128M  0 part
├─nvme0n1p3 259:3    0   475G  0 part
└─nvme0n1p4 259:4    0   1.7G  0 part
  1. Observe the MAJ number of the device that causes archinstall to fail, it is most certainly the flash drive which archiso booted off of. I note that /sda has a MAJ value of 8.

  2. Run this patch command, editing the -e 8 portion to match the MAJ of the device that's erroring for you. Note: This command recursively edits every instance of lsblk run by archinstall to exclude the specific device.

find /usr/lib/python3.10/site-packages/archinstall/ -type f -exec sed -i "s/lsblk --json/lsblk -a -e 8 --json/g" {} \;
  1. Run archinstall and install on the desired drive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment