You are not logged in.

#1 2023-09-12 16:11:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

/efi auto mounted despite setting no not mount flag [SOLVED]

I followed this and set flag 63 to my /dev/sda1 yet systemd continues to both create /efi and mount /dev/sda1 to /efi.  What am I missing?

# gdisk /dev/sda
Command (? for help): p
Command (? for help): x

Expert command (? for help): a
Partition number (1-4): 1
Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount

Attribute value is 8000000000000000. Set fields are:
63 (do not automount)

Toggle which attribute field (0-63, 64 or <Enter> to exit): 

Last edited by graysky (2023-09-17 12:34:47)

Offline

#2 2023-09-12 18:07:28

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,491

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

Offline

#3 2023-09-12 18:23:05

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

The ESP is not among the partitions that this flag may be applied to (I have no idea why, though): https://uapi-group.org/specifications/s … bute-flags

Also https://uapi-group.org/specifications/s … -operation

If the EFI partition shall not be mounted to /efi/ or /boot/, it must create /etc/fstab entries for them.

where "it" refers to "an installer" (so an Arch user). The "them" is weird: you need entries for both /efi/ and /boot/ rather than an entry for the EFI partition?

Last edited by Raynman (2023-09-12 18:28:38)

Offline

#4 2023-09-12 18:39:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

I added the entry to /etc/fstab and systemd is honoring it.  Ideally, I do not want that partition mounted at all.  I did not see an option for this in the systemd-gpt-auto-generator man page.

Offline

#5 2023-09-12 19:21:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

Allegedly it should not automount if you create a non-empty /efi file / directory on the root partition.  But I'd not put much stock in that.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2023-09-12 19:35:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,104

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

Option 1 : use a MBR drive instead of a GPT-formatted drive
(works fine if your drives are below 2 TiB )

man systemd-gpt-auto-generator wrote:

Note that this generator has no effect on non-GPT systems

edit :
yes, contrary to popular belief EFI can boot from MBR drives.
(it does require setting a special partition ID on the ESP)
end of edit

Option 2
For a GPT drive you can disable the generator .

systemd.gpt_auto, rd.systemd.gpt_auto
Those options take an optional boolean argument, and default to yes. The generator is enabled by default, and a false value may be used to disable it (e.g. "systemd.gpt_auto=0").

EFI systems can boot from MBR drives

Last edited by Lone_Wolf (2023-09-12 19:38:19)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2023-09-12 19:37:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,104

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

graysky wrote:

Ideally, I do not want that partition mounted at all.

A noauto fstab entry doesn't fit your situation?

Offline

#8 2023-09-13 19:37:42

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,491

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

seth wrote:

A noauto fstab entry doesn't fit your situation?

Or a ro,noauto fstab entry even?

Offline

#9 2023-09-14 14:47:42

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

What if you mask the .mount units created by the generator?

Offline

#10 2023-09-14 15:50:06

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

Raynman wrote:

The ESP is not among the partitions that this flag may be applied to (I have no idea why, though): https://uapi-group.org/specifications/s … bute-flags

Systemd follows the UEFI spec quite strictly here, and takes the stance that it's not allowed to interpret flag 63 on an ESP. 

The UEFI spec reserves flags 48 to 63 for partition-type specific interpretation, meaning whoever defines the partition type gets to say what those flags mean. For its own partition types (i.e. those in the UAPI DPS) it has decreed that 63 means "don't automount", but it can't do that for the ESP which is defined by the UEFI spec and not under systemd's control.  And the UEFI specification doesn't actually specify any additional flags for the ESP.

As such, in a strict understanding of the UEFI spec, flags 48 to 63 are not defined for the ESP.   While it probably wouldn't do any harm to interpret 63 on the ESP, later versions of the UEFI spec could technically assign an entirely different meaning to 63.  So I guess systemd wants to be on the safe side here.

See https://github.com/systemd/systemd/pull/5224 for the corresponding change in systemd.

Offline

#11 2023-09-17 12:33:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: /efi auto mounted despite setting no not mount flag [SOLVED]

Trilby wrote:

Allegedly it should not automount if you create a non-empty /efi file / directory on the root partition.  But I'd not put much stock in that.

That solved it, thank you as usual, Trilby!

Offline

Board footer

Powered by FluxBB