Advertisement
Guest User

archinstall.txt

a guest
Sep 9th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.70 KB | None | 0 0
  1. #wipe disk
  2. dd if=/dev/urandom of=/dev/sda bs=4k 'status=progress'
  3. #gdisk for gpt UEFI or fdisk for regular bios
  4. #if you're going to use an older BIOS machine, just use mbr/dos, but you still need to make a /boot partition
  5. #if you're going to use an older BIOS machine but you still want to use GPT because you have a really big disk you need to run
  6. #parted /dev/disk set partition-number bios_grub on
  7. #after you make all your partitions. The partition number corresponds to the /boot partition number in fdisk
  8. #make gpt partition table
  9. fdisk -> g -> w
  10. #make efi partition
  11. fdisk -> n -> 300mb efi partition
  12. #change from linux filesystem to type EFI
  13. fdisk -> t -> 1
  14. #make boot partition
  15. fdisk -> n -> 400mb boot partition
  16. #make lvm partition
  17. fdisk -> n -> full size
  18. #change to type lvm
  19. fdisk -> t -> 31
  20. # write to filesystem with w
  21. #format EFI partition
  22. mkfs.fat -F32 /dev/sda1
  23. #format boot partition
  24. mkfs.ext2 /dev/sda2
  25. #setup sda3 for encryption
  26. cryptsetup -v -y -c aes-xts-plain64 -s 512 -h sha512 -i 2000 --use-urandom luksFormat /dev/sda3
  27. #if distro has sane defaults, CHECK BEFORE RUNNING SERIOUSLY
  28. cryptsetup luksFormat /dev/sda3
  29. #open the now encrypted partition
  30. cryptsetup open /dev/sda3 cryptdisk
  31. #it's now open in /dev/mapper
  32. #setting up LVM - first setup physical volume
  33. #data aligment is apperently better for SSDs
  34. pvcreate --dataalignment 1m /dev/mapper/cryptdisk
  35. #make volume group inside the new physical group
  36. vgcreate vg0 /dev/mapper/cryptdisk
  37. #make logical volumes inside the volume group
  38. #make a root partition with 40 gigs of space
  39. lvcreate -L 40GB vg0 -n root
  40. #make a home partition with the rest of the space on the disk, do this last after all the other logical volumes you want to make
  41. lvcreate -l 100%FREE vg0 -n home
  42. #activate the lvm
  43. modprobe dm_mod
  44. vgscan
  45. vgchange -ay
  46. #format the logical volumes
  47. mkfs.ext4 /dev/vg0/root
  48. mkfs.ext4 /dev/vg0/home
  49. #mount everything. make directories if they don't already exist
  50. mount /dev/vg0/root /mnt
  51. mount /dev/vg0/home /mnt/home
  52. mount /dev/sda2 /mnt/boot
  53. mount /dev/sda1 /mnt/boot/EFI
  54. #connect to the internet with wifi-menu
  55. #sort your mirrors with reflector
  56. pacman -Sy
  57. pacman -S reflector
  58. reflector --sort rate --protocol https --number 100 --fastest 50 --save /etc/pacman.d/mirrorlist
  59. #install the base distro with pacstrap, use linux-lts for the "stable" kernel
  60. pacstrap /mnt base base-devel vim linux-lts linux-lts-headers
  61. #generate your fstab, -U is for UUID
  62. genfstab -U /mnt >> /mnt/etc/fstab
  63. #chroot into your install
  64. arch-chroot /mnt
  65. #install bootloader packages etc. ignore efibootmgr for BIOS install
  66. pacman -S intel-ucode grub efibootmgr dosfstools openssh os-prober mtools wpa_supplicant dialog
  67. #set your timezone
  68. ln -sf /usr/share/zoneinfo/Africa/Cairo /etc/localtime
  69. hwclock --systohc --utc
  70. #enbale ntp
  71. timedatectl set-ntp true
  72. #set hostname
  73. echo cirno > /etc/hostname
  74. #configure your locale, either uncomment your locales in /etc/locale.gen or echo it with the below commands
  75. echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
  76. echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen
  77. locale-gen
  78. echo LANG=en_US.UTF-8 >> /etc/locale.conf
  79. #set a root password
  80. passwd
  81. #setup init hooks
  82. vim /etc/mkinitcpio.conf
  83. #edit the HOOKS line
  84. HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)
  85. #generate the init script, linux for the regular kernel, linux-lts for the lts one
  86. mkinitcpio -p linux-lts
  87. #edit the grub config
  88. vim /etc/default/grub
  89. #add this before quiet on the GRUB_CMDLINE_LINUX_DEFAULT line, leave a space between it and quiet
  90. GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda3:vg0 quiet"
  91. #obviously change /dev/sda3 to whatever device has the physical group of your root logical volume, and chage vg0 to the corresponding volume group
  92. #install grub in efi mode
  93. grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
  94. #or install grub in bios mode
  95. grub-install --target=i386-pc --recheck /dev/sda
  96. #generate the grub config file
  97. grub-mkconfig -o /boot/grub/grub.cfg
  98. #Base system is now installed unmount and exit/reboot, below are some userspace things to do
  99. #setup sudo
  100. pacman -S sudo
  101. #uncomment the wheel group so any user in wheel can use sudo
  102. visudo
  103. #neworking
  104. #on a wired network just run dhcpcd, use something like ip addr to find device names
  105. ip link set dev enp3s0 up
  106. systemctl start dhcpcd
  107. #for wifi use wpa_supplicant until you install a gui client, this is a pain in the ass
  108. vim /etc/wpa_supplicant/wpa_supplicant.conf
  109. #add
  110. ctrl_interface=/run/wpa_supplicant
  111. update_config=1
  112. #start wpa_supplicant
  113. wpa_supplicant -B -i interface -c /etc/wpa_supplicant/wpa_supplicant.conf
  114. #start the interface
  115. wpa_cli
  116. #find the networks around you
  117. scan
  118. scan_results
  119. #add a network
  120. add_network
  121. 0
  122. set_network 0 ssid "MYSSID"
  123. set_network 0 psk "PASSWORD"
  124. #if it's an open network use
  125. set_network 0 key_mgmt NONE
  126. save_config
  127. #run dhcpcd
  128. #add a user, you can replace bash with whatever shell
  129. useradd -m -g users -G wheel -s /bin/bash reimu
  130. passwd reimu
  131. #install xorg, just install all of it
  132. sudo pacman -Syu
  133. pacman -S xorg
  134. #install graphics drivers for AMD
  135. sudo pacman -S xf86-video-amdgpu mesa mesa-libgl lib32-mesa-libgl mesa-vdpau lib32-mesa-vdpau
  136. #use the correct amount of threads when compiling, this will slow shit down while doing so though
  137. ehco 'MAKEFLAGS="-j$(nproc)"' >> ~/.makepkg.conf
  138. #install an AUR helper
  139. sudo pacman -S git
  140. git clone https://aur.archlinux.org/cower.git
  141. git clone https://aur.archlinux.org/pacaur.git
  142. cd cower && makepkg -si --skippgpcheck --noconfirm
  143. cd ~/pacaur && makepkg -si --noconfirm
  144. rm -rf ~/cower && rm -rf ~/pacaur
  145. #backup your luks header
  146. sudo cryptsetup luksHeaderBackup /dev/sda3 --header-backup-file /wherever/you/want
  147. #install the rest of your shit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement