From 3e4f07eaba50fc223ab92ec2de859d8cc828dd18 Mon Sep 17 00:00:00 2001 From: krw Date: Fri, 21 May 2021 19:09:46 +0000 Subject: [PATCH] The protective MBR for GPT partitioning must be at sector 0. No EBR qualifies. --- sbin/fdisk/mbr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/fdisk/mbr.c b/sbin/fdisk/mbr.c index 16e21da15a1..f2b685980cd 100644 --- a/sbin/fdisk/mbr.c +++ b/sbin/fdisk/mbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.c,v 1.70 2021/05/14 21:11:15 krw Exp $ */ +/* $OpenBSD: mbr.c,v 1.71 2021/05/21 19:09:46 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -42,6 +42,9 @@ MBR_protective_mbr(struct mbr *mbr) struct dos_partition dp[NDOSPART], dos_partition; int i; + if (mbr->offset != 0) + return (-1); + for (i = 0; i < NDOSPART; i++) { PRT_make(&mbr->part[i], mbr->offset, mbr->reloffset, &dos_partition); -- 2.20.1