メインコンテンツまでスキップ

Dual boot (with Windows 11) + btrfs + systemd-boot

Install Arch Linux with the following settings.

Settings
Dual BootingWindows 11
FilesystemBtrfs
Boot LoaderSystemd-boot
Disksingle-disk
Disk Encryptionfalse

Install Windows 11

diskpart

At first, install Windows 11.

Boot from ISO which can be downloaded from here, and choose drive to install Windows 11.

You can install with the default layout, but I recommend to use custom layout. This is because the size of the default EFI partition is 100 MB.

It is possible to manage linux and windows images in that size of partition, but some tweaks is needed, for example, compressing initramfs with xz.

In this example I will allocate 500 MB for the EFI partition.

When the following installation screen appears, press shift + F10 to open cmd.

Then, use diskpart for partitioning. Select a disk with SELECT and convert it to GPT if necessary.

Run CREATE to create partitions.

Each command is explained by running help, so if you do not understand a command, you can look it up as needed.

After partitioning, exit diskpart and cmd.

Press Refresh and install Windows 11 on the primary partition.

Bypass sign-in (option)

When you see sign-in window like above, press Shift + F10 and run:

ipconfig /release

It will disconnect the network to make the sign in fail. After that, click Create one! to create local account.

Shrink

We need to get a free disk for Linux, so we start the disk manager and shrink the disk.

Finally, downloads Arch Linux ISO from here and start installation.

Install Arch Linux

ISO

Arch Linux Downloads

Commands

loadkeys jp106
gdisk /dev/sda
mkfs.btrfs /dev/sda4
mount /dev/sda4 /mnt
btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@snapshots
btrfs su cr /mnt/@var_log
umount /mnt
mount -o noatime,compress=zstd,space_cache=v2,subvol=@ /dev/sda4 /mnt
mkdir -p /mnt/{boot,home,.snapshots,var/log}
mount -o noatime,compress=zstd,space_cache=v2,subvol=@home /dev/sda4 /mnt/home
mount -o noatime,compress=zstd,space_cache=v2,subvol=@snapshots /dev/sda4 /mnt/.snapshots
mount -o noatime,compress=zstd,space_cache=v2,subvol=@var_log /dev/sda4 /mnt/var/log
mount /dev/sda1 /mnt/boot
pacman -Syy
pacman -S archlinux-keyring
pacstrap /mnt base linux linux-firmware vim intel-ucode # or amd-ucode

genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt

ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
hwclock --systohc

vim /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo KEYMAP=jp106 >> /etc/vconsole.conf
echo arch > /etc/hostname
vim /etc/hosts
passwd

pacman -S efibootmgr networkmanager network-manager-applet \
dialog os-prober mtools dosfstools base-devel linux-headers \
git xdg-utils xdg-user-dirs

bootctl --path=/boot install
echo -e "timeout 10
default arch" > /boot/loader/loader.conf
echo -e "title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=xxxx rootflags=subvol=@ rw" > /boot/loader/entries/arch.conf
echo -e "title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux-fallback.img
options root=UUID=xxxx rootflags=subvol=@ rw" > /boot/loader/entries/arch-fallback.conf


vim /etc/mkinitcpio.conf
# btrfs, encrypt
mkinitcpio -p linux

systemctl enable NetworkManager

useradd -mG wheel mori
passwd mori

EDITOR=vim visudo

exit
umount -a
reboot