Most likely, you've still got /boot set to auto in /etc/fstab, so
systemd is remounting it, automatically.
Try either removing "auto" from the /boot entry or comment it out in
/etc/fstab, then run systemctl daemon-reload.
On 2025-01-09 14:39, Nicolas C. wrote:
Hi,
I'm currently writing a script to convert a VM from BIOS (legacy) to
EFI. On my VMs I have a dedicated disk for /boot and I need to perfom
some operations *while it's not mounted* on it to make it EFI-capable.
It's working fine on Debian 11 & 12 and OracleLinux/RHEL 9 but on RHEL
8 the system keeps automatically mounting /boot each time I make change
to the disk or partition (e.g. after running "sfdisk") even though I
unmounted it. I see there is a "boot.automount" unit but I can't fine
much info about it.
I've tried disabling the "boot.mount" unit, but it keeps getting
mounted. The only workaround I found was to comment the entry in my
fstab with sed and event with this the system keep trying to mount it
(!) but fails.
Any idea why this happens?
Thanks,
=========================================================
Disk /dev/sda: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8e565d9c
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2097151 2095104 1023M 83 Linux
=========================================================
umount /boot
=========================================================
resize2fs /dev/sda1 987136K
echo ",51200K" | sfdisk --force -N 1 /dev/sda
=========================================================
Result:
Jan 9 20:21:49 rhel8-efi kernel: sda: sda1
Jan 9 20:21:49 rhel8-efi systemd[1]:
systemd-fsck@dev-disk-by\x2duuid-a210ff5a\x2de2fb\x2d400d\x2d86b5\x2de19574763bf5.service:
Succeeded.
Jan 9 20:21:49 rhel8-efi systemd[1]: Stopped File System Check on
/dev/disk/by-uuid/a210ff5a-e2fb-400d-86b5-e19574763bf5.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in
Virtual_disk being skipped.
Jan 9 20:21:49 rhel8-efi systemd[1]: Starting File System Check on
/dev/disk/by-uuid/a210ff5a-e2fb-400d-86b5-e19574763bf5...
Jan 9 20:21:49 rhel8-efi systemd-fsck[11519]: /dev/sda1 : propre,
323/65536 fichiers, 57178/246784 blocs
Jan 9 20:21:49 rhel8-efi systemd[1]: Started File System Check on
/dev/disk/by-uuid/a210ff5a-e2fb-400d-86b5-e19574763bf5.
Jan 9 20:21:49 rhel8-efi systemd[1]: Mounting /boot...
Jan 9 20:21:49 rhel8-efi kernel: EXT4-fs (sda1): mounted filesystem
with ordered data mode. Opts: discard
Jan 9 20:21:49 rhel8-efi systemd[1]: Mounted /boot.
=========================================================
systemctl list-units --all boot.automount
UNIT LOAD ACTIVE SUB DESCRIPTION
● boot.automount not-found inactive dead boot.automount
=========================================================
systemctl status boot.automount
Unit boot.automount could not be found.
To unsubscribe from this group and stop receiving emails from it, send
an email to redhat-list+unsubscribe@xxxxxxxxxx.
--
https://poplme.co/hash/lqQkxj0F/1/es
"It's always suicide-mission this, save-the-planet that. No one ever
just
stops by to say 'hi' anymore." --Colonel Jack O'Neill, SG1
To unsubscribe from this group and stop receiving emails from it, send an email to redhat-list+unsubscribe@xxxxxxxxxx.