Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 May 2022 09:54:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 264090] gpart bootcode safety checks
Message-ID:  <bug-264090-3630-PBiASIYMl5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-264090-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-264090-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264090

--- Comment #4 from Piotr Florczyk <piotr.florczyk@gemius.com> ---
(In reply to Warner Losh from comment #1)
I know I don't have to but as I already mentioned... If you boot in UEFI
installer always defaults to BIOS+UEFI scheme and places freebsd-boot as se=
cond
partition. This changes holy index of that partition from 1 to 2.
I operate more than 100 of FreeBSD servers and this is first time I did a t=
ypo.
One could say that this is combination of:
- defaults in the installer (partition order, I understand why it defaults =
to
BIOS+UEFI)
- bad luck (efi partition not mounted on older installs)
- human error
but the point is it could be prevented if gpart did some checks.

If I understand correctly gpart bootcode overwrites first sector with code
which seeks for partition type freebsd-boot. I see no reason in allowing
writing boot code in other partition types.

I already had my lesson. This will prevent others from losing data. Current=
ly
only mounted partitions are protected.

Case mentioned by Kurt is also valid.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264090-3630-PBiASIYMl5>