installation updated

master
TiynGER 5 years ago
parent c40406e070
commit 96118b9e35

@ -8,19 +8,19 @@ 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.
Boot the target system and select ```Boot Arch Linux (x86_64)```. Boot the target system and select `Boot Arch Linux (x86_64)`.
If you need to set the keyboard layout to anything other than english you can temporarily do so by using the ```loadkeys``` command. If you need to set the keyboard layout to anything other than english you can temporarily do so by using the `loadkeys` command.
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. 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:
@ -32,7 +32,7 @@ Now all partitions should be removed.
### Create new partitions: ### Create new partitions:
If you miss click during the progress of the following commands you can press ```CTRL+C``` to close the program. If you miss click 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.
@ -54,20 +54,20 @@ The swap partition will be created later under lvm.
## 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`.
For this guide this partition is assumed to be ```/dev/sda2```. For this guide this partition is assumed to be `/dev/sda2`.
- `modprobe dm-crypt` - load kernelmodule for encryption - `modprobe dm-crypt` - load kernelmodule for encryption
- `cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2` - encryption - `cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2` - encryption
- confirm with ```YES``` - confirm with `YES`
- Now you can assign a passphrase. - Now you can assign a passphrase.
The passphrase has to be entered at boot to decrypt the system. 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
- `lvcreate -L 16G -n swap main` - Create Swap in LVM (recommended: swap size is equal to ram size) - `lvcreate -L 16G -n swap main` - Create Swap in LVM (recommended: swap size is equal to ram size)
@ -76,12 +76,12 @@ Recovering of this passphrase is **not** possible.
## 5. Create filesystems and mounting them temporarily ## 5. Create filesystems and mounting them temporarily
We have to find out which partition is our boot-partition. We have to find out which partition is our boot-partition.
Using ```blkid | grep /dev/sda``` once again, we can identify it by looking for the ```EFI system partition``` label. Using `blkid | grep /dev/sda` once again, we can identify it by looking for the `EFI system partition` label.
The guide assumes this partition to be at ```/dev/sda1```. The guide assumes this partition to be at `/dev/sda1`.
- ```mkfs.fat -F 32 -n UEFI /dev/sda1``` - Assign filesystem of EFI partition - `mkfs.fat -F 32 -n UEFI /dev/sda1` - Assign filesystem of EFI partition
- ```mkfs.ext4 -L root /dev/mapper/main-root``` - Assign filesystem of root partition - `mkfs.ext4 -L root /dev/mapper/main-root` - Assign filesystem of root partition
- ```mkswap /dev/mapper/main-swap``` - Assign swap filesystem - `mkswap /dev/mapper/main-swap` - Assign swap filesystem
Now the created filesystems will be mounted for the installation. Now the created filesystems will be mounted for the installation.
@ -97,27 +97,28 @@ 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 networkmanager vim` - Installation of main system with needed tools Now you need a working internet connection.
- `pacstrap /mnt wpa\_supplicant wireless\_tools` - (optional) installation of wireless tools Plug in your lan cable or use `wifi-menu` to get a wireless connection.
- `pacstrap /mnt base base-devel dosfstools gptfdisk lvm2 linux linux-firmware vim dialog dhcpcd` - Installation of main system with needed tools
- `genfstab -Up /mnt > /mnt/etc/fstab` - creation of fstab - `genfstab -Up /mnt > /mnt/etc/fstab` - creation of fstab
- `arch-chroot /mnt` - Switch into the newly installed system - `arch-chroot /mnt` - Switch into the newly installed system
- `echo ArchLinux > /etc/hostname` - Assign hostname. ```ArchLinux``` can be changed for any name of your preference. - `echo ArchLinux > /etc/hostname` - Assign hostname. `ArchLinux` can be changed for any name of your preference.
## 8. Set Region and Language ## 8. Set Region and Language
- `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.gen` for a list of all available languages)
- `vim /etc/locale.gen` - Assigning system language by uncomment the lines depending on your needs. - `vim /etc/locale.gen` - Assigning system language by 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 `localectl --no-convert set-keymap de-latin1-nodeadkeys`. - `echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf` - set the keymap
- `localectl status` - Check if the layout is right
- `tzselect` - Set region - `tzselect` - Set region
# 9. Configure and create kernel-image # 9. Configure and create kernel-image
@ -140,25 +141,18 @@ en_US.UTF-8 UTF-8
title Arch Linux title Arch Linux
linux /vmlinuz-linux linux /vmlinuz-linux
initrd /initramfs-linux.img initrd /initramfs-linux.img
options cryptdevice=UUID=<enter your uuid here>:lvm:allow-discards root=/dev/mapper/main-root:lvm:allow-discards resume=/dev/mapper/main-swap rw quiet lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8 options cryptdevice=UUID=<enter your uuid here>:lvm:allow-discards root=/dev/mapper/main-root resume=/dev/mapper/main-swap rw quiet
```
- `cp /boot/loader/entries/arch-fallback.conf` - Create a fallback
- `vim /boot/loader/entries/arch-fallback.conf` - Edit the file
- change the file to look similar to this:
```
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=<enter your uuid here>:lvm:allow-discards root=/dev/mapper/main-root:lvm:allow-discards resume=/dev/mapper/main-swap rw quiet lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8
``` ```
- `cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf` - Create a fallback
- `vim /boot/loader/loader.conf` - Create loader configuration - `vim /boot/loader/loader.conf` - Create loader configuration
- Insert the following text - Insert the following text
``` ```
timeout 1 timeout 0
default arch default arch
``` ```
## 11. Finishing base installation ## 11. Finishing base installation
- `passwd` - set password for the root account
- `exit` - exit the installed system - `exit` - exit the installed system
- `umount /mnt/{boot,}` - unmount all partitions - `umount /mnt/{boot,}` - unmount all partitions
- `shutdown now` - shutdown device - `shutdown now` - shutdown device
@ -166,57 +160,11 @@ en_US.UTF-8 UTF-8
- Start the device again - Start the device again
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.
Now you can follow my larbs installation script (`curl -o larbs.sh https://raw.githubusercontent.com/tiyn/larbs/master/larbs.sh` or go on to other guides.
## 12. Activate network connection
- Log in as ```root``` user
- `systemctl enable NetworkManager.service` - Activate NetworkManager
- `systemctl enable wpa\_supplicant.service` - (Optional) activate wpa_supplicant
- `systemctl start NetworkManager.service` - Start NetworkManager
The device should connect to the internet if it is connected via LAN.
Using ```nmtui``` you can administer the wired and wireless connections
## 13. Automatic time settings
- `pacman -Syu ntp` - Installing time service
- `ntpd -qg` - Get current time
- `hwclock --systohc` - Synchronize hardware clock
- `systemctl enable ntpd.service` - enable time service
## 14. Create user
- `vim /etc/sudoers` - Open sudoers file
- uncomment the following lines
```
%whell All=(ALL) ALL
```
- `useradd -m user` - Create a user with ```user``` as name. For the user a home directory will be created.
- `usermod -aG wheel user` - Add user ```user``` to wheel group
- `passwd -d user` - Remove password for user ```user```
- `logout` - logout from root
- log in as the newly created user
On the freshly installed system there are 2 users.
Make sure to set the password!
You can add one using ```passwd```.
## 15. Install yay
- `sudo pacman -S git` - install git
- `cd /opt`
- `sudo git clone https://aur.archlinux.org/yay-git.git` - Clone the yay git repository
- `sudo chown -R user:user yay-git` - Change owner
- `cd yay-git`
- `makepkg -si` - Start installation
## 16. Activate sound
- `yay -S alsa-utils pulseaudio-alsa`
The volume can be changed with `alsamixer`.
## Changelog and versions ## Changelog and versions
> 03.04.2020 - Version 1.1en (based on 03.04.2020 - Version 1.1) > 03.04.2020 - Version 1.1en (based on 03.04.2020 - Version 1.1)
> >
> 05.04.2020 - Version 2.1en (based on 05.04.2020 - Version 2.1) > 05.04.2020 - Version 2.1en (based on 05.04.2020 - Version 2.1)
>
> 28.05.2020 - Version 3.0en

Loading…
Cancel
Save