2019-05-15 18:10:09 +00:00
|
|
|
---
|
|
|
|
title: arch_install
|
|
|
|
---
|
2019-04-16 11:43:21 +00:00
|
|
|
The following is a brief installation tutorial for [Arch Linux][1]. It assumes
|
|
|
|
familiarity with the Arch [Beginner's Guide][2] and [Installation Guide][3].
|
|
|
|
|
2019-04-16 13:38:08 +00:00
|
|
|
It will provide a system using [LVM on LUKS][4].
|
2019-04-16 11:43:21 +00:00
|
|
|
|
|
|
|
Note that this guide assumes you are performing the install to `/dev/sda`. In
|
|
|
|
some cases, you may find that your USB install disk claimed `/dev/sda` and you
|
|
|
|
want to install to `/dev/sdb`. Confirm which disk is which before proceeding.
|
|
|
|
|
|
|
|
Boot into the Arch installer.
|
|
|
|
|
|
|
|
If your console font is tiny ([HiDPI][7] systems), set a new font.
|
|
|
|
|
|
|
|
$ setfont sun12x22
|
|
|
|
|
|
|
|
Connect to the Internet.
|
|
|
|
|
|
|
|
Verify that the [system clock is up to date][8].
|
|
|
|
|
|
|
|
$ timedatectl set-ntp true
|
|
|
|
|
2019-09-15 16:09:47 +00:00
|
|
|
(bios mode)
|
|
|
|
|
2019-09-15 16:10:51 +00:00
|
|
|
$ parted -s /dev/sda mklabel msdos
|
|
|
|
$ parted -s /dev/sda mkpart primary 1MiB 513MiB
|
|
|
|
$ parted -s /dev/sda mkpart primary 1024MiB 100%
|
|
|
|
$ mkfs.ext2 /dev/sda1
|
|
|
|
$ mkfs.ext4 /dev/sda2
|
2019-04-16 11:43:21 +00:00
|
|
|
|
|
|
|
(UEFI mode) Create partitions for EFI, boot, and root.
|
|
|
|
|
|
|
|
$ parted -s /dev/sda mklabel gpt
|
|
|
|
$ parted -s /dev/sda mkpart primary fat32 1MiB 513MiB
|
|
|
|
$ parted -s /dev/sda set 1 boot on
|
|
|
|
$ parted -s /dev/sda set 1 esp on
|
|
|
|
$ parted -s /dev/sda mkpart primary 513MiB 1024MiB
|
|
|
|
$ parted -s /dev/sda mkpart primary 1024MiB 100%
|
2019-04-16 13:38:08 +00:00
|
|
|
$ mkfs.ext4 /dev/sda2
|
|
|
|
$ mkfs.fat -F32 /dev/sda1
|
|
|
|
|
2019-04-16 11:43:21 +00:00
|
|
|
|
|
|
|
Create and mount the encrypted root filesystem. Note that for UEFI systems
|
|
|
|
this will be partition 3.
|
|
|
|
|
2019-04-16 13:38:08 +00:00
|
|
|
|
|
|
|
$ pvcreate /dev/sda3pc
|
2019-04-16 11:43:21 +00:00
|
|
|
$ vgcreate arch /dev/mapper/lvm
|
2019-04-16 13:38:08 +00:00
|
|
|
$ lvcreate -L 4G arch -n swap
|
2019-04-16 11:43:21 +00:00
|
|
|
$ lvcreate -L 30G arch -n root
|
|
|
|
$ lvcreate -l +100%FREE arch -n home
|
|
|
|
$ lvdisplay
|
|
|
|
$ mkswap -L swap /dev/mapper/arch-swap
|
|
|
|
$ mkfs.ext4 /dev/mapper/arch-root
|
|
|
|
$ mkfs.ext4 /dev/mapper/arch-home
|
|
|
|
$ mount /dev/mapper/arch-root /mnt
|
|
|
|
$ mkdir /mnt/home
|
|
|
|
$ mount /dev/mapper/arch-home /mnt/home
|
|
|
|
$ swapon /dev/mapper/arch-swap
|
|
|
|
|
|
|
|
(UEFI mode) Encrypt the boot partition using a separate passphrase from
|
|
|
|
the root partition, then mount the boot and EFI partitions.
|
|
|
|
|
|
|
|
$ mkdir /mnt/boot
|
2019-04-16 13:38:08 +00:00
|
|
|
$ mount /dev/sda2 /mnt/boot
|
2019-04-16 11:43:21 +00:00
|
|
|
$ mkdir /mnt/boot/efi
|
|
|
|
$ mount /dev/sda1 /mnt/boot/efi
|
|
|
|
|
|
|
|
Optionally [edit the mirror list][9].
|
|
|
|
|
|
|
|
$ vi /etc/pacman.d/mirrorlist
|
|
|
|
|
|
|
|
Install the [base system][10].
|
|
|
|
|
2019-04-16 13:52:08 +00:00
|
|
|
$ pacstrap -i /mnt base base-devel net-tools wireless_tools dialog wpa_supplicant openssh git grub ansible
|
2019-04-16 11:43:21 +00:00
|
|
|
(UEFI mode) $ pacstrap /mnt efibootmgr
|
|
|
|
|
|
|
|
Generate and verify [fstab][11].
|
|
|
|
|
|
|
|
$ genfstab -U -p /mnt >> /mnt/etc/fstab
|
|
|
|
$ less /mnt/etc/fstab
|
|
|
|
|
|
|
|
Change root into the base install and perform [base configuration tasks][12].
|
|
|
|
|
|
|
|
$ arch-chroot /mnt /bin/bash
|
|
|
|
$ systemctl enable dhcpcd.service
|
2019-04-16 13:52:08 +00:00
|
|
|
$ systemctl enable sshd.service
|
2019-04-16 11:43:21 +00:00
|
|
|
$ passwd
|
|
|
|
|
2019-09-15 16:34:07 +00:00
|
|
|
modifier /etc/ssh/sshd_config et mettre PermitRoorlogin yes
|
|
|
|
|
2019-04-16 13:38:08 +00:00
|
|
|
Set your mkinitcpio.
|
2019-09-15 15:38:08 +00:00
|
|
|
|
2019-09-15 15:29:48 +00:00
|
|
|
# only for UEFI
|
2019-04-16 13:38:08 +00:00
|
|
|
$ sed -i 's/^HOOKS=.*/HOOKS="base udev autodetect modconf block keyboard lvm2 resume filesystems fsck"/' /etc/mkinitcpio.conf
|
2019-09-15 15:29:48 +00:00
|
|
|
# for both
|
2019-04-16 11:43:21 +00:00
|
|
|
$ mkinitcpio -p linux
|
|
|
|
|
|
|
|
Configure GRUB.
|
|
|
|
|
2019-04-16 13:38:08 +00:00
|
|
|
# BIOS mode
|
2019-09-15 16:09:47 +00:00
|
|
|
$ grub-install /dev/sda
|
2019-04-16 11:43:21 +00:00
|
|
|
$ grub-mkconfig -o /boot/grub/grub.cfg
|
2019-04-16 13:38:08 +00:00
|
|
|
|
2019-04-16 11:43:21 +00:00
|
|
|
|
2019-04-16 13:38:08 +00:00
|
|
|
# UEFI mode
|
2019-04-16 11:43:21 +00:00
|
|
|
$ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck
|
2019-04-16 13:38:08 +00:00
|
|
|
$ grub-mkconfig -o /boot/grub/grub.cfg
|
2019-04-16 11:43:21 +00:00
|
|
|
$ chmod -R g-rwx,o-rwx /boot
|
|
|
|
|
|
|
|
Cleanup and reboot!
|
|
|
|
|
|
|
|
$ exit
|
|
|
|
$ umount -R /mnt
|
|
|
|
$ reboot
|
|
|
|
|
|
|
|
Run ansible!
|
|
|
|
|
|
|
|
|
|
|
|
[1]: https://www.archlinux.org/
|
|
|
|
[2]: https://wiki.archlinux.org/index.php/Beginners'_guide
|
|
|
|
[3]: https://wiki.archlinux.org/index.php/Installation_guide
|
|
|
|
[4]: https://wiki.archlinux.org/index.php/Encrypted_LVM#LVM_on_LUKS
|
|
|
|
[5]: http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/
|
|
|
|
[6]: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Encrypted_boot_partition_.28GRUB.29
|
|
|
|
[7]: https://wiki.archlinux.org/index.php/HiDPI
|
|
|
|
[8]: https://wiki.archlinux.org/index.php/Beginners'_guide#Update_the_system_clock
|
|
|
|
[9]: https://wiki.archlinux.org/index.php/Beginners'_Guide#Select_a_mirror
|
|
|
|
[10]: https://wiki.archlinux.org/index.php/Beginners'_Guide#Install_the_base_system
|
|
|
|
[11]: https://wiki.archlinux.org/index.php/Beginners'_guide#Generate_an_fstab
|
|
|
|
[12]: https://wiki.archlinux.org/index.php/Beginners'_guide#Configure_the_base_system
|