Advertisement
msjche

Install Arch Linux with UEFI, LVM, LUKS and systemd-boot

Oct 7th, 2017
3,442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. ### MoJo's Arch Installation with UEFI, LUKS and LVM using systemd-boot ###
  2.  
  3. ### Check EFI Boot ###
  4.  
  5. ls /sys/firmware/efi
  6.  
  7. pacman -Sy terminus-font vim
  8.  
  9. pacman -Sl terminus-font #check which sizes available
  10.  
  11. setfont ter-v32b
  12.  
  13. ### Disk Preparation ###
  14.  
  15. lsblk
  16.  
  17. cgdisk
  18. partition 1: 512M (ef00) - EFI System
  19. partition 2: rest (8e00) - Linux LVM
  20. exit
  21.  
  22. mkfs.fat -F32 /dev/sda1
  23.  
  24. ### Encryption Setup ###
  25.  
  26. cryptsetup luksFormat /dev/sda2
  27. YES
  28. Passphrase
  29.  
  30. cryptsetup open --type luks /dev/sda2 archlv
  31. Passphrase
  32.  
  33. ls /dev/mapper/archlv
  34.  
  35. pvcreate /dev/mapper/archlv
  36. vgcreate archvg /dev/mapper/archlv
  37.  
  38. lvcreate -L2G archvg -n swap
  39. lvcreate -L10G archvg -n root
  40. lvcreate -l 100%FREE archvg -n home
  41.  
  42. mkfs.ext4 /dev/mapper/archvg-root
  43. mkfs.ext4 /dev/mapper/archvg-home
  44. mkswap /dev/mapper/archvg-swap
  45.  
  46. mount /dev/mapper/archvg-root /mnt
  47. mkdir /mnt/home
  48. mount /dev/mapper/archvg-home /mnt/home
  49. mkdir /mnt/boot
  50. mount /dev/sda1 /mnt/boot
  51. swapon /dev/mapper/archvg-swap
  52.  
  53. ## Insert encrpyted external mounting options here:
  54.  
  55. XXXX
  56.  
  57. ### Install Base System ###
  58.  
  59. pacman -S reflector
  60.  
  61. reflector -c "United States" -f 12 -l 12 --verbose --save /etc/pacman.d/mirrorlist
  62.  
  63. pacstrap /mnt base base-devel sudo vim
  64.  
  65. ls /mnt
  66.  
  67. genfstab -p /mnt >> /mnt/etc/fstab
  68.  
  69. arch-chroot /mnt
  70.  
  71. ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
  72.  
  73. hwclock --systohc --utc
  74.  
  75. passwd
  76.  
  77. vim /etc/locale.gen
  78.  
  79. locale-gen
  80.  
  81. locale > /etc/locale.conf
  82.  
  83. vim /etc/hostname
  84. 4n4rch14
  85.  
  86. vim /etc/mkinitcpio.conf
  87. HOOKS="......keyboard encrypt lvm2 filesystems..."
  88.  
  89. mkinitcpio -p linux
  90.  
  91. ### Configure Bootloader ###
  92.  
  93. bootctl --path=/boot/ install
  94.  
  95. vim /boot/loader/loader.conf
  96. clear
  97. default arch
  98. timeout 5
  99. editor 0 ## prevents bootloader commands
  100.  
  101. vim /boot/loader/entries/arch.conf
  102. title Arch Linux ENCRYPTED
  103. linux /vmlinuz-linux
  104. initrd /initramfs-linux.img
  105. options cryptdevice=UUID=XXXXXXXXXXX:archlv root=/dev/mapper/archvg-root quiet rw
  106. vim magic: :read ! blkid /dev/sd2
  107. enter UUID above
  108.  
  109. exit
  110. umount -R /mnt
  111. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement