Skip to content

Instantly share code, notes, and snippets.

@lapwat
Last active June 17, 2018 09:14
Show Gist options
  • Save lapwat/324a532075e8190822b7e1dea76b61d7 to your computer and use it in GitHub Desktop.
Save lapwat/324a532075e8190822b7e1dea76b61d7 to your computer and use it in GitHub Desktop.
$ cryptsetup open --type plain /dev/nvme0n1 ssd
$ dd if=/dev/zero of=/dev/mapper/ssd bs=4M
$ fdisk /dev/nvme0n1
> p1: 500M EFI System
> p2: reste Linux filesystem
$ mkfs.ext2 -L boot /dev/nvme0n1p1
$ cryptsetup benchmark
$ cryptsetup -c aes-xts-plain64 -h sha512 -s 256 -y luksFormat /dev/nvme0n1p2
> YES
> PASSPHRASE
$ cryptsetup luksOpen /dev/nvme0n1p2 ssd
> PASSPHRASE
$ pvcreate /dev/mapper/ssd
$ vgcreate vg /dev/mapper/ssd
$ lvcreate -n swap -L 16G vg
$ lvcreate -n void -l +100%FREE vg
$ mkswap -L SWAP /dev/mapper/vg-swap
$ mkfs.btrfs -K -L VOID /dev/mapper/vg-arch
$ mount -o defaults,noatime,ssd,discard,compress=lzo /dev/mapper/vg-void /mnt
$ cd /mnt
$ btrfs subvolume create __active
$ btrfs subvolume create __active/rootvol
$ btrfs subvolume create __active/home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment