+++ Title = "Yet Another Arch Guide" Author = "Kristof Vandam - Adam Verbeeck" Categories = [ "administration" ] Tags = [ "arch" ] Date = 2018-11-30T10:08:22+02:00 Truncated = true Draft = false +++ Setting up Arch with other bells and whistles. ## Target Lenovo X240 i5-4300U 8GB DDR3 RAM 500GB SSD ## Pre-requirements * Bootable USB with Arch installer installed * Cabled connection * Device connected to a power supply ## First things first ### Keyboard layout ```.language-command loadkeys [keyboard-identifier] ``` ### Check your internet connection ```.language-command ping archlinux.org ``` ### Set timezone ```.language-command timedatectl set-timezone Europe/Brussels ``` ## Prepairing your disks ### Check which disks you have available ```.language-command fdisk -l ``` ### Partitioning Device your disk into individual partitions: 1. boot 2. arch 3. windows #### Some letters we gonna use * **p** show your partition * **n** new partition * **a** set the bootflag * **t** set the type * **L** show available types * **w** write the changes #### The actual work ```.language-command fdisk [your-disk] ``` press **n** to create a new partition, the first prompt asks the type of partition, use **p** for Primary Partition number, enter. first sector, enter. goto 'Specify your sizes'. #### Specify your sizes +[SIZE][TGMK] #### Set the bootflag A partition needs a bootflag for the MBR know which partition use at startup #### Set the types Use **t** to set the type: **83** for boot *(linux)* **8e** for arch *(lvm)* **7** for windows *(HPFS/NTFS/exFAT)* ### LVM ```.language-command pvcreate /dev/sda2 vgcreate vg0 /dev/sda2 lvcreate -L +2G -n swap vg0 lvcreate -l 100%FREE -n swap vg0 ``` ### Filesystems ```.language-command mkswap /dev/mapper/vg0-swap mkfs.ext4 /dev/sda1 mkfs.xfs /dev/mapper/vg0-root ``` ### Mount your disks and strap your seatbelt, we gonna pacstrap ```.language-command mount /dev/mapper/vg0-root /mnt mkdir /mnt/boot mount /dev/sda1 /mnt/boot ``` ```.language-command pacstrap /mnt base base-devel vim bash-completion networkmanager ``` ### Make sure it boots! genfstab -U /mnt >> /mnt/etc/fstab ### making it yours arch-chroot /mnt #### Time, Date, Region ```.language-command ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime hwclock --systohc locale-gen ``` /etc/locale.conf ```.language-command LANG=en_US.UTF-8 UTF-8 ``` /etc/vconsole.conf ```.language-command KEYMAP=be-latin1 ``` /etc/hostname ```.language-command myhostname ``` /etc/hosts ```.language-command 127.0.0.1 localhost ::1 localhost 127.0.0.1 myhostname.localdomain myhostname ``` ```.language-command passwd ``` ### Grub ```.language-command pacman -S grub grub-install /dev/sda grub-mkconfig > /boot/grub/grub.cfg ``` *Ignore warnings* ### fstab Add swap to fstab ```.language-command /dev/mapper/vg0-swap swap swap default 0 0 ``` Check your work by swapping the swap ```.language-command swapoff -a mount -a swapon -a free ``` does your swap have bytes? ### LVM can't bot Add the LVM module to the mkinitcpio config file at /etc/mkinitcpio.conf add *lvm2* to the HOOKS Array before filestystems ```.language-command ... HOOKS=(base udev autodetect modconf block lvm2 filestystems keyboard fsck) ... ``` ```.language-command mkinitcpio -p linux ``` ### Cross fingers - reboot ### Enable services ```.language-command systemctl enable NetworkManager systemctl start NetworkManager ```