Skip to content

Instantly share code, notes, and snippets.

@clux
Created July 26, 2016 16:43
Show Gist options
  • Save clux/28f4f57bc98d432a25efdf512ea9e44f to your computer and use it in GitHub Desktop.
Save clux/28f4f57bc98d432a25efdf512ea9e44f to your computer and use it in GitHub Desktop.
#!/bin/bash
exit 1
# 30GB flash device on /dev/sdb
sgdisk -Z \
-n 1:0:+512M -t 1:ef00 -c 1:bootefi \
-n 2:0:+2G -t 2:8200 -c 2:swap \
-n 3:0:0 -t 3:8303 -c 3:root \
-p /dev/sdb
# 2TB home dir on /dev/sda
sgdisk -Z \
-n 1:0:0 -t 1:8302 -c 1:home \
-p /dev/sda
# filesystems
mkfs.fat -F32 /dev/sdb1 # boot partition
mkswap /dev/sdb2 # swap partition
mkfs.ext4 -E discard /dev/sdb3 # root partition
mkfs.ext4 /dev/sda1 # home partition
# mount fs
mount /dev/sdb3 /mnt
mkdir -p /mnt/{boot,home}
mount /dev/sdb1 /mnt/boot
swapon /dev/sdb2
mount /dev/sda1 /mnt/home
#chroot
pacstrap /mnt base base-devel vim
genfstab -U -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bash
#mkinitcpio add keymap and resume before filesystems
#boot loader entry:
title Arch Linux Workstation
linux /vmlinuz-linux-lts
initrd /initramfs-linux-lts.img
options root=/dev/sdb3 home=/dev/sda1 resume=/dev/sdb2 quiet rw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment