NetBSD Problem Report #55376

From tsutsui@ceres.dti.ne.jp  Fri Jun 12 17:34:49 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 2E9011A9219
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 12 Jun 2020 17:34:49 +0000 (UTC)
Message-Id: <202006121734.05CHYac8005044@ceres.dti.ne.jp>
Date: Sat, 13 Jun 2020 02:34:36 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: sysinst doesn't show 0 byte swap partition on partition editor
X-Send-Pr-Version: 3.95

>Number:         55376
>Category:       install
>Synopsis:       sysinst doesn't show 0 byte swap partition on partition editor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 12 17:35:00 +0000 2020
>Last-Modified:  Tue Sep 29 14:40:01 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: NetBSD 9.0 (RAMDISK) #0: Fri Feb 14 00:06:28 UTC 2020
mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/cobalt/compile/RAMDISK
Architecture: maybe all
Machine: all
>Description:
sysinst doesn't show a swap partition on its partition editor
if swap partition size is empty.

In that case, partition c ("NetBSD partition" on ports RAW_PART==3)
is shown at "b:" line and partition d ("Whole disk") is shown
at "c:" line. It is really confusing users.

---

     Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
    ------------ ------------ ------------ -------- ---- ----------------
 a:        20546      1049327      1028782   4.2BSD N    /
 b:        10304      1049327      1039024 NetBSD partition
 c:            0      1049327      1049328 Whole disk
 d:        10305        20544        10240 Linux Ex N    /stand
    ------------ ------------ ------------ -------- ---- ----------------

---

Note partition editor doesn't show swap partition,
partition seems written properly: (i.e. 0 byte swap):

---
# disklabel wd0
# /dev/rwd0:
 :

5 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   1028782     20546     4.2BSD      0     0     0  # (Cyl.     20*-   1040)
 c:   1039024     10304     unused      0     0        # (Cyl.     10*-   1040)
 d:   1049328         0     unused      0     0        # (Cyl.      0 -   1040)
 e:     10240     10305 Linux Ext2      0     0        # (Cyl.     10*-     20*)

---

>How-To-Repeat:
GXemul is easier way to test.

% dd if=/dev/zero of=gxemul-cobalt.img bs=1m count=512
% ftp http://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0/cobalt/binary/kernel/netbsd-RAMDISK.gz
% gxemul -X -E cobalt -d gxemul-cobalt.img netbsd-RAMDISK.gz

(see PR install/55375 for detailed procedure before partitioning)

---

 You can now change the sizes for the system partitions.  The default is to
 allocate all the space to the root file system.  However, you may wish to
 have separate /usr (additional system files), /var (log files etc) or /home
 (users' home directories) file systems.

 Free space will be added to the partition marked with a '+'.

       Size (sec)                            Filesystem
       ----------------------------------- - --------------------
    a: 10240                                 /stand
    b: 643072 (1028784)                    + /
    c: 0                                     <swap>
    d: 0                                     /tmp (mfs)
    e: 0                                     /usr
    f: 0                                     /var
       ----------------------------------- - --------------------
    h: Add a user defined partition
    i: Clone external partition(s)
    j: Change input units (sectors/cylinders/MB/GB)
   >x: Go on.  Free space 385712 sec.

---

 We now have your disklabel partitions for wd0 below.  This is your last   
 chance to change them. 

 Flags: (N)ewfs.  Total size: 507M, free: 1024B

     Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
    ------------ ------------ ------------ -------- ---- ----------------
 a:        20546      1049327      1028782   4.2BSD N    /
 b:        10304      1049327      1039024 NetBSD partition
 c:            0      1049327      1049328 Whole disk
 d:        10305        20544        10240 Linux Ex N    /stand
    ------------ ------------ ------------ -------- ---- ----------------
 f: Add a partition
 g: Change input units (sectors/cylinders/MB/GB)
 h: Edit name of the disk
 i: Clone external partition(s)
 j: Cancel
>x: Partition sizes ok

---

>Fix:
No idea which code skip the empty swap partition for me.

---
Izumi Tsutsui

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/55376: sysinst doesn't show 0 byte swap partition on
 partition editor
Date: Mon, 28 Sep 2020 19:38:50 +0200

 On Fri, Jun 12, 2020 at 05:35:01PM +0000, Izumi Tsutsui wrote:
 > In that case, partition c ("NetBSD partition" on ports RAW_PART==3)
 > is shown at "b:" line and partition d ("Whole disk") is shown
 > at "c:" line. It is really confusing users.

 I personally do not find it confusing, it is just a menu label (that
 happens to be identical to the disklabel partition sometimes).

 It probably is mostly confusing to folks very familiar with BSD and disklabels,
 and there have been multiple queries about it.

 Not really sure how to best deal with it though - maybe if RAW_PART <= 3
 and/or the last used partition < 8 always list all partitions, even the
 unused ones.

 But overall I would leave it all as-is. Comments + suggestions welcome.

 Martin

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: martin@duskware.de, install-manager@netbsd.org, tsutsui@ceres.dti.ne.jp
Subject: Re: install/55376: sysinst doesn't show 0 byte swap partition onpartition
	 editor
Date: Tue, 29 Sep 2020 23:37:01 +0900

 >  > In that case, partition c ("NetBSD partition" on ports RAW_PART==3)
 >  > is shown at "b:" line and partition d ("Whole disk") is shown
 >  > at "c:" line. It is really confusing users.
 >  
 >  I personally do not find it confusing, it is just a menu label (that
 >  happens to be identical to the disklabel partition sometimes).
 >  
 >  It probably is mostly confusing to folks very familiar with BSD and disklabels,
 >  and there have been multiple queries about it.
 >  
 >  Not really sure how to best deal with it though - maybe if RAW_PART <= 3
 >  and/or the last used partition < 8 always list all partitions, even the
 >  unused ones.

 IIRC the essencial problem was I could not re-add a swap partition
 (that was zero'ed due to PR/55375) at the explicit b: partition.

 ---
 Izumi Tsutsui

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.