-
-
Save nsyntych/1f8ac76ea87543a6b15d4f8e9feca99c to your computer and use it in GitHub Desktop.
Archlinux install notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # load kernel modules | |
| modprobe dm-crypt | |
| modprobe dm-mod | |
| # connect to the internet and set date | |
| wifi-menu | |
| timedatectl set-ntp true | |
| # verify boot by systemd-boot | |
| # ls /sys/firmware/efi/efivars | |
| # dev/sda2 is apparently in use by the system; will not make a filesystem here! | |
| # https://superuser.com/questions/668347/installing-arch-linux-unable-to-format-filesystem#comment844950_668347 | |
| # dmsetup ls | |
| # dmsetup remove VolumeGroup-swap | |
| # dmsetup remove VolumeGroup-root | |
| # dmsetup remove VolumeGroup-home | |
| # or also: | |
| # cgdisk /dev/nvme0n1 | |
| # $ lsblk | |
| # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | |
| # sda 8:0 0 1.8T 0 disk | |
| # └─sda1 252:0 0 1.8T 0 crypt | |
| # hardisk erasure | |
| # cryptsetup open --type plain -d /dev/urandom /dev/sda sda1 | |
| # dd if=/dev/zero of=/dev/mapper/sda1 status=progress | |
| # cryptsetup close sda1 | |
| cfdisk /dev/sda | |
| # $ lsblk -f || fdisk -l | |
| #Number Start (sector) End (sector) Size Code Name | |
| # 1 2048 1050623 512.0 MiB EF00 EFI System | |
| # 2 5244928 976773133 463.3 GiB 8E00 Linux LVM | |
| mkfs.fat -F32 /dev/sda1 | |
| # LVM on LUKS filesystem: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS | |
| # encrypted container | |
| cryptsetup luksFormat --type luks2 -c aes-xts-plain64 -s 512 /dev/sda2 | |
| # open container | |
| cryptsetup open /dev/sda2 cryptlvm | |
| # preparing the locical volumes | |
| pvcreate /dev/mapper/cryptlvm # create physical volume | |
| vgcreate t460pVolGroup /dev/mapper/cryptlvm | |
| lvcreate -L 35G t460pVolGroup -n swap | |
| lvcreate -L 60G t460pVolGropu -n root | |
| lvcreate -l 100%FREE t460pVolGroup -n home | |
| mkfs.ext4 /dev/mapper/t460pVolGroup-root | |
| mkfs.ext4 /dev/mapper/t460pVolGroup-home | |
| mkswap /dev/mapper/t460pVolGroup-swap | |
| # mount points: | |
| mkdir /mnt/boot | |
| mkdir /mnt/home | |
| mount /dev/mapper/t460pVolGroup-root /mnt | |
| mount /dev/sda1 /mnt/boot/ | |
| mount /dev/MyVolGroup/home /mnt/home | |
| # activate swap | |
| swapon /dev/mapper/t460pVolGroup-swap | |
| pacstrap /mnt base base-devel efibootmgr grub-efi-x86_64 mkinitcpio grub vim linux lvm2 networkmanager | |
| genfstab -pU /mnt >> /mnt/etc/fstab | |
| arch-chroot /mnt | |
| vi /etc/mkinitcpio.conf | |
| # update /etc/mkinitcpio.conf hooks: | |
| # HOOKS=(base udev systemd autodetect keyboard sd-vconsole consolefont modconf block sd-encrypt sd-lvm2 resume filesystems fsck shutdown) | |
| mkinitcpio -p linux | |
| pacman -S grub | |
| # update /etc/default/grub kernel parameter for bootloader: | |
| # lsblk -f | grep '/dev/sda3' >> /etc/default/grub | |
| # GRUB_CMDLINE_LINUX="... rd.luks.name=UUID=<device-UUID>=cryptlvm root=/dev/mapper/t460pVolGroup-root resume=/dev/mapper/t460pVolGroup-swap" ... | |
| # GRUB_ENABLE_CRYPTODISK=y | |
| grub-install --target=x86_64-efi --efi-directory=/boot | |
| grub-mkconfig -o /boot/grub/grub.cfg | |
| echo "KEYMAP=us" > /etc/vconsole.conf | |
| ln -sf /usr/share/zoneinfo/Greenwich /etc/localtime | |
| hwclock --systohc | |
| echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen | |
| locale-gen | |
| echo "LANG=\"en_US.UTF-8\"" > /etc/locale.conf | |
| echo "t460p" > /etc/hostname | |
| # update /etc/hosts: | |
| ## https://github.com/StevenBlack/hosts | |
| # 127.0.0.1 localhost | |
| # ::1 localhost | |
| # 127.0.1.1 t460p.localdomain t460p | |
| # set root password | |
| passwd | |
| exit | |
| umount -R /mnt | |
| swapoff -a | |
| reboot | |
| # add user | |
| useradd -m -g users -G wheel rblanco | |
| passwd rblanco | |
| ip link set dev enp0s31f6 up | |
| dhcpcd enp0s31f6 | |
| # don't suspend if docked (plugged) & locked | |
| # update /etc/systemd/logind.conf: | |
| # [Login] | |
| # HandleLidSwitchExternalPower=ignore | |
| # HandleLidSwitchDocked=ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment