Advertisement
incoggnito

Untitled

Oct 17th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.97 KB | None | 0 0
  1. # Arch Linux 5.3.1 Installation
  2. 11.Okt. 2019
  3.  
  4.  
  5. ## Pre Requirements
  6.  
  7. ### Download the ISO
  8.  
  9. Check the iso and the pgp fingerprint.
  10. ~~~bash
  11. md5sum archlinux-2019.10.01-x86_64.iso
  12. pacman-key -v archlinux-version-x86_64.iso.sig
  13. ~~~
  14.  
  15.  
  16. ### Create Live USB-Stick
  17. ~~~bash
  18. dd bs=4M if=~/dwn/archlinux-2019.10.01-x86_64.iso of=/dev/sdb status=progress oflag=sync
  19. ~~~
  20.  
  21.  
  22. start from uefi usb partition
  23. ~~~
  24. loadkeys de-latin1
  25. ~~~
  26.  
  27. ### Check inet conection
  28. ~~~bash
  29. ip link
  30. dhcpcd enpXXXXXX
  31. ping -c3 archlinux.org
  32. ~~~
  33.  
  34. ### Prepare ssh from antoher machine
  35. ~~~bash
  36. passwd
  37. ip addr show
  38. systemctl start sshd.service
  39. ~~~
  40.  
  41. ### Login to remote machine
  42. ~~~bash
  43. ssh-keygen -R ipadress
  44. ssh root@ipadress
  45. ~~~
  46.  
  47. ## Create Filesystem
  48. ### Partition the table
  49. create new gpt on nvme
  50. ~~~bash
  51. gdisk /dev/nvme0n1
  52. ~~~
  53.  
  54. commands
  55. ~~~bash
  56. n > enter > enter > +512M > ef00
  57. n > enter > enter > enter > 8e00
  58. w
  59. ~~~
  60.  
  61. ### crypt setup
  62. ~~~bash
  63. blkdiscard /dev/nvme0n1p2
  64. modprobe dm-crypt
  65. cryptsetup -c aes-xts-plain64 -y -s 512 luksFormat /dev/nvme0n1p2
  66. cryptsetup luksOpen /dev/sda2 lvm --allow-discards
  67. ~~~
  68.  
  69. ### logical volume
  70. ~~~bash
  71. pvcreate /dev/mapper/lvm
  72. vgcreate main /dev/mapper/lvm
  73. lvcreate -L 30GB -n root main
  74. lvcreate -l 100%FREE -n home main
  75. ~~~
  76.  
  77. ### formating partitions
  78. ~~~bash
  79. mkfs.fat -F 32 -n EFIBOOT /dev/nvme0n1p1
  80. mkfs.ext4 -L p_arch /dev/main/root
  81. mkfs.ext4 -L p_arch /dev/main/home
  82. ~~~
  83.  
  84. ### mount partitions
  85. ~~~bash
  86. mount -L p_arch /mnt
  87. mkdir -p /mnt/boot
  88. mount -L EFIBOOT /mnt/boot
  89. mkdir /mnt/home
  90. mount /dev/mapper/main-home  /hom
  91. mount /dev/mapper/main-root /
  92. ~~~
  93.  
  94. ## install base system
  95. ~~~bash
  96. cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
  97. nano /etc/pacman.d/mirrorlist
  98. grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist
  99. pacstrap /mnt base base-devel linux intel-ucode bash-completion neovim
  100. ~~~
  101.  
  102. ### fstab erzeugen
  103. overwrite fstab settings
  104. ~~~bash
  105. genfstab -p /mnt > /mnt/etc/fstab
  106. ~~~
  107.  
  108. ### system settings
  109. ~~~bash
  110. arch-chroot /mnt/
  111. echo myhost > /etc/hostname
  112. echo LANG=de_DE.UTF-8 > /etc/locale.conf
  113. nvim /etc/locale.gen
  114. locale-gen
  115. echo KEYMAP=de-latin1 > /etc/vconsole.conf
  116. echo FONT=lat9w-16 >> /etc/vconsole.conf
  117. ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
  118. ~~~
  119.  
  120. ### Initramfs
  121. change in /etc/mkinitcpio.conf
  122. HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsck shutdown)
  123. ~~~bash
  124. mkinitcpio -p linux
  125. ~~~
  126.  
  127. ### Bootloader GRUB
  128. ~~~bash
  129. pacman -S efibootmgr dosfstools gptfdisk
  130. grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck --debug
  131. mkdir -p /boot/grub/locale
  132. cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
  133. nvim /etc/default/grub
  134. ~~~
  135. GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:main root=/dev/mapper/main-root"
  136.  
  137. ~~~bash
  138. grub-mkconfig -o /boot/grub/grub.grub.cfg
  139. exit
  140. umount -R /mnt
  141. reboot
  142. ~~~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement