NetBSD Problem Report #57988

From www@netbsd.org  Sun Mar  3 03:11:14 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 244021A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  3 Mar 2024 03:11:14 +0000 (UTC)
Message-Id: <20240303031112.67F6B1A923A@mollari.NetBSD.org>
Date: Sun,  3 Mar 2024 03:11:12 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: sysinst partition editor has off-by-one errors
X-Send-Pr-Version: www-1.0

>Number:         57988
>Category:       install
>Synopsis:       sysinst partition editor has off-by-one errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 03 03:15:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBSD Partition
>Environment:
>Description:
16 GB disk (17 179 869 184 bytes) ld4.

# sysinst
>a: Installation messages in English
>a: Install NetBSD to hard disk
>b: Yes
>a: ld4 (16G)
>a: Guid Partition Table (GPT)
>b: Use default partition sizes

This shows the following partition table:

     Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
    ------------ ------------ ------------ -------- ---- ----------------
 a:           64        65599        65536    MSDOS N    /boot
 b:        65600     31506431     31440832  FFSv2ea IN   /
 c:     31506432     33554416      2047985     swap

It's weird that end is odd, not even, because that means it has to be an _inclusive_ upper bound, i.e., end = start + size - 1, rather than end = start + size as I would expect -- or, weirder, it must mean that size is one _larger_ than the size of the partition.

I select this to change the /boot partition size:

>a:           64        65599        65536    MSDOS N    /boot
>c:             size : 65536 sec

This leads to:

Size (max 65535 sec) [65535]: 

Why is the maximum size 65535 and not 65536?

Here are two possibilities:

1. The maximum size is actually 65536 and the UI is wrong.
2. The maximum size is actually 65535 and the defaults are wrong leading to overlapping partitions and possibly data corruption or loss.
>How-To-Repeat:

>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.