git: DragonFly_RELEASE_6_4 fdisk(8): Calculate ncylinders and warn about mismatch

Aaron LI aly at crater.dragonflybsd.org
Fri May 9 01:03:02 PDT 2025


commit e6e85bab2b69bcebfe003d223295be2bda844488
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/e6e85bab2b69bcebfe003d223295be2bda844488


-- 
DragonFly BSD source repository


More information about the Commits mailing list