Guest User

Untitled

a guest
Sep 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. timedatectl set-ntp true
  2. parted -s /dev/sda mklabel msdos
  3. parted -s /dev/sda mkpart primary 2048s 100%
  4.  
  5. cryptsetup luksFormat /dev/sda1
  6. cryptsetup luksOpen /dev/sda1 lvm
  7. pvcreate /dev/mapper/lvm
  8. vgcreate arch /dev/mapper/lvm
  9. lvcreate -L 8G arch -n swap
  10. lvcreate -L 30G arch -n root
  11. lvcreate -l +100%FREE arch -n home
  12. lvdisplay
  13. mkswap -L swap /dev/mapper/arch-swap
  14. mkfs.ext4 /dev/mapper/arch-root
  15. mkfs.ext4 /dev/mapper/arch-home
  16. mount /dev/mapper/arch-root /mnt
  17. mkdir /mnt/home
  18. mount /dev/mapper/arch-home /mnt/home
  19. swapon /dev/mapper/arch-swap
  20.  
  21. pacstrap -i /mnt base base-devel net-tools wireless_tools dialog wpa_supplicant git grub ansible
  22.  
  23. genfstab -U -p /mnt >> /mnt/etc/fstab
  24. # less /mnt/etc/fstab
  25.  
  26. arch-chroot /mnt /bin/bash
  27. export LANG=en_US.UTF-8
  28. echo $LANG UTF-8 >> /etc/locale.gen
  29. locale-gen
  30. echo LANG=$LANG > /etc/locale.conf
  31. ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
  32. hwclock --systohc --utc
  33. echo cibo > /etc/hostname
  34. systemctl enable dhcpcd.service
  35. passwd
  36.  
  37.  
  38.  
  39. sed -i 's/^HOOKS=.*/HOOKS="base udev autodetect modconf block keyboard encrypt lvm2 resume filesystems fsck"/' /etc/mkinitcpio.conf
  40. mkinitcpio -p linux
  41.  
  42. dd bs=512 count=8 if=/dev/urandom of=/crypto_keyfile.bin
  43. cryptsetup luksAddKey /dev/sda1 /crypto_keyfile.bin
  44. chmod 000 /crypto_keyfile.bin
  45. sed -i 's/^FILES=.*/FILES="\/crypto_keyfile.bin"/' /etc/mkinitcpio.conf
  46. mkinitcpio -p linux
  47.  
  48.  
  49. echo GRUB_ENABLE_CRYPTODISK=y >> /etc/default/grub
  50.  
  51. # BIOS mode - set the UUID of the encrypted root device
  52. ROOTUUID=$(blkid /dev/sda1 | awk '{print $2}' | cut -d '"' -f2)
  53. sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"cryptdevice=UUID="$ROOTUUID":lvm:allow-discards resume=\/dev\/mapper\/arch-swap\"/" /etc/default/grub
  54. grub-mkconfig -o /boot/grub/grub.cfg
  55. grub-install /dev/sda
  56. chmod -R g-rwx,o-rwx /boot
  57.  
  58. exit
  59. umount -R /mnt
  60. echo "You may now reboot."
Add Comment
Please, Sign In to add comment