FocusedWolf

Arch: Repair notes

Nov 14th, 2025 (edited)
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.44 KB | None | 0 0
  1. If repairing a virtual machine:
  2.  
  3. 0. If settings are greyed out then start virtual machine and perform [$ sudo shutdown now].
  4.  
  5. 1. Settings > Storage:
  6.  
  7. Controller: IDE
  8.  
  9. Click CD icon > select archlinux iso.
  10.  
  11. 2. Disable EFI boot: <-- The Arch ISO won't boot in UEFI mode for whatever reason. No issue on computer but this affects virtual machines i think.
  12.  
  13. Settings > System:
  14.  
  15. [ ] Enable EFI (special OSes only) <-- The CD won't boot with EFI enabled.
  16.  
  17. 3. Start virtual machine.
  18.  
  19. -----
  20.  
  21. 0. Boot with Arch usb plugged in.
  22.  
  23. 1. Select "Arch Linux install medium (x86_64, BIOS)
  24.  
  25. 2. Connect to the internet from the Arch main-menu: <-- Needed if using wi-fi to get online because [$ nmtui] won't work after arch-chroot for whatever reason.
  26.  
  27. For wireless and WWAN, make sure the card is not blocked with rfkill.
  28.  
  29. 1. Connect to the network:
  30.  
  31. Ethernet:
  32.  
  33. Plug in the cable.
  34.  
  35. --------------------------------------------------------------------------------
  36.  
  37. Wi-Fi:
  38.  
  39. Start the interactive prompt:
  40.  
  41. $ iwctl <-- NOTE: Use $ exit or Ctrl + D to quit the interactive prompt.
  42.  
  43. NOTE: You can use all commands as command line arguments without entering an interactive prompt, e.g. [$ iwctl device wlan0 show].
  44.  
  45. NOTE: To list all available commands use [$ help].
  46.  
  47. Connect to a network:
  48.  
  49. 1. List all Wi-Fi devices:
  50.  
  51. $ device list
  52.  
  53. 2. If the device or its corresponding adapter is turned off, turn it on:
  54.  
  55. $ device <device> set-property Powered on
  56. $ adapter <adapter> set-property Powered on
  57.  
  58. 3. Scan for networks:
  59.  
  60. $ station <device> scan
  61. $ station <device> get-networks
  62.  
  63. 4. Connect to a network:
  64.  
  65. $ station <device> connect "Case-Sensitive SSID"
  66.  
  67. NOTE: The command line equivalent: [$ iwctl --passphrase <pw> station <device> connect SSID]
  68.  
  69. NOTE: iwd automatically stores network passphrases in /var/lib/iwd/ and uses them to auto-connect in the future.
  70. iwd only supports PSK pass-phrases from 8 to 63 ASCII-encoded characters. The following error message will be given if the requirements are not met: PMK generation failed. Ensure Crypto Engine is properly configured.
  71.  
  72. NOTE: For automatic IP and DNS configuration via DHCP, you have to manually enable the built-in DHCP client or configure a standalone DHCP client.
  73.  
  74. NOTE: The user interface supports autocomplete. Typing station or connect and Tab Tab, the available devices or networks are displayed,
  75. Type the first letters of the device or network and Tab to complete.
  76.  
  77. Connect to a network using WPS/WSC:
  78.  
  79. If your network is configured such that you can connect to it by pressing a button:
  80.  
  81. $ wsc list
  82.  
  83. If your device appeared in the above list:
  84.  
  85. $ wsc <device> push-button
  86.  
  87. And push the button on your router. The procedure works also if the button was pushed beforehand, less than 2 minutes earlier.
  88.  
  89. If your network requires to validate a PIN number to connect that way, check the $ help command output to see how to provide the right options to the wsc command.
  90.  
  91. --------------------------------------------------------------------------------
  92.  
  93. 1. Disconnect from a network:
  94.  
  95. $ station <device> disconnect
  96.  
  97. 2. Show device and connection information:
  98.  
  99. $ device <device> show
  100.  
  101. 3. Display the connection state:
  102.  
  103. $ station <device> show
  104.  
  105. 4. Manage known networks:
  106.  
  107. $ known-networks list
  108.  
  109. 5. Forget a known network:
  110.  
  111. $ known-networks "SSID" forget
  112.  
  113. --------------------------------------------------------------------------------
  114.  
  115. 2. Ensure your network interface is listed and enabled:
  116.  
  117. $ ip link
  118.  
  119. 3. The connection may be verified with ping:
  120.  
  121. $ ping -c 3 archlinux.org
  122.  
  123. -----
  124.  
  125. 1. Get drive names:
  126.  
  127. WARNING: If you are here and did not get online first, then read from the top of this file again.
  128. If you arch-chroot before iwctl then you are not getting online (with wi-fi) because iwctl will not work after arch-chroot for some reason.
  129.  
  130. $ lsblk <-- Or [$ df -Th] [$ mount] [$ fdisk -l]
  131.  
  132. Or
  133.  
  134. $ lsblk -o NAME,MOUNTPOINT,LABEL,FSTYPE,SIZE,UUID <-- Displays more drive info.
  135.  
  136. 2. Mount the file systems:
  137.  
  138. EXT4 Notes:
  139.  
  140. Mount the root partition to "/":
  141.  
  142. $ mount /dev/<root partition> /mnt/
  143.  
  144. Mount the home partition to "/home":
  145.  
  146. $ mount /dev/<home partition> /mnt/home
  147.  
  148. Mount the EFI partition to "/efi":
  149.  
  150. If using "/efi" location:
  151.  
  152. $ mkdir -p /mnt/efi
  153. $ mount /dev/<efi partition> /mnt/efi
  154.  
  155. Or if using "/boot/efi" location:
  156.  
  157. $ mkdir -p /mnt/boot/efi
  158. $ mount /dev/<efi partition> /mnt/boot/efi
  159.  
  160. BTRFS Notes: <-- WARNING: Untested AI generated notes.
  161.  
  162. 1. Identify partitions:
  163. lsblk -f
  164.  
  165. Example layout:
  166. sda1 btrfs root
  167. sda2 btrfs home
  168. sda3 vfat EFI
  169.  
  170. 2. Create mount points:
  171. mkdir -p /mnt
  172. mkdir -p /mnt/home
  173. mkdir -p /mnt/efi
  174.  
  175. 3. Check for existing subvolumes:
  176. btrfs subvolume list /dev/sda1
  177. btrfs subvolume list /dev/sda2
  178.  
  179. 4. Mount root and home:
  180. NOTE: Adjust the subvolume names in the mount commands to match what [$ btrfs subvolume list] shows.
  181.  
  182. mount -o subvol=@ /dev/sda1 /mnt # root
  183. mount -o subvol=@home /dev/sda2 /mnt/home # home, if separate partition with @ subvolume
  184.  
  185. 5. Mount EFI partition:
  186. mount /dev/sda3 /mnt/efi
  187.  
  188. 6. Verify mounts:
  189. lsblk -f
  190.  
  191. 3. Check the file system is mounted correctly:
  192.  
  193. $ lsblk <-- Or [$ df -Th] [$ mount] [$ fdisk -l]
  194.  
  195. Or
  196.  
  197. $ lsblk -o NAME,MOUNTPOINT,LABEL,FSTYPE,SIZE,UUID <-- Displays more drive info.
  198.  
  199. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  200. sda 8:0 0 50G 0 disk
  201. └─sda1 8:1 0 50G 0 part /mnt
  202. sdb 8:16 0 8G 0 disk
  203. └─sdb1 8:17 0 7G 0 part /mnt/home
  204. └─sdb2 8:18 0 1022M 0 part /mnt/efi
  205.  
  206. 4. Change-root into the new system:
  207.  
  208. $ arch-chroot /mnt/
  209.  
  210. -----
  211.  
  212. 1. Update pacman mirrors:
  213.  
  214. $ sudo reflector --verbose --country "United States" --protocol https --sort rate --age 6 --save /etc/pacman.d/mirrorlist
  215.  
  216. 2. Use pacman to update or fix package issues:
  217.  
  218. Refresh package databases and ensure keyring is up-to-date: https://www.reddit.com/r/archlinux/comments/1leg9ds/why_doesnt_pacman_just_install_archlinuxkeyring/
  219. $ pacman -Syy --noconfirm --needed archlinux-keyring <-- Pacman 7.1.0+ should auto-refresh keys so in theory this is unnecessary: https://www.reddit.com/r/archlinux/comments/1olm2hc/pacman710_released
  220.  
  221. $ pacman -Syyu <-- If this gives errors then you might need to do step 3 first.
  222.  
  223. $ pacman -S <install missing packages to fix issue>
  224.  
  225. $ pacman -Qkk <-- Check integrity of packages.
  226.  
  227. 3. Reinstalling kernel:
  228.  
  229. Untested new way since udev was merged into systemd:
  230.  
  231. 1. $ pacman -S systemd linux mkinitcpio
  232. 2. $ mkinitcpio -P <-- Might be able to skip if step 1 performs this via the kernel's pacman hook.
  233.  
  234. Or old udev notes <-- Might be useful if repairing an outdated arch.
  235.  
  236. SOURCE: https://bbs.archlinux.org/viewtopic.php?id=148037
  237. 1. $ pacman -S udev linux mkinitcpio
  238. 2. $ mkinitcpio -P <-- Might be able to skip if step 1 performs this via the kernel's pacman hook.
  239.  
  240. 4. Reinstalling bootloader: <-- I use grub btw.
  241.  
  242. NOTE: This might be needed to recreate the NVRAM entry for Arch so the BIOS knows what partition will boot Linux.
  243.  
  244. 1. Installation:
  245.  
  246. WARNING: I use the new /efi path. If using /boot/efi then use this --efi-directory=/boot/efi
  247.  
  248. $ grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=Arch --removable
  249.  
  250. 2. Generate the main configuration file:
  251.  
  252. NOTE: If you're experiencing black screen nvidia driver issues then you might need to first edit GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
  253.  
  254. $ grub-mkconfig -o /boot/grub/grub.cfg <-- Some distros have a $ update-grub script that does this.
  255.  
  256. -----
  257.  
  258. 1. Exiting chroot and shutting down machine:
  259.  
  260. $ exit or Ctrl+d
  261.  
  262. $ umount -lR /mnt/ <-- Unmount all partitions.
  263.  
  264. $ shutdown now <-- NOTE: On a non-root account use [$ sudo shutdown now].
  265.  
  266. Remove installation media.
  267.  
  268. 2. If repairing a virtual machine:
  269.  
  270. 1. Settings > Storage:
  271.  
  272. Controller: IDE
  273.  
  274. Eject iso if still mounted.
  275.  
  276. 2. Enable EFI boot:
  277.  
  278. Settings > System:
  279.  
  280. [x] Enable EFI (special OSes only)
  281.  
Advertisement
Add Comment
Please, Sign In to add comment