Skip to content

Commit

Permalink
create_disk: Explicitly unmount partitions and fsck /boot
Browse files Browse the repository at this point in the history
For reasons I don't fully understand, trying to use
`tune2fs -U random /dev/disk/by-label/boot` fails without
this explicit fsck step, even though the filesystem appears
cleanly unmounted.

This is for coreos/fedora-coreos-config#354
to regenerate the UUID of `/boot` on firstboot.

Anyways, explicitly unmounting things seems better than relying
on `umount -R` to sort it, and having a `fsck` on `/boot` is
cheap.
  • Loading branch information
cgwalters committed May 13, 2020
1 parent e3905fd commit 53ae681
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ touch $rootfs/boot/ignition.firstboot
chattr +i $rootfs

fstrim -a -v
umount -R $rootfs
if [ ${EFIPN:+x} ]; then
umount $rootfs/boot/efi
fi
umount ${rootfs}/boot
e2fsck -y "${disk}${BOOTPN}"
umount $rootfs

rmdir $rootfs

0 comments on commit 53ae681

Please sign in to comment.