-.\" $OpenBSD: fdisk.8,v 1.103 2021/06/22 15:01:55 jmc Exp $
+.\" $OpenBSD: fdisk.8,v 1.104 2021/06/23 13:07:13 krw Exp $
.\"
.\"
.\" Copyright (c) 1997 Tobias Weingartner
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 22 2021 $
+.Dd $Mdocdate: June 23 2021 $
.Dt FDISK 8
.Os
.Sh NAME
.Fl b
specification.
.It Fl l Ar blocks
-Specify the number of blocks in the disk, and force the MBR to be in LBA
-mode only.
+Treat the disk as if it has the specified number of blocks.
.It Fl u
Update MBR bootcode, preserving existing MBR partition table.
The MBR bootcode extends from offset 0x000 to the start of the MBR partition
-/* $OpenBSD: fdisk.c,v 1.111 2021/06/22 14:01:58 krw Exp $ */
+/* $OpenBSD: fdisk.c,v 1.112 2021/06/23 13:07:13 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
b_sectors = DL_BLKTOSEC(&dl, b_sectors);
b_offset = DL_BLKTOSEC(&dl, b_offset);
}
+ if (l_arg > 0) {
+ if (l_arg % bps != 0)
+ l_arg += bps - l_arg % bps;
+ l_arg = DL_BLKTOSEC(&dl, l_arg);
+ disk.cylinders = l_arg / 64;
+ disk.heads = 1;
+ disk.sectors = 64;
+ disk.size = l_arg;
+ }
/* "proc exec" for man page display */
if (pledge("stdio rpath wpath disklabel proc exec", NULL) == -1)