Difference between revisions of "User:Sporadiccrash"

From ArchWiki
Jump to navigation Jump to search
(More informatioon about multi-boot possibilities on my computer)
m (→‎General: small typo)
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
+
== Computer ==
I am a [[Dell_Latitude_E7440|Dell Latitude E7440]] User. Had installed Arch Linux once in 2008 on a Athlon XP 2800+ machine. Now using Lubuntu but preparing the laptop for multi-boot for Arch Linux and Lubuntu.
+
Had installed Arch Linux once in 2008 on an Athlon XP 2800+ machine. Now using Lubuntu but preparing the laptop for multi-boot for Arch Linux and Lubuntu.
== Configuration ==
+
{| class="wikitable"
=== UEFI options ===
+
|+ Configuration
* SecureBoot: enabled
+
! item !! value
* Virtualization: enabled
+
|-
* TPM: enabled
+
| computer || [[Dell_Latitude_E7440|Dell Latitude E7440]]
* Bluetooth: disabled
+
|-
=== Partitions ===
+
| CPU || i7-4600U
* /dev/sda1 GRUB EFI secureboot loader shimx64.efi
+
|-
* /dev/sda2 swap
+
| RAM || 8 GB DDR3L
* /dev/sda3 unused 8 GB - for future RAM upgrade to 16 GB
+
|-
* /dev/sda4 user data directory  
+
| harddisk || 256 GB Samsung PM851
* /dev/sda5 Lubuntu 19.04 - mounted /dev/sda1 as /boot/efi
+
|}
* Unused area - to be partitioned as /dev/sda6 (Arch Linux) and /dev/sda7 (another distro)
+
{| class="wikitable"
=== Multi-Boot of Arch Linux and Lubuntu ===
+
|+ UEFI options
* Lubuntu installed first, /boot/efi contains Ubuntu EFI stub.
+
! item !! value !! comment
* Arch Linux to be installed into /dev/sda6. Since /boot/efi is coming from /dev/sda1, /boot of Arch Linux will be /dev/sda6. Since /boot of Lubuntu is on /dev/sda5, both /boot directories cannot conflict.
+
|-
* A custom GRUB menu to be created in /etc/grub.d/ so that Lubuntu can find Arch.
+
| SecureBoot || disabled || vmlinuz in ISO is not signed
* I am trying to find a way how to create a maintenance-free top-level Grub configuration menu.
+
|-
 +
| Virtualization || enabled || not used yet
 +
|-
 +
| TPM || enabled || not used yet
 +
|-
 +
| Bluetooth || disabled || probably won't use
 +
|}
 +
== Multi-Boot of Arch Linux with Lubuntu ==
 +
=== General ===
 +
