Based on:
...
- In my option
/dev/sdais the system disk and/dev/sdbthe USB-drive. - I used 'Rufus' to write an image
-
Change keyboard layout (optional), in my case it's German.
# localectl list-keymaps # loadkeys <keymap> (e.g for German: `de-latin1` or `de`) -
Connect to internet:
-
For LAN:
# systemctl start dhcpcd.service -
For WLAN:
# wifi-menu
-
A drive should first be partitioned and afterwards the partitions should be formatted with a file system. Use fdisk to create MBR partitions.
# fdisk /dev/sda -
First, create an empty MBR partition table. (WARNING: This will erase entire disk)
# (fdisk) o -
I'm going to create 2 main partitions. (
/dev/sda1&/dev/sda2)Device Boot Start End Sectors Size Id Type /dev/sda1 2048 526335 524288 256M 83 Linux /boot /dev/sda2 526336 765986815 765460480 365G 83 Linux Encrypted with LUKS, 3 LVM partitions: swap vg0 -wi-ao---- 8.00g swap root vg0 -wi-ao---- 80.00g / home vg0 -wi-ao---- XXX.XXg -
Create Partitions:
# (fdisk) n # (fdisk) p # (fdisk) 1 # (fdisk) <Enter> # (fdisk) +256M # (fdisk) t # (fdisk) <Enter> # (fdisk) 83 # (fdisk) n # (fdisk) p # (fdisk) 2 # (fdisk) <Enter> # (fdisk) <Enter> # (fdisk) t # (fdisk) <Enter> # (fdisk) 83 # (fdisk) w -
Format
boot- Partition: (/dev/sda1)# mkfs.ext2 /dev/sda1 -
Setup Encryption:
# cryptsetup -c aes-xts-plain64 -y --use-random luksFormat /dev/sda2 # cryptsetup luksOpen /dev/sda2 luks -
Create LVM Partitions:
# pvcreate /dev/mapper/luks # vgcreate vg0 /dev/mapper/luks # lvcreate --size 8G vg0 --name swap # lvcreate --size 80G vg0 --name root # lvcreate -l +100%FREE vg0 --name home -
Format LVM partitions:
# mkfs.ext4 /dev/mapper/vg0-root # mkfs.ext4 /dev/mapper/vg0-home # mkswap /dev/mapper/vg0-swap -
Mount the new system:
# mount /dev/mapper/vg0-root /mnt # mkdir /mnt/boot # mount /dev/sda1 /mnt/boot # swapon /dev/mapper/vg0-swap
-
Install the base system w/ important components:
# pacstrap -i /mnt base base-devel git vim lvm2 linux linux-firmware -
Generate
/etc/fstab. This file can be used to define how disk partitions, various other block devices, or remote filesystems should be mounted into the filesystem.# genfstab -pU /mnt >> /mnt/etc/fstab
-
Enter the new system:
# arch-chroot /mnt /bin/bash -
Set TimeZone:
-
See available timezones w/
# ls /usr/share/zoneinfo/ -
Set timezone: (e.g. for Germany)
# ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
-
Set Locale: (can be different if you use another layout)
# vim /etc/locale.gen (uncomment en_US.UTF-8 UTF-8) # locale-gen # echo LANG=en_US.UTF-8 > /etc/locale.conf # export LANG=en_US.UTF-8 -
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.
# hwclock --systohc --utc -
Set hostname:
# echo <myhostname> >/etc/hostname -
Add following to
/etc/hosts:127.0.1.1 myhostname.localdomain myhostname -
Create User:
# adduser <username> # usermod -aG wheel <username> # passwd <username> # vim /etc/sudoers
-
Uncomment following:
%wheel ALL=(ALL) ALL
-
Set root password:
# passwd root -
Download/Configure mkinitcpio with modules needed for the initrd image:
# pacman –S mkinitcpio # vim /etc/mkinitcpio.conf
-
Add
ext4toMODULES -
Add
encryptandlvm2toHOOKSbeforefilesystems# mkinitcpio -p linux
-
Setup grub:
# pacman -S grub # grub-install --target=i386-pc --recheck /dev/sda
-
In
/etc/default/grubedit the lineGRUB_CMDLINE_LINUXto:GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:luks:allow-discards" -
[Tip] To automatically search for other operating systems on your computer, install
os-prober(pacman -S os-prober) before running the next command.# grub-mkconfig -o /boot/grub/grub.cfg
-
WARNING! Before you unmount & reboot, it’s highly recommended to install followings to have Internet-Connection:
-
For
wifi-menu:# sudo pacman –S netctl dialog wpa_supplicant -
For LAN:
# sudo pacman –S dhcpcd
-
Exit new system and unmount all partitions:
# exit # umount -R /mnt # swapoff –a -
Reboot into the new system: (Don't forget to remove the CD/USB.)
# reboot -
Start network & check internet connection:
# systemctl enable dhcpcd.service # systemctl start dhcpcd.service # ping google.com
-
WARNING! There could be an error like below, after connecting w/ wifi-menu to your Network, e.g. Job for netctl@wlp0s19f2u2\networkname.service failed because the control process exited with error code. See “systemctl status “netctl@wlp0s19f2u2\networkname.service”” and “journal –xe” for details.
-
So what I did was:
# systemctl stop dhcpcd.service # ip link set down wlp0s19f2u2 -
Then:
# systemctl start netctl@wlp0s19f2u2\networkname.service -
or
# wifi-menu
- Now you need GUI (I hope), for KDE Plasma:
-
Install
xorg&sddm:# pacman -S xorg xorg-server xorg-xinit sddm xterm -
Install graphics driver:
-
Use
lscpi | grep VGAto detect your VGA Controller and install your one or install 'em all:# pacman –S xf86-video-intel xf86-video-amdgpu xf86-video-ati -
Now install KDE & Enable Display Manager (
sddm):# pacman –S plasma kde-applications # systemctl enable sddm
-
Now reboot:
# reboot