NetBSD Problem Report #43430

From www@NetBSD.org  Mon Jun  7 16:51:29 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 1C6D363B8CF
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  7 Jun 2010 16:51:29 +0000 (UTC)
Message-Id: <20100607165128.99B2763B8CD@www.NetBSD.org>
Date: Mon,  7 Jun 2010 16:51:28 +0000 (UTC)
From: netbsd@g-pb.de
Reply-To: netbsd@g-pb.de
To: gnats-bugs@NetBSD.org
Subject: disklabel -i should not create overlapping partions (except unused)
X-Send-Pr-Version: www-1.0

>Number:         43430
>Category:       bin
>Synopsis:       disklabel -i should not create overlapping partions (except unused)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 07 16:55:00 +0000 2010
>Originator:     Rainer Glaschick
>Release:        NetBSD 5.1_RC2
>Organization:
>Environment:
NetBSD kerneu 5.1_RC2 NetBSD 5.1_RC2 (GENERIC) #0: Fri May 21 04:32:33 UTC 2010  builds@b8.netbsd.org:/home/builds/ab/netbsd-5-1-RC2/i386/201005210534Z-obj/home/builds/ab/netbsd-5-1-RC2/src/sys/arch/i386/compile/GENERIC i386

>Description:
disklabel -i allows the user to define overlapping partitions. 

In particular, the indication of "'$' for all remaining" is misleading; it should at least read "'$' for end of disk", making clear that not the remaining space until the next used partition is meant. The man page is silent about this "feature", which is very dangerous.

Moreover, although new with NetBSD, I doubt that there are many cases where overlapping partitions in a disklabel are useful, except unused partitions like c and d. So I would prefer - in the interactive mode at least - that, before writing a disklabel, it should be checked for consistency, and acknowledge required for write if there are overlaps. 

Note that checking the consistency manually requires additions, as the display is in start/length notation, not in start/end notation. See also PR#5277

I marked the severity 'serious', because I think that it should not be so easy to create disklabels that lead to corrupted file systems.
>How-To-Repeat:
Just enter $ for the size of a partition if there is another one behind.

Or make partition 'a' of 500MB size, and let partition 'b' start at 200MB

>Fix:
Check partitions with a pocket calculator before writing. 

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.