12345678910111213141516171819202122232425262728293031 |
- # Prepare nvme disk with the layout:
- # - 301 MB partition for EFI
- # - 50 GB root partition for the OS (includes /boot)
- # - Remaining disk left to create a luks container
- disk="/dev/nvme0n1"
- # Cleanup existing partition tables
- #dd if=/dev/zero of=$disk bs=512 count=34
- # Prepare partition tables and partitions
- # -parted does not accept blanks in partition names
- parted $disk --script \
- mklabel gpt \
- mkpart EFI_system_partition fat32 1MiB 301MiB \
- set 1 esp on \
- set 1 boot on \
- align-check optimal 1 \
- mkpart Linux_system_parition ext4 301MiB 50GiB \
- align-check optimal 2 \
- mkpart Data_partion 50GiB 100% \
- align-check optimal 3 \
- unit MiB \
- print
- # Make file systems
- mkfs.fat -F 32 -n EFIBOOT $disk"p1" && fsck $disk"p1"
- mkfs.ext4 $disk"p2" && fsck $disk"p2"
|