Some notes I took about partitioning and encrypted root filesystem while trying to install alpine (which never ended up happening by the way).

# setup-interfaces
# ifdown eth0 && ifup eth0
# setup-apkrepos
# apk add cryptsetup e2fsprogs lsblk nano
# fdisk /dev/sda
o     [create DOS partition table]
n     [new partition]
p     [primary]
1     [partition #1]
ENTER [whatever default first sector is]
+512M [make it 512MB in size]
a     [toggle bootable flag]
1     [make partition #1 bootable]
n     [new partition]
p     [primary]
2     [partition #2]
ENTER [whatever default first sector is]
ENTER [use rest of disk]
# mkfs.ext2 /dev/sda1
# cryptsetup format /dev/sda2
# cryptsetup open /dev/sda2 rootfs
# mkfs.ext4 /dev/mapper/rootfs
# mount -t ext4 /dev/mapper/rootfs /mnt
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot
# setup-disk -m sys /mnt/
# mkinitfs -c /mnt/etc/mkinitfs/mkinitfs.conf -b /mnt/ $(ls /mnt/lib/modules/)
# mount -t proc /proc /mnt/proc
# mount --rbind /dev /mnt/dev
# mount --make-rslave /mnt/dev
# mount --rbind /sys /mnt/sys
# chroot /mnt
# apk add grub lvm2
# nano /etc/default/grub
GRUB_TIMEOUT=2
GRUB_DISABLE_SUBMENU=y
GRUB_DISABLE_RECOVERY=true
GRUB_CMDLINE_LINUX_DEFAULT="modules=sd-mod,usb-storage,ext4,nvme cryptroot=UUID=XXXX cryptdm=lvmcrypt cryptkey quiet rootfstype=ext4"
GRUB_PRELOAD_MODULES="luks cryptodisk part_gpt lvm"
GRUB_ENABLE_CRYPTODISK=y
# nano /root/grub-pre.cfg
set crypto_uuid=<XXXX-UUID_WITHOUT_HYPHENS>
cryptomount -u $crypto_uuid
set root='lvmid/<YYYY>/<ZZZZ>'
set prefix=($root)/boot/grub
insmod normal
normal
technotes/fucking_alpine_linux_sucks.txt · Last modified: 2023-08-06 19:33 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki