Arch Linux: installing with EFI and Windows dual-boot

Disks

[root@archiso ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 476.7M 1 loop /run/archiso/sfs/airootfs
sda 8:0 0 223.6G 0 disk
sdb 8:16 0 931.5G 0 disk
sdc 8:32 1 28.9G 0 disk
├─sdc1 8:33 1 588M 0 part /run/archiso/bootmnt
└─sdc2 8:34 1 64M 0 part
  • /dev/sda - SSD, will be for Windows
  • /dev/sdb - HDD, for Arch Linux
  1. sdb1 - EFI, 512,
  2. sdb2 - boot, 1G
  3. sdb3 - swap, 32G
  4. sda4 - LVM, all

fdisk

[root@archiso ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.33).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x73c946df

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1–4, default 1):
First sector (2048–1953525167, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048–1953525167, default 1953525167): +512M
Created a new partition 1 of type ‘Linux’ and of size 512 MiB.

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): L

10 OPUS 55 EZ-Drive a7 NeXTSTEP ef EFI (FAT-12/16/

Hex code (type L to list all codes): ef
Changed type of partition ‘Linux’ to ‘EFI (FAT-12/16/32)’.

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2–4, default 2):
First sector (1050624–1953525167, default 1050624):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1050624–1953525167, default 1953525167): +1G
Created a new partition 2 of type ‘Linux’ and of size 1 GiB.

Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (3,4, default 3):
First sector (3147776–1953525167, default 3147776):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (3147776–1953525167, default 1953525167): +32G
Created a new partition 3 of type ‘Linux’ and of size 32 GiB.

Command (m for help): t
Partition number (1–3, default 3):
Hex code (type L to list all codes): 82
Changed type of partition ‘Linux’ to ‘Linux swap / Solaris’.

Command (m for help): n
Partition type
p primary (3 primary, 0 extended, 1 free)
e extended (container for logical partitions)
Select (default e): p
Selected partition 4
First sector (70256640–1953525167, default 70256640):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (70256640–1953525167, default 1953525167):
Created a new partition 4 of type ‘Linux’ and of size 898 GiB.

Command (m for help): p
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x73c946df
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1050623 1048576 512M ef EFI (FAT-12/16/32)
/dev/sdb2 1050624 3147775 2097152 1G 83 Linux
/dev/sdb3 3147776 70256639 67108864 32G 82 Linux swap / Solaris
/dev/sdb4 70256640 1953525167 1883268528 898G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

LVM

[root@archiso ~]# pvcreate /dev/sdb4
Physical volume “/dev/sdb4” successfully created.
[root@archiso ~]# vgcreate vg_arch /dev/sdb4
Volume group “vg_arch” successfully created
[root@archiso ~]# lvcreate -L 100G -n root vg_arch
Logical volume “root” created.
[root@archiso ~]# lvcreate -l 100%FREE -n home vg_arch
Logical volume “home” created.

Filesystems creation

[root@archiso ~]# mkfs.fat -F32 /dev/sdb1
mkfs.fat 4.1 (2017–01–24)
[root@archiso ~]# mkfs.ext2 /dev/sdb2
[root@archiso ~]# mkfs.ext4 /dev/vg_arch/root
[root@archiso ~]# mkfs.ext4 /dev/vg_arch/home
[root@archiso ~]# mkswap /dev/sdb3
Setting up swapspace version 1, size = 32 GiB (34359734272 bytes)
no label, UUID=14e18ccc-11f4–4e2b-baf2-c141735b8800
[root@archiso ~]# swapon /dev/sdb3
[root@archiso ~]# mount /dev/vg_arch/root /mnt/
[root@archiso ~]# mkdir /mnt/home
[root@archiso ~]# mount /dev/vg_arch/home /mnt/home/
[root@archiso ~]# mount /dev/sdb2 /mnt/boot/
[root@archiso ~]# mkdir /mnt/boot/EFI
[root@archiso ~]# mount /dev/sdb1 /mnt/boot/EFI

Arch Linux install

[root@archiso ~]# pacstrap -i /mnt base base-devel openssh vim
[root@archiso ~]# genfstab -pU /mnt >> /mnt/etc/fstab
[root@archiso ~]# arch-chroot /mnt /bin/bash
HOOKS=(base udev autodetect keyboard keymap modconf block lvm2 filesystems fsck)
[root@archiso /]# cd /boot/ && mkinitcpio -p linux

GRUB

[root@archiso boot]# pacman -S grub efibootmgr dosfstools os-prober mtools
[root@archiso boot]# grub-install — target=x86_64-efi — bootloader-id=ArchLinux — recheck
Installing for x86_64-efi platform.
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
Installation finished. No error reported.
[root@archiso boot]# grub-mkconfig -o /boot/grub/grub.cfg
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done

Windows dual boot

[root@archlinux /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
|-sda1 8:1 0 499M 0 part
|-sda2 8:2 0 100M 0 part
|-sda3 8:3 0 16M 0 part
`-sda4 8:4 0 223G 0 part
sdb 8:16 0 931.5G 0 disk
|-sdb1 8:17 0 512M 0 part /boot/EFI
|-sdb2 8:18 0 1G 0 part /boot
|-sdb3 8:19 0 32G 0 part [SWAP]
`-sdb4 8:20 0 898G 0 part
|-vg_arch-root 254:0 0 100G 0 lvm /
`-vg_arch-home 254:1 0 798G 0 lvm /home
sdc 8:32 1 28.9G 0 disk
|-sdc1 8:33 1 588M 0 part
`-sdc2 8:34 1 64M 0 part
[root@archlinux /]# pacman -S os-prober
[root@archlinux /]# fdisk -l /dev/sda
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 78241A73–6994–4D0B-9FCB-433076B5EC41
Device Start End Sectors Size Type
/dev/sda1 2048 1023999 1021952 499M Windows recovery environment
/dev/sda2 1024000 1228799 204800 100M EFI System
/dev/sda3 1228800 1261567 32768 16M Microsoft reserved
/dev/sda4 1261568 468860927 467599360 223G Microsoft basic data
[root@archlinux /]# mount /dev/sda2 /mnt/
[root@archlinux /]# ls -l /mnt/
total 1
drwxr-xr-x 4 root root 1024 Feb 24 10:24 EFI
[root@archlinux /]# os-prober
/dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
[root@archlinux /]# cp /boot/grub/grub.cfg /boot/grub/grub.cfg-origin
[root@archlinux /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
done

Similar posts about Arch install (in Russian)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store