generlising naming scheme

This commit is contained in:
Tastatur 2023-12-27 14:01:33 +01:00
parent 14fd104155
commit 76982f1427
2 changed files with 18 additions and 18 deletions

View file

@ -3,7 +3,7 @@
To install the Alpine Linux distribution on the system, the encrypted partition and the efi partition have to be mounted to the main system. To install the Alpine Linux distribution on the system, the encrypted partition and the efi partition have to be mounted to the main system.
``` ```
# mount /dev/vg1/root{n} /mnt -t ext4 # mount /dev/vg{m}/root{n} /mnt -t ext4
# mkdir /mnt/boot/efi -p # mkdir /mnt/boot/efi -p
# mount /dev/<disk1> /mnt/boot/efi -t vfat # mount /dev/<disk1> /mnt/boot/efi -t vfat
``` ```
@ -22,8 +22,8 @@ Now the other directories are going to be mounted so that it's possible to chroo
# for i in dev proc sys run; do # for i in dev proc sys run; do
> mount --rbind --make-rslave /$i /mnt/$i > mount --rbind --make-rslave /$i /mnt/$i
> done > done
# mount /dev/vg1/var{n} /mnt/var # mount /dev/vg{m}/var{n} /mnt/var
# mount /dev/vg1/tmp{n} /mnt/tmp # mount /dev/vg{m}/tmp{n} /mnt/tmp
# chroot /mnt # chroot /mnt
``` ```
@ -50,11 +50,11 @@ Edit `/etc/fstab` for correct mounts:
``` ```
/dev/disk/by-label/efi /boot/efi vfat defaults 0 2 /dev/disk/by-label/efi /boot/efi vfat defaults 0 2
/dev/vg1/root{n} / ext4 defaults,noatime 0 1 /dev/vg{m}/root{n} / ext4 defaults,noatime 0 1
/dev/vg1/home{n} /home ext4 defaults,noatime,nodev 0 1 /dev/vg{m}/home{n} /home ext4 defaults,noatime,nodev 0 1
/dev/vg1/tmp{n} /tmp ext4 defaults,nodev,nosuid,noexec 0 1 /dev/vg{m}/tmp{n} /tmp ext4 defaults,nodev,nosuid,noexec 0 1
/dev/vg1/var{n} /var ext4 defaults,nodev,nosuid,noexec 0 1 /dev/vg{m}/var{n} /var ext4 defaults,nodev,nosuid,noexec 0 1
/dev/vg1/nix{n} /nix ext4 defaults,nodev,nosuid 0 1 /dev/vg{m}/nix{n} /nix ext4 defaults,nodev,nosuid 0 1
proc /proc proc nosuid,nodev,noexec,hidepid=2 0 0 proc /proc proc nosuid,nodev,noexec,hidepid=2 0 0
``` ```
@ -88,7 +88,7 @@ To:
And configure `/etc/kernel-hooks.d/secureboot.conf` for cmdline and secureboot. And configure `/etc/kernel-hooks.d/secureboot.conf` for cmdline and secureboot.
``` ```
cmdline="rw rd.luks.name=<uuid>=luks root=/dev/vg1/root{n} modules=ext4 quiet splash rd.lvm.vg=vg1" cmdline="rw rd.luks.name=<uuid>=luks root=/dev/vg{m}/root{n} modules=ext4 quiet splash rd.lvm.vg=vg{m}"
signing_cert="/usr/share/secureboot/keys/db/db.pem" signing_cert="/usr/share/secureboot/keys/db/db.pem"
signing_key="/usr/share/secureboot/keys/db/db.key" signing_key="/usr/share/secureboot/keys/db/db.key"

View file

@ -35,29 +35,29 @@ And the encrypted filesystem on the root partition.
# cryptsetup open --type luks /dev/<disk2> luks # cryptsetup open --type luks /dev/<disk2> luks
``` ```
Now to create a new LVM volume group: Now to create a new LVM volume group (choose $m,n \in \mathbb{N}$ accordingly):
``` ```
# vgcreate vg1 /dev/mapper/luks # vgcreate vg{m} /dev/mapper/luks
``` ```
To create partitions inside the volume group: To create partitions inside the volume group:
``` ```
# lvcreate --name root{n} -L 16G vg1 # lvcreate --name root{n} -L 16G vg{m}
# lvcreate --name var{n} -L 8G vg1 # lvcreate --name var{n} -L 8G vg{m}
# lvcreate --name tmp{n} -L 16G vg1 # lvcreate --name tmp{n} -L 16G vg{m}
# lvcreate --name nix{n} -L 32G vg1 # lvcreate --name nix{n} -L 32G vg{m}
# lvcreate --name home{n} -l 100%FREE vg1 # lvcreate --name home{n} -l 100%FREE vg{m}
``` ```
Choose $n \in \mathbb{N}$ accordingly. Now the home partition fills the entirety of the volume group. These sizes should be changed depending on the needs of the user. Now the home partition fills the entirety of the volume group. These sizes should be changed depending on the needs of the user.
To create the filesystems on the logical partitions: To create the filesystems on the logical partitions:
``` ```
for i in root{n} var{n} tmp{n} nix{n} home{n}; do for i in root{n} var{n} tmp{n} nix{n} home{n}; do
> mkfs.ext4 /dev/vg1/$i > mkfs.ext4 /dev/vg{m}/$i
> done > done
``` ```