Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
[orabos] A/B root partitions, Third for persistence
Browse files Browse the repository at this point in the history
We could either have two completely separate paritions,
and copy things manually around, or this.
Btrfs offers the option create subvolumes for partitioning
the data further up.
Otherwise we would have to statically determine the size
of the home, var, and var/tmp partitions (or at least:
home and var).

As the VMs will (eventually) only run with non-local storage, the
partition will only be used for our data, which should be practically
ephemeral, and is only persisted for a faster life-cycle.
  • Loading branch information
fwiesel committed Jun 14, 2024
1 parent 830a549 commit 62fab71
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions features/orabos/file.exclude
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/etc/systemd/network/99-default.network
/etc/systemd/system/systemd-resolved.service.d/wait-for-networkd.conf
/etc/repart.d/root.conf
/etc/kernel/cmdline.d/99-no-gpt-auto.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[Partition]
Type=root
SizeMaxBytes=4G
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This needs to stay as long as we use config-drives
# It doesn't add much in case we don't.
# As the time of writing metal3 and nova/ironic do.
[Partition]
Type=linux-generic
Label=config-2
SizeMaxBytes=64M
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Partition]
Type=root
NoAuto=on
SizeMaxBytes=4G
10 changes: 10 additions & 0 deletions features/orabos/file.include/etc/repart.d/50_persistent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Partition]
Type=linux-generic
Label=persistent
Format=btrfs
Subvolumes=/home /srv /var /var/tmp
CopyFiles=/home
CopyFiles=/srv
CopyFiles=/var
ExcludeFiles=/var/tmp
Weight=4000
18 changes: 18 additions & 0 deletions features/orabos/file.include/etc/systemd/system/home.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Directory (/home)
Documentation=man:file-hierarchy(7)
ConditionPathIsSymbolicLink=!/home
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=-.mount
After=blockdev@dev-disk-by\x2dlabel-persistent.target

[Mount]
What=/dev/disk/by-label/persistent
Where=/home
Type=btrfs
Options=subvol=/home

[Install]
WantedBy=local-fs.target
18 changes: 18 additions & 0 deletions features/orabos/file.include/etc/systemd/system/var-tmp.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Directory (/var/tmp)
Documentation=man:file-hierarchy(7)
ConditionPathIsSymbolicLink=!/var/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=var.mount
After=blockdev@dev-disk-by\x2dlabel-persistent.target

[Mount]
What=/dev/disk/by-label/persistent
Where=/var/tmp
Type=btrfs
Options=subvol=/var/tmp

[Install]
WantedBy=local-fs.target
18 changes: 18 additions & 0 deletions features/orabos/file.include/etc/systemd/system/var.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Directory (/var)
Documentation=man:file-hierarchy(7)
ConditionPathIsSymbolicLink=!/var
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=-.mount
After=blockdev@dev-disk-by\x2dlabel-persistent.target

[Mount]
What=/dev/disk/by-label/persistent
Where=/var
Type=btrfs
Options=subvol=/var

[Install]
WantedBy=local-fs.target

0 comments on commit 62fab71

Please sign in to comment.