Skip to content

Instantly share code, notes, and snippets.

@jbothma
Last active February 23, 2020 16:58
Show Gist options
  • Select an option

  • Save jbothma/6e947f27c378d7df19fcf1d6f1a09eda to your computer and use it in GitHub Desktop.

Select an option

Save jbothma/6e947f27c378d7df19fcf1d6f1a09eda to your computer and use it in GitHub Desktop.
Arch installation

Running on intallation media

Disable Secure Boot

Connect to WiFi

Run wpa_cli with -i wlan0 to make scan work - default p2p-... interface is not what we want.

Partition the disks

robin

 $ sudo fdisk -l /dev/sda
[sudo] password for jdb: 
Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Micron_M600_MTFD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8FEB60C3-EBBA-48A2-8F9B-6A1ACAF41BB9

Device       Start       End   Sectors  Size Type
/dev/sda1     2048   1050623   1048576  512M EFI System
/dev/sda2  1050624 500118158 499067535  238G Linux LVM
 $ lsblk
NAME                 MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                    8:0    0 238.5G  0 disk  
├─sda1                 8:1    0   512M  0 part  /boot
└─sda2                 8:2    0   238G  0 part  
  └─MyStorage        254:0    0   238G  0 crypt 
    ├─MyStorage-swap 254:1    0     8G  0 lvm   [SWAP]
    ├─MyStorage-root 254:2    0  25.2G  0 lvm   /
    └─MyStorage-home 254:3    0 204.8G  0 lvm   /home

start fdisk

fdisk /dev/sda

create new GPT partition table

g

create new EFI System partition

n  # New partition
1  # Partition number 1
Enter  # start at default sector 2048
+512M  # make it end after 512MB of sectors

create new Linux LVM partition

n
2
Enter  # start at default first sector after partition 1
Enter  # end at the end of the disk

Set the partition types

t
1  # change type for partition 1
1  # set it to EFI System
t
2
30  # set it to Linux LVM

Set up encryption and LVM (LVM on Luks)

cryptsetup luksFormat /dev/sda2
cryptsetup open /dev/sda2 cryptlvm
pvcreate /dev/mapper/cryptlvm
vgcreate MyVolGroup /dev/mapper/cryptlvm
lvcreate -L 8G MyVolGroup -n swap
lvcreate -L 32G MyVolGroup -n root
lvcreate -l 100%FREE MyVolGroup -n home
mkfs.ext4 /dev/MyVolGroup/root
mkfs.ext4 /dev/MyVolGroup/home
mkswap /dev/MyVolGroup/swap
mount /dev/MyVolGroup/root /mnt
mkdir /mnt/home
mount /dev/MyVolGroup/home /mnt/home
swapon /dev/MyVolGroup/swap
mkfs.fat -F32 /dev/sdb1

Initramfs

pacman -S lvm2
mkinitcpio -P

Users

adduser -m jdb -G wheel
pacman -S sudo vim
visudo

Boot loader

bootctl --path=/boot update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment