@ -6,6 +6,7 @@ This guide is based upon a [german arch wiki entry](https://wiki.archlinux.de/ti
At the end of this guide a fully functional Arch Linux will be installed.
At the end of this guide a fully functional Arch Linux will be installed.
## 1. Preparation
## 1. Preparation
Ahead of the installation an Arch boot-stick has to be created. The iso-file can be found on the [official website](https://www.archlinux.org/download/).
Ahead of the installation an Arch boot-stick has to be created. The iso-file can be found on the [official website](https://www.archlinux.org/download/).
The iso can be written on an USB-stick using ```dd```.
The iso can be written on an USB-stick using ```dd```.
After that the USB can be plugged in the system on which Arch should be installed.
After that the USB can be plugged in the system on which Arch should be installed.
@ -15,16 +16,22 @@ If you need to set the keyboard layout to anything other than english you can te
This has to be followed by your country id (for example a german keyboard layout would be ```de```,```de-latin1``` or ```de-latin1-nodeadkeys```.
This has to be followed by your country id (for example a german keyboard layout would be ```de```,```de-latin1``` or ```de-latin1-nodeadkeys```.
## 2. Formatting of the target drive
## 2. Formatting of the target drive
Using ```lsblk``` you can list all the drives and partitions.
Using ```lsblk``` you can list all the drives and partitions.
Select a drive to install Arch on.
Select a drive to install Arch on.
In this step you can see if old partitions need to be deleted.
For reasons of simplicity the following guide will assume the selected drive to be ```/dev/sda```.
For reasons of simplicity the following guide will assume the selected drive to be ```/dev/sda```.
### Clear disk completely:
### Clear disk completely:
This step can take quite a while especially for large drives.
- `dd status=progress if=/dev/zero of=/dev/sda`
- `dd status=progress if=/dev/zero of=/dev/sda`
Now all partitions should be removed.
Now all partitions should be removed.
### Create new partitions:
### Create new partitions:
If you missclick during the progress of the following commands you can press ```CTRL+C``` to close the program.
If you missclick during the progress of the following commands you can press ```CTRL+C``` to close the program.
No changes will be made until the confirmation at the end.
No changes will be made until the confirmation at the end.
The swap partition will be created later under lvm.
The swap partition will be created later under lvm.
@ -45,6 +52,7 @@ The swap partition will be created later under lvm.
- `Y` - Confirm saving changes
- `Y` - Confirm saving changes
## 3. Encryption
## 3. Encryption
We need to find out which partitions is the one we want to encrypt.
We need to find out which partitions is the one we want to encrypt.
Using ```blkid | grep /dev/sda``` all partitions we created get listed.
Using ```blkid | grep /dev/sda``` all partitions we created get listed.
The right partition has the label ```Linux filesystem```.
The right partition has the label ```Linux filesystem```.
@ -58,6 +66,7 @@ The passphrase has to be entered at boot to decrypt the system.
Recovering of this passphrase is **not** possible.
Recovering of this passphrase is **not** possible.
## 4. Setup LVM
## 4. Setup LVM
- `cryptsetup luksOpen /dev/sda2 lvm` - Opening encrypted partition and mapping it to ```/dev/mapper/lvm```
- `cryptsetup luksOpen /dev/sda2 lvm` - Opening encrypted partition and mapping it to ```/dev/mapper/lvm```
- `pvcreate /dev/mapper/lvm` - Create a LVM physical volume
- `pvcreate /dev/mapper/lvm` - Create a LVM physical volume
- `vgcreate main /dev/mapper/lvm` - Create LVM Volume Group
- `vgcreate main /dev/mapper/lvm` - Create LVM Volume Group
@ -65,6 +74,7 @@ Recovering of this passphrase is **not** possible.
In this step the country specific mirrorserver for the installation will be configured.
In this step the country specific mirrorserver for the installation will be configured.
This will improve the download speed.
This will improve the download speed.
- `cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak` - Create a backup of mirrorlist
- `cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak` - Create a backup of mirrorlist
- `grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist` - Example command to only use *German* mirrors
- `grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist` - Example command to only use *German* mirrors
- `cat /etc/pacman.d/mirrorlist` - Check if the file is to your liking. If it is not, you can just recover by using ```mirrorlist.bak```
- `cat /etc/pacman.d/mirrorlist` - Check if the file is to your liking. If it is not, you can just recover by using ```mirrorlist.bak```
## 7. Starting base installation
## 7. Starting base installation
- `pacstrap /mnt base base-devel dosfstools gptfdisk lvm2 linux linux-firmware wpa_supplicant wireless_tools networkmanager vim` - Installation of main system with needed tools
- `pacstrap /mnt base base-devel dosfstools gptfdisk lvm2 linux linux-firmware networkmanager vim` - Installation of main system with needed tools
- `echo LANG=en_US.UTF-8 > /etc/locale.conf` - Assign system Language to be english (you can use other languages, look into the ```/etc/locale.conf``` for a list of all available languages)
- `echo LANG=en_US.UTF-8 > /etc/locale.conf` - Assign system Language to be english (you can use other languages, look into the ```/etc/locale.conf``` for a list of all available languages)
- `vim /etc/locale.gen` - Assigning system language
- `vim /etc/locale.gen` - Assigning system language by uncomment the lines depending on your needs.
- uncomment the lines depending on your needs.
In this example:
In this example:
```
```
en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
```
```
- `locale-gen` - Generate languages
- `locale-gen` - Generate languages
- if you need any other keymap than english you can change it now for example to German by `echo KEYMAP=de-latin1 > /etc/vconsole.conf`.
- if you need any other keymap than english you can change it now for example to German by `localectl --no-convert set-keymap de-latin1-nodeadkeys`.
If the system is installed in a virtual environment or a system with deactivated UEFI, don't forget to enable the EFI option, otherwise the system won't boot.
If the system is installed in a virtual environment or a system with deactivated UEFI, don't forget to enable the EFI option, otherwise the system won't boot.