Or, How I switched an existing ubuntu install to arch linux without losing data, or rejoining my domain.
The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
This guide has been forked from https://gist.github.com/binaerbaum/535884a7f5b8a8697557
I switched an existing ubuntu install to arch linux without data loss.
Download the archiso image from https://www.archlinux.org/. Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
wifi-menu
My ubuntu install had /boot
and /boot/efi
as separate partitions. Systemd-boot doesnt like multiple partitions, so I just mount the efi partion at /boot
. The leaves the /boot
partition unused. One could reallocate that a later time.
cryptsetup open --type=luks /dev/nvme0n1p3 crypted
mount /dev/mapper/ubuntu--vg-root /mnt
mount /dev/nvme0n1p3 /mnt/boot
swapon /dev/mapper/ubuntu--vg-swap1
cd /mnt
mkdir ubuntu
setopt extended_glob
test mv -- {^,}ubuntu
This includes stuff needed for starting wifi when first booting into the newly installed system
pacstrap /mnt base base-devel zsh vim git sudo efibootmgr dialog wpa_supplicant
genfstab -pU /mnt >> /mnt/etc/fstab
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
Change relatime on all non-boot partitions to noatime (reduces wear if using an SSD)
arch-chroot /mnt /bin/bash
ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
hwclock --systohc --utc
echo MYHOSTNAME > /etc/hostname
Uncomment wanted locales in /etc/locale.gen
vim /etc/locale.gen
locale-gen
localectl set-locale LANG=en_US.UTF-8
To avoid problems with gnome-terminal set locale system wide Do NOT set LC_ALL=C. It overrides all the locale vars and messes up special characters Pay attention to the UTF-8. Capital letters !
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo LC_ALL= >> /etc/locale.conf
passwd
Add real user remove -s flag if you don't whish to use zsh
useradd -m -g users -G wheel,storage,power -s /bin/zsh MYUSERNAME
passwd MYUSERNAME
vim /etc/mkinitcpio.conf
- Add 'ext4' to MODULES
- Add 'encrypt' and 'lvm2' to HOOKS before filesystems
- Add 'resume' after 'lvm2' (also has to be after 'udev')
mkinitcpio -p linux
bootctl --path=/boot install
echo 'default arch' >> /boot/loader/loader.conf echo 'timeout 5' >> /boot/loader/loader.conf
vim /boot/loader/entries/arch.conf
is the the one of the raw encrypted device (/dev/nvme0n1p2). It can be found with the 'blkid' command
title Arch Linux linux /vmlinuz-linux initrd /initramfs-linux.img options cryptdevice=UUID=:vg0 root=/dev/mapper/vg0-root resume=/dev/mapper/vg0-swap rw intel_pstate=no_hwp
exit
umount -R /mnt swapoff -a
reboot