DEVELOPMENT ENVIRONMENT

~liljamo/src.quest-anemos

src.quest-anemos/README.md -rw-r--r-- 1.2 KiB
1a58233cJonni Liljamo feat: persistent disk 7 days ago

#src.quest anemos infra

#Common files

./common/ contains files that are common to all hosts, they can be copied to host directories with just merge-with-common and can be removed with just remove-common.

These steps are done automatically during build steps.

#Modes

Modes can be re-generated with just make-modes when adding new files, but be wary if existing entries change from previous values.

#Persistent disk

Persistent disks should be added manually to virtual machines, partitioned manually and then can be added to fstab creation in the IMGBUILD. This is so no automatic process touches them.

#Creating the disk

Attach a new disk to the virtual machine, it should show up as /dev/vdb.

# Deps if not installed
apk add uuidgen findmnt

# Partitioning
parted -s -- /dev/vdb mklabel msdos \
    mkpart primary 4096s -1s
partprobe /dev/vdb

# Generate disk UUID, save this
uuidgen

# Formatting
mkfs.ext4 -q -F -U SAVED_UUID /dev/vdb1

# Mount
mkdir /mnt/persistent
mount /dev/vdb1 /mnt/persistent

# Save mount options
findmnt -no OPTIONS /dev/vdb1

#Adding to fstab

Add to the end of the IMGBUILD setup function:

echo "UUID=REPLACE_WITH_UUID /mnt/persistent ext4 REPLACE_WITH_OPTIONS 0 2" >> "${imgroot}/etc/fstab"