git: fdisk(8): Calculate ncylinders and warn about mismatch
Aaron LI
aly at crater.dragonflybsd.org
Thu May 8 22:14:11 PDT 2025
commit 892d09d08fb6d65d486d71cc4918daa3b379debc
Author: Aaron LI <aly at aaronly.me>
Date: Thu May 8 17:10:03 2025 +0800
fdisk(8): Calculate ncylinders and warn about mismatch
The virtio_blk(4) disk driver was directly reporting the ncylinders
parameter specified by the QEMU emulator, which however is capped at
16383 (the legacy MBR maximum). That confused fdisk(8) to recognize the
disk to have only ~8GB size instead of the full capacity.
The issue virtio_blk(4) has been fixed in a former commit. This commit
improve fdisk(8) by calculating the ncylinders on its own and comparing
it with the one provided by the disk. If there is a mismatch, emit a
warning message to remind a fix to the disk driver.
Derived from the patch submitted by mikdusan in bug #3369.
Bug: https://bugs.dragonflybsd.org/issues/3369
Summary of changes:
sbin/fdisk/fdisk.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/892d09d08fb6d65d486d71cc4918daa3b379debc
--
DragonFly BSD source repository
More information about the Commits
mailing list