* [https://lubuntu.me/downloads/ Lubuntu] was installed first (version 19.04). Arch Linux was installed afterwards (version 2019.08.01).
 +
* Lubuntu was installed on /dev/sda5. Lubuntu partition was never mounted in / at Arch.
 +
* Arch Linux was installed on /dev/sda6. ESP on /dev/sda1 has mountpoint /boot/efi in Lubuntu, it is not mounted in Arch.
 +
* /boot of Arch Linux is on /dev/sda6. /boot of Lubuntu is on /dev/sda5. Since Lubuntu is not mounted in / on Arch, /boot directories of Lubuntu and Arch cannot conflict.
 +
* Custom GRUB menu entries were created in /etc/grub.d/ on /dev/sda5 (Lubuntu) so that GRUB installed by Lubuntu can find Arch setups.
 +
{| class="wikitable"
 +
|+ Partition Table
 +
! Partition !! filesystem !! usage
 +
|-
 +
| /dev/sda1 || FAT32 || GRUB EFI boot loader /boot/efi/EFI/ubuntu/shimx64.efi, mountpoint /boot/efi in Lubuntu
 +
|-
 +
| /dev/sda2 || swap || swap for all operating systems
 +
|-
 +
| /dev/sda3 || unused || 8 GB spare for swap or future RAM upgrade to 16 GB
 +
|-
 +
| /dev/sda4 || ext4 || user data directory, disk label=USER_DATA, mentioned in Grub menuentry below
 +
|-
 +
| /dev/sda5 || btrfs || Lubuntu 19.04, /dev/sda1 is mounted in mountpoint /boot/efi
 +
|-
 +
| /dev/sda6 || btrfs || Arch Linux
 +
|}
 +
 
 +
=== Deviations from [[Installation_Guide|Arch Linux Installation]] ===
 +
[[Installation_guide#Boot_the_live_environment|1.2 Boot the live environment]]
 +
You don't need to burn ISO on a USB stick. GRUB can boot an ISO image on any partition. In this example, ISO was [https://www.archlinux.org/download/ downloaded] in Lubuntu environment. A GRUB menuentry was created in Lubuntu, which can be seen below. ISO was downloaded into /dev/sda4, which corresponds to {{ic|1=set root=(hd0,4)}}.
 +
{{hc
 +
|head=/etc/grub.d/25_archiso
 +
|output=
 +
#!/bin/sh
 +
exec tail -n +3 $0
 +
 
 +
# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Manual_configuration
 +
# use device label instead of UUID
 +
set imgdevpath=/dev/disk/by-label/USER_DATA
 +
 
 +
# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Arch_Linux_monthly_release
 +
# root to be set to partition where GRUB is, so that GRUB can pass all relative paths correctly
 +
 
 +
menuentry 'ARCH ISO' --class arch {
 +
  set root=(hd0,4)
 +
  set isofile=/distros/archlinux-2019.08.01-x86_64.iso
 +
  loopback loop $isofile
 +
  linux (loop)/arch/boot/x86_64/vmlinuz img_dev=$imgdevpath img_loop=$isofile earlymodules=loop
 +
  initrd (loop)/arch/boot/intel_ucode.img (loop)/arch/boot/amd_ucode.img (loop)/arch/boot/x86_64/archiso.img
 +
}
 +
}}
 +
You can change the ISO filename to your current one. You can also change the partition according to your needs.
 +
 +
[[Installation_guide#Partition_the_disks|1.7 Partition the disks]]
 +
Arch is installed after Lubuntu. Lubuntu already has a swap. Just run the command {{bc|swapon <swap partition> }} For multi-boot, '''don't run''' {{ic|mkswap}} otherwise  it will change the UUID of the swap partition, which will increase the boot time on both operating systems (90 seconds).
 +
 
 +
To boot Arch ISO or installed Arch from Lubuntu Grub, you don't need to mount ESP (in this example it is /dev/sda1 - at Lubuntu its mountpoint was /boot/efi), which will be explained in Boot loader section below.
 +
 
 +
[[Installation_guide#Install_the_base_packages|2.2 Install the base packages]]
 +
{{ic|pacstrap /mnt base}} does not install Grub, CPU microcode, wireless utilities. Run following command instead:
 +
{{bc|pacstrap /mnt base base-devel intel-ucode dialog wpa_supplicant wireless-tools iw grub networkmanager dhclient}}
 +
 
 +
[[Systemd-networkd]] with [[WPA_supplicant]] would be sufficient to set up wireless connection. The other wireless packages are installed just in case, they can be uninstalled later on.
 +
 
 +
[[Installation_guide#Boot_loader|3.8 Boot loader]] Don't install GRUB as boot loader, because there is already a GRUB which was installed by Lubuntu on /dev/sda1. Instead, run {{ic|grub-mkconfig /boot/grub.cfg}}. The generated GRUB file can be called in Lubuntu environment. Go back to Lubuntu and create following file:
 +
{{hc
 +
|head=/etc/grub.d/26_archdisk
 +
|output=
 +
#!/bin/sh
 +
exec tail -n +3 $0
 +
 
 +
menuentry 'Arch Linux' --class arch {
 +
  set root=(hd0,6)
 +
  configfile /boot/grub.cfg
 +
}
 +
}}
 +
Run in Lubuntu {{ic|sudo update-grub}} and reboot. In GRUB menu you will see Arch Linux.

Revision as of 21:54, 6 August 2019

Computer

Had installed Arch Linux once in 2008 on an Athlon XP 2800+ machine. Now using Lubuntu but preparing the laptop for multi-boot for Arch Linux and Lubuntu.

Configuration
item value
computer Dell Latitude E7440
CPU i7-4600U
RAM 8 GB DDR3L
harddisk 256 GB Samsung PM851
UEFI options
item value comment
SecureBoot disabled vmlinuz in ISO is not signed
Virtualization enabled not used yet
TPM enabled not used yet
Bluetooth disabled probably won't use

Multi-Boot of Arch Linux with Lubuntu

General

  • Lubuntu was installed first (version 19.04). Arch Linux was installed afterwards (version 2019.08.01).
  • Lubuntu was installed on /dev/sda5. Lubuntu partition was never mounted in / at Arch.
  • Arch Linux was installed on /dev/sda6. ESP on /dev/sda1 has mountpoint /boot/efi in Lubuntu, it is not mounted in Arch.
  • /boot of Arch Linux is on /dev/sda6. /boot of Lubuntu is on /dev/sda5. Since Lubuntu is not mounted in / on Arch, /boot directories of Lubuntu and Arch cannot conflict.
  • Custom GRUB menu entries were created in /etc/grub.d/ on /dev/sda5 (Lubuntu) so that GRUB installed by Lubuntu can find Arch setups.
Partition Table
Partition filesystem usage
/dev/sda1 FAT32 GRUB EFI boot loader /boot/efi/EFI/ubuntu/shimx64.efi, mountpoint /boot/efi in Lubuntu
/dev/sda2 swap swap for all operating systems
/dev/sda3 unused 8 GB spare for swap or future RAM upgrade to 16 GB
/dev/sda4 ext4 user data directory, disk label=USER_DATA, mentioned in Grub menuentry below
/dev/sda5 btrfs Lubuntu 19.04, /dev/sda1 is mounted in mountpoint /boot/efi
/dev/sda6 btrfs Arch Linux

Deviations from Arch Linux Installation

1.2 Boot the live environment You don't need to burn ISO on a USB stick. GRUB can boot an ISO image on any partition. In this example, ISO was downloaded in Lubuntu environment. A GRUB menuentry was created in Lubuntu, which can be seen below. ISO was downloaded into /dev/sda4, which corresponds to set root=(hd0,4).

/etc/grub.d/25_archiso
#!/bin/sh
exec tail -n +3 $0

# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Manual_configuration
# use device label instead of UUID
set imgdevpath=/dev/disk/by-label/USER_DATA

# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Arch_Linux_monthly_release
# root to be set to partition where GRUB is, so that GRUB can pass all relative paths correctly

menuentry 'ARCH ISO' --class arch {
  set root=(hd0,4)
  set isofile=/distros/archlinux-2019.08.01-x86_64.iso
  loopback loop $isofile
  linux (loop)/arch/boot/x86_64/vmlinuz img_dev=$imgdevpath img_loop=$isofile earlymodules=loop
  initrd (loop)/arch/boot/intel_ucode.img (loop)/arch/boot/amd_ucode.img (loop)/arch/boot/x86_64/archiso.img
}

You can change the ISO filename to your current one. You can also change the partition according to your needs.

1.7 Partition the disks

Arch is installed after Lubuntu. Lubuntu already has a swap. Just run the command

swapon <swap partition> 

For multi-boot, don't run mkswap otherwise it will change the UUID of the swap partition, which will increase the boot time on both operating systems (90 seconds).

To boot Arch ISO or installed Arch from Lubuntu Grub, you don't need to mount ESP (in this example it is /dev/sda1 - at Lubuntu its mountpoint was /boot/efi), which will be explained in Boot loader section below.

2.2 Install the base packages pacstrap /mnt base does not install Grub, CPU microcode, wireless utilities. Run following command instead:

pacstrap /mnt base base-devel intel-ucode dialog wpa_supplicant wireless-tools iw grub networkmanager dhclient

Systemd-networkd with WPA_supplicant would be sufficient to set up wireless connection. The other wireless packages are installed just in case, they can be uninstalled later on.

3.8 Boot loader Don't install GRUB as boot loader, because there is already a GRUB which was installed by Lubuntu on /dev/sda1. Instead, run grub-mkconfig /boot/grub.cfg. The generated GRUB file can be called in Lubuntu environment. Go back to Lubuntu and create following file:

/etc/grub.d/26_archdisk
#!/bin/sh
exec tail -n +3 $0

menuentry 'Arch Linux' --class arch {
  set root=(hd0,6)
  configfile /boot/grub.cfg
}

Run in Lubuntu sudo update-grub and reboot. In GRUB menu you will see Arch Linux.