Re: RHEL 8 keeps auto-mounting /boot everytime the partition is modified
Mike Burger <[email protected]> Fri, 10 Jan 2025 14:17:36 +0000
| Newsgroups | gmane.linux.redhat.general |
|---|---|
| Message-ID | <010001945093e321-c01ff2c8-8def-4408-850e-a6b1163757ff-000000@email.amazonses.com> |
Most likely, you've still got /boot set to auto in /etc/fstab, so=20 systemd is remounting it, automatically. Try either removing "auto" from the /boot entry or comment it out in=20 /etc/fstab, then run systemctl daemon-reload. On 2025-01-09 14:39, Nicolas C. wrote: > Hi, >=20 > I'm currently writing a script to convert a VM from BIOS (legacy) to=20 > EFI. On my VMs I have a dedicated disk for /boot and I need to perfom=20 > some operations *while it's not mounted* on it to make it EFI-capable. >=20 > It's working fine on Debian 11 & 12 and OracleLinux/RHEL 9 but on RHEL=20 > 8 the system keeps automatically mounting /boot each time I make change= =20 > to the disk or partition (e.g. after running "sfdisk") even though I=20 > unmounted it. I see there is a "boot.automount" unit but I can't fine=20 > much info about it. >=20 > I've tried disabling the "boot.mount" unit, but it keeps getting=20 > mounted. The only workaround I found was to comment the entry in my=20 > fstab with sed and event with this the system keep trying to mount it=20 > (!) but fails. >=20 > Any idea why this happens? >=20 > Thanks, >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > Disk /dev/sda: 1 GiB, 1073741824 bytes, 2097152 sectors > Units: sectors of 1 * 512 =3D 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 >=20 > Device Boot Start End Sectors Size Id Type > /dev/sda1 * 2048 2097151 2095104 1023M 83 Linux >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > umount /boot >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > resize2fs /dev/sda1 987136K >=20 > echo ",51200K" | sfdisk --force -N 1 /dev/sda >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > Result: >=20 > Jan 9 20:21:49 rhel8-efi kernel: sda: sda1 > Jan 9 20:21:49 rhel8-efi systemd[1]:=20 > systemd-fsck@dev-disk-by\x2duuid-a210ff5a\x2de2fb\x2d400d\x2d86b5\x2de195= 74763bf5.service:=20 > Succeeded. > Jan 9 20:21:49 rhel8-efi systemd[1]: Stopped File System Check on=20 > /dev/disk/by-uuid/a210ff5a-e2fb-400d-86b5-e19574763bf5. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Condition check resulted in=20 > Virtual_disk being skipped. > Jan 9 20:21:49 rhel8-efi systemd[1]: Starting File System Check on=20 > /dev/disk/by-uuid/a210ff5a-e2fb-400d-86b5-e19574763bf5... > Jan 9 20:21:49 rhel8-efi systemd-fsck[11519]: /dev/sda1=C2=A0: propre,= =20 > 323/65536 fichiers, 57178/246784 blocs > Jan 9 20:21:49 rhel8-efi systemd[1]: Started File System Check on=20 > /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=20 > with ordered data mode. Opts: discard > Jan 9 20:21:49 rhel8-efi systemd[1]: Mounted /boot. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > systemctl list-units --all boot.automount > UNIT LOAD ACTIVE SUB DESCRIPTION >=20 >=20 > =E2=97=8F boot.automount not-found inactive dead boot.automount >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > systemctl status boot.automount > Unit boot.automount could not be found. >=20 > To unsubscribe from this group and stop receiving emails from it, send=20 > an email to [email protected]. --=20 https://poplme.co/hash/lqQkxj0F/1/es "It's always suicide-mission this, save-the-planet that. No one ever=20 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 e= mail to [email protected].