Skip to content

Commit

Permalink
create_disk: Ensure filesystem journal on rootfs is clean
Browse files Browse the repository at this point in the history
Trying to get osmet to work with RHCOS, I kept being unable to
mount the rootfs and it turned out that while the code I'd added
to unpack the LUKS bits was working fine, mounting the rootfs
was failing because the block device was read-only, but XFS
wanted to replay the journal.

And for some reason I haven't traced through yet, this apparently
isn't affecting FCOS, but the unclean journal is breaking osmet
w/RHCOS.

This of course is the *second* time I've hit this problem of
"ext4 flushes the journal on umount, XFS doesn't" - see
also ostreedev/ostree#1049

Adding the necessary invocation of `xfs_freeze` ensures
that our firstboot has a clean XFS journal for `/` which
is just a good idea anyways.
  • Loading branch information
cgwalters committed May 26, 2020
1 parent 021b6c8 commit 3a734ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ echo "set ignition_network_kcmdline='${firstboot_kargs}'" > $rootfs/boot/ignitio
chattr +i $rootfs

fstrim -a -v
# Ensure the filesystem journal is flushed
mount -o remount,ro $rootfs
xfs_freeze -f $rootfs
umount -R $rootfs

rmdir $rootfs

0 comments on commit 3a734ec

Please sign in to comment.