Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #wipe disk
- dd if=/dev/urandom of=/dev/sda bs=4k 'status=progress'
- #gdisk for gpt UEFI or fdisk for regular bios
- #if you're going to use an older BIOS machine, just use mbr/dos, but you still need to make a /boot partition
- #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
- #parted /dev/disk set partition-number bios_grub on
- #after you make all your partitions. The partition number corresponds to the /boot partition number in fdisk
- #make gpt partition table
- fdisk -> g -> w
- #make efi partition
- fdisk -> n -> 300mb efi partition
- #change from linux filesystem to type EFI
- fdisk -> t -> 1
- #make boot partition
- fdisk -> n -> 400mb boot partition
- #make lvm partition
- fdisk -> n -> full size
- #change to type lvm
- fdisk -> t -> 31
- # write to filesystem with w
- #format EFI partition
- mkfs.fat -F32 /dev/sda1
- #format boot partition
- mkfs.ext2 /dev/sda2
- #setup sda3 for encryption
- cryptsetup -v -y -c aes-xts-plain64 -s 512 -h sha512 -i 2000 --use-urandom luksFormat /dev/sda3
- #if distro has sane defaults, CHECK BEFORE RUNNING SERIOUSLY
- cryptsetup luksFormat /dev/sda3
- #open the now encrypted partition
- cryptsetup open /dev/sda3 cryptdisk
- #it's now open in /dev/mapper
- #setting up LVM - first setup physical volume
- #data aligment is apperently better for SSDs
- pvcreate --dataalignment 1m /dev/mapper/cryptdisk
- #make volume group inside the new physical group
- vgcreate vg0 /dev/mapper/cryptdisk
- #make logical volumes inside the volume group
- #make a root partition with 40 gigs of space
- lvcreate -L 40GB vg0 -n root
- #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
- lvcreate -l 100%FREE vg0 -n home
- #activate the lvm
- modprobe dm_mod
- vgscan
- vgchange -ay
- #format the logical volumes
- mkfs.ext4 /dev/vg0/root
- mkfs.ext4 /dev/vg0/home
- #mount everything. make directories if they don't already exist
- mount /dev/vg0/root /mnt
- mount /dev/vg0/home /mnt/home
- mount /dev/sda2 /mnt/boot
- mount /dev/sda1 /mnt/boot/EFI
- #connect to the internet with wifi-menu
- #sort your mirrors with reflector
- pacman -Sy
- pacman -S reflector
- reflector --sort rate --protocol https --number 100 --fastest 50 --save /etc/pacman.d/mirrorlist
- #install the base distro with pacstrap, use linux-lts for the "stable" kernel
- pacstrap /mnt base base-devel vim linux-lts linux-lts-headers
- #generate your fstab, -U is for UUID
- genfstab -U /mnt >> /mnt/etc/fstab
- #chroot into your install
- arch-chroot /mnt
- #install bootloader packages etc. ignore efibootmgr for BIOS install
- pacman -S intel-ucode grub efibootmgr dosfstools openssh os-prober mtools wpa_supplicant dialog
- #set your timezone
- ln -sf /usr/share/zoneinfo/Africa/Cairo /etc/localtime
- hwclock --systohc --utc
- #enbale ntp
- timedatectl set-ntp true
- #set hostname
- echo cirno > /etc/hostname
- #configure your locale, either uncomment your locales in /etc/locale.gen or echo it with the below commands
- echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
- echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- echo LANG=en_US.UTF-8 >> /etc/locale.conf
- #set a root password
- passwd
- #setup init hooks
- vim /etc/mkinitcpio.conf
- #edit the HOOKS line
- HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)
- #generate the init script, linux for the regular kernel, linux-lts for the lts one
- mkinitcpio -p linux-lts
- #edit the grub config
- vim /etc/default/grub
- #add this before quiet on the GRUB_CMDLINE_LINUX_DEFAULT line, leave a space between it and quiet
- GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda3:vg0 quiet"
- #obviously change /dev/sda3 to whatever device has the physical group of your root logical volume, and chage vg0 to the corresponding volume group
- #install grub in efi mode
- grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
- #or install grub in bios mode
- grub-install --target=i386-pc --recheck /dev/sda
- #generate the grub config file
- grub-mkconfig -o /boot/grub/grub.cfg
- #Base system is now installed unmount and exit/reboot, below are some userspace things to do
- #setup sudo
- pacman -S sudo
- #uncomment the wheel group so any user in wheel can use sudo
- visudo
- #neworking
- #on a wired network just run dhcpcd, use something like ip addr to find device names
- ip link set dev enp3s0 up
- systemctl start dhcpcd
- #for wifi use wpa_supplicant until you install a gui client, this is a pain in the ass
- vim /etc/wpa_supplicant/wpa_supplicant.conf
- #add
- ctrl_interface=/run/wpa_supplicant
- update_config=1
- #start wpa_supplicant
- wpa_supplicant -B -i interface -c /etc/wpa_supplicant/wpa_supplicant.conf
- #start the interface
- wpa_cli
- #find the networks around you
- scan
- scan_results
- #add a network
- add_network
- 0
- set_network 0 ssid "MYSSID"
- set_network 0 psk "PASSWORD"
- #if it's an open network use
- set_network 0 key_mgmt NONE
- save_config
- #run dhcpcd
- #add a user, you can replace bash with whatever shell
- useradd -m -g users -G wheel -s /bin/bash reimu
- passwd reimu
- #install xorg, just install all of it
- sudo pacman -Syu
- pacman -S xorg
- #install graphics drivers for AMD
- sudo pacman -S xf86-video-amdgpu mesa mesa-libgl lib32-mesa-libgl mesa-vdpau lib32-mesa-vdpau
- #use the correct amount of threads when compiling, this will slow shit down while doing so though
- ehco 'MAKEFLAGS="-j$(nproc)"' >> ~/.makepkg.conf
- #install an AUR helper
- sudo pacman -S git
- git clone https://aur.archlinux.org/cower.git
- git clone https://aur.archlinux.org/pacaur.git
- cd cower && makepkg -si --skippgpcheck --noconfirm
- cd ~/pacaur && makepkg -si --noconfirm
- rm -rf ~/cower && rm -rf ~/pacaur
- #backup your luks header
- sudo cryptsetup luksHeaderBackup /dev/sda3 --header-backup-file /wherever/you/want
- #install the rest of your shit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement