GNU bug report logs - #24502
[PATCH] libparted: Show partition boundaries in sectors by default

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: John Pittman <jpittman@HIDDEN>; Keywords: patch; dated Wed, 21 Sep 2016 19:36:02 UTC; Maintainer for parted is bug-parted@HIDDEN.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 17 Oct 2016 17:15:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 17 13:15:11 2016
Received: from localhost ([127.0.0.1]:37010 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bwBVG-0000GS-OG
	for submit <at> debbugs.gnu.org; Mon, 17 Oct 2016 13:15:11 -0400
Received: from mail-oi0-f48.google.com ([209.85.218.48]:33576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jwaterwo@HIDDEN>) id 1bwBSX-0000BF-A4
 for 24502 <at> debbugs.gnu.org; Mon, 17 Oct 2016 13:12:22 -0400
Received: by mail-oi0-f48.google.com with SMTP id y2so220626226oie.0
 for <24502 <at> debbugs.gnu.org>; Mon, 17 Oct 2016 10:12:21 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=yaEhErWdI7ZD891K5COMa0ATSuZGYFfZ4UlE8mVW+LQ=;
 b=XocBQlH9YnDesRnR1vHtrO0PTgzR+BPAx0Hq+qyTZtgkFXWnFwW6Cq7uoGC6cydqUr
 4nxuw8DdhrIlYfjRfMDwEt4mVHGVhel5BkYc6Bam3cQIq/p2MtmfvZIDGrYvXnwI6JgD
 5KCsch6ZHITsnyS6/MkN0ywbZZyteTIeIjcmkU/Z3tGrFCDS/6h4dnbc02TJmg0RpJ42
 pf8DiUgDLlGC451ZZhD0g1emyPvdS5GkyeUi8DTupKxpAjP7BnBX6Infqq9fMHenPbkN
 9VoBjzGlnQd0dWemRxgZ9rdYNKeR1e0vwriYA4u3ESY68C3CrEKrcksCWrmvWqHHxQop
 C4Uw==
X-Gm-Message-State: AA6/9RnL+yMpAcdTgTQi8kdf5l7y+TwwB2Y3SM1XZR6IcId+I9CbcUntGGFjjrRtQCu5ddREOnE6/y3TfFS12Ev/
X-Received: by 10.202.189.133 with SMTP id n127mr17794041oif.49.1476724335691; 
 Mon, 17 Oct 2016 10:12:15 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.157.29.201 with HTTP; Mon, 17 Oct 2016 10:12:15 -0700 (PDT)
In-Reply-To: <1272D4B6-3309-4FCD-A0E1-4AD0E8A6FAF3@HIDDEN>
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
 <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
 <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
 <53051e3a-900f-44b3-3b40-599fa4a4c28a@HIDDEN>
 <465428441.2173955.1476474232023.JavaMail.zimbra@HIDDEN>
 <1272D4B6-3309-4FCD-A0E1-4AD0E8A6FAF3@HIDDEN>
From: Jack Waterworth <jack@HIDDEN>
Date: Mon, 17 Oct 2016 13:12:15 -0400
Message-ID: <CA+BhE=48ZXYKCe0CDXgWoQpUTkSAA8owFoMqFWhA=F3t7A4CzA@HIDDEN>
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
To: Chris Johnson <cj@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113dd46475ea2a053f12adde
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 24502
X-Mailman-Approved-At: Mon, 17 Oct 2016 13:15:10 -0400
Cc: Phil Susi <psusi@HIDDEN>, djeffery@HIDDEN,
 John Pittman <jpittman@HIDDEN>, 24502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--001a113dd46475ea2a053f12adde
Content-Type: text/plain; charset=UTF-8

I think that instead of 'replacing' the standard human readable sized
output with sectors, perhaps we could add it as an additional field? or
perhaps have mixed output for the default view?  It is hard to see at a
glance what the sizes of the partitions are along with their outputs
without running multiple commands.

A major issue I usually see is that admins will attempt to 'save' the
layouts of their partitions by dumping the output of parted to a text
file.  When attempting to recover using this output, it becomes a challenge
to convert the units from GB/MB to sectors (due to issues like GB vs GiB)
not only from the partition perspective, but things that rely on this
information such as LVM and file-system superblock offsets.

Of course, this type of behavior can be prevented by educating the users of
parted, but the majority of admins do not use parted every single day and
do not understand the need to specify the right arguments to get the
correct output until its already too late.

Here is an example from my box:

-----------------------
[root@bulldozer images(keystone_admin)]# parted /dev/sda p
Model: ATA ST3160815AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  xfs          boot
 2      1075MB  70.0GB  68.9GB  primary
 3      70.0GB  134GB   64.4GB  primary
-----------------------

Is it not possible to specific sectors in the 'Start' and 'End' columns,
and leave 'Size' in GB? That would be a lot more useful to me.

example:

-----------------------
[root@bulldozer images(keystone_admin)]# parted /dev/sda p
## this output is a mockup
Model: ATA ST3160815AS (scsi)
Disk /dev/sda: 160GB 312500000s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start       End         Size      Type     File system  Flags
 1      2048s       2099199s    1074MB    primary  xfs          boot
 2      2099200s    136718335s  68.9GB    primary
 3      136718336s  262547455s  64.4GB    primary
-----------------------

then specify something like 'unit sec' in the parted command would print
everything in the requested unit.

On Sat, Oct 15, 2016 at 12:29 AM, Chris Johnson <cj@HIDDEN> wrote:

>
> I'm an admin who prefers details and exact info - I almost always work in
> sectors.
>
> > On Oct 14, 2016, at 3:43 PM, John Pittman <jpittman@HIDDEN> wrote:
> >
> > Hi Phil,
> >
> >> Kickstart isn't the typical intended user of parted, and if it wants
> >> sectors it can request them.
> >
> > I didn't claim it was, I was using it as an example to show that users
> don't necessarily
> > need the default print to be compact and likely won't even need to look
> at it at all.
> > Another and the best example of this, I suppose, would be parted's claim
> to fame,
> > the script function.  If you're running things from the command line ,or
> even more so, from
> > a script, users do not generally print after creation.
> >
> >> Yes, seeing the exact sectors is sometimes useful when troubleshooting,
> >> and you can easily request that, but most of the time people people
> >> don't need to be concerned with sectors and prefer to work in gb, which
> >> is why that is the default.  The lvm user interface also does not
> >> normally care about sectors.
> >
> > Seeing sectors is always useful, not sometimes.  It's GB or MB (more and
> more these days TB)
> > or any higher level measurement that is only sometimes useful.  And if
> I'm not mistaken,
> > lvm uses sector boundaries as a guide to writing it's labels/metadata.
> Higher level
> > measurements are only useful with creation and whole disk size printing.
> >
> >> How do you figure?  If I want a 10 gb root partition and a 100gb home
> >> partition, I tell parted to make a partition starting at 1m that is 10g
> >> long and another starting at 10g and is 100g long.  When I print the
> >> table to check what I have done, I expect to see 10g and 100g, not
> >> whatever that works out to in sectors.
> >
> > This is the one and only argument I could think of for keeping print at
> > default compact.  But the user can as easily add a 'u GB' or any other
> unit
> > as they can a 'u s'.
> >
> > Further, if a user comes to the parted tool to create, they will specify
> the unit in almost all
> > cases.  I have never seen, in my working with admins and the like, a
> case where they do not.
> > However, if they come to the parted tool using the print command, they
> are looking for
> > information for any number of reasons.  This information should be
> provided in the exact
> > form of sectors.  We should not choose for them how exact the
> information should be.  This
> > is very different than parted automatically choosing the alignment
> because there is no
> > inquiry into the partition structure by the user going on in that case.
> >
>
>


-- 
Thanks,
  Jack Waterworth, Red Hat Certified Architect
  Principal OpenStack Technical Support Engineer
  Red Hat Customer Experience and Engagement

--001a113dd46475ea2a053f12adde
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace">I think that instead of &#39;replacing&#39; the standard human=
 readable sized output with sectors, perhaps we could add it as an addition=
al field? or perhaps have mixed output for the default view?=C2=A0 It is ha=
rd to see at a glance what the sizes of the partitions are along with their=
 outputs without running multiple commands.</div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace,monospace"><br></div><div class=3D"gmail_=
default" style=3D"font-family:monospace,monospace">A major issue I usually =
see is that admins will attempt to &#39;save&#39; the layouts of their part=
itions by dumping the output of parted to a text file.=C2=A0 When attemptin=
g to recover using this output, it becomes a challenge to convert the units=
 from GB/MB to sectors (due to issues like GB vs GiB) not only from the par=
tition perspective, but things that rely on this information such as LVM an=
d file-system superblock offsets.</div><div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace"><br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace,monospace">Of course, this type of behavior=
 can be prevented by educating the users of parted, but the majority of adm=
ins do not use parted every single day and do not understand the need to sp=
ecify the right arguments to get the correct output until its already too l=
ate.</div><div class=3D"gmail_default" style=3D"font-family:monospace,monos=
pace"><br></div><div class=3D"gmail_default" style=3D"font-family:monospace=
,monospace">Here is an example from my box:</div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace,monospace"><br></div><div class=3D"gmail_=
default" style=3D"font-family:monospace,monospace">-----------------------<=
br></div><div class=3D"gmail_default"><div class=3D"gmail_default"><font fa=
ce=3D"monospace, monospace">[root@bulldozer images(keystone_admin)]# parted=
 /dev/sda p</font></div><div class=3D"gmail_default"><font face=3D"monospac=
e, monospace">Model: ATA ST3160815AS (scsi)</font></div><div class=3D"gmail=
_default"><font face=3D"monospace, monospace">Disk /dev/sda: 160GB</font></=
div><div class=3D"gmail_default"><font face=3D"monospace, monospace">Sector=
 size (logical/physical): 512B/512B</font></div><div class=3D"gmail_default=
"><font face=3D"monospace, monospace">Partition Table: msdos</font></div><d=
iv class=3D"gmail_default"><font face=3D"monospace, monospace">Disk Flags:=
=C2=A0</font></div><div class=3D"gmail_default"><font face=3D"monospace, mo=
nospace"><br></font></div><div class=3D"gmail_default"><font face=3D"monosp=
ace, monospace">Number =C2=A0Start =C2=A0 End =C2=A0 =C2=A0 Size =C2=A0 =C2=
=A0Type =C2=A0 =C2=A0 File system =C2=A0Flags</font></div><div class=3D"gma=
il_default"><font face=3D"monospace, monospace">=C2=A01 =C2=A0 =C2=A0 =C2=
=A01049kB =C2=A01075MB =C2=A01074MB =C2=A0primary =C2=A0xfs =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0boot</font></div><div class=3D"gmail_default"><font fac=
e=3D"monospace, monospace">=C2=A02 =C2=A0 =C2=A0 =C2=A01075MB =C2=A070.0GB =
=C2=A068.9GB =C2=A0primary</font></div><div class=3D"gmail_default"><font f=
ace=3D"monospace, monospace">=C2=A03 =C2=A0 =C2=A0 =C2=A070.0GB =C2=A0134GB=
 =C2=A0 64.4GB =C2=A0primary</font></div><div style=3D"font-family:monospac=
e,monospace">-----------------------<br></div><div style=3D"font-family:mon=
ospace,monospace"><br></div><div style=3D"font-family:monospace,monospace">=
Is it not possible to specific sectors in the &#39;Start&#39; and &#39;End&=
#39; columns, and leave &#39;Size&#39; in GB? That would be a lot more usef=
ul to me.</div><div style=3D"font-family:monospace,monospace"><br></div><di=
v style=3D"font-family:monospace,monospace">example:</div><div style=3D"fon=
t-family:monospace,monospace"><br></div><div style=3D"font-family:monospace=
,monospace"><div class=3D"gmail_default">-----------------------<br></div><=
div class=3D"gmail_default" style=3D"font-family:arial,sans-serif"><div cla=
ss=3D"gmail_default"><font face=3D"monospace, monospace">[root@bulldozer im=
ages(keystone_admin)]# parted /dev/sda p</font></div><div class=3D"gmail_de=
fault"><font face=3D"monospace, monospace">## this output is a mockup</font=
></div><div class=3D"gmail_default"><font face=3D"monospace, monospace">Mod=
el: ATA ST3160815AS (scsi)</font></div><div class=3D"gmail_default"><font f=
ace=3D"monospace, monospace"><div class=3D"gmail_default">Disk /dev/sda: 16=
0GB 312500000s</div></font></div><div class=3D"gmail_default"><font face=3D=
"monospace, monospace">Sector size (logical/physical): 512B/512B</font></di=
v><div class=3D"gmail_default"><font face=3D"monospace, monospace">Partitio=
n Table: msdos</font></div><div class=3D"gmail_default"><font face=3D"monos=
pace, monospace">Disk Flags:=C2=A0</font></div><div class=3D"gmail_default"=
><font face=3D"monospace, monospace"><br></font></div><div class=3D"gmail_d=
efault"><font face=3D"monospace, monospace"><div class=3D"gmail_default">Nu=
mber =C2=A0Start =C2=A0 =C2=A0 =C2=A0 End =C2=A0 =C2=A0 =C2=A0 =C2=A0 Size =
=C2=A0 =C2=A0 =C2=A0Type =C2=A0 =C2=A0 File system =C2=A0Flags</div><div cl=
ass=3D"gmail_default">=C2=A01 =C2=A0 =C2=A0 =C2=A02048s =C2=A0 =C2=A0 =C2=
=A0 2099199s =C2=A0 =C2=A01074MB =C2=A0 =C2=A0primary =C2=A0xfs =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0boot</div><div class=3D"gmail_default">=C2=A02 =C2=
=A0 =C2=A0 =C2=A02099200s =C2=A0 =C2=A0136718335s =C2=A068.9GB =C2=A0 =C2=
=A0primary</div><div class=3D"gmail_default">=C2=A03 =C2=A0 =C2=A0 =C2=A013=
6718336s =C2=A0262547455s =C2=A064.4GB =C2=A0 =C2=A0primary</div></font></d=
iv><div style=3D"font-family:monospace,monospace">-----------------------</=
div><div style=3D"font-family:monospace,monospace"><br></div><div style=3D"=
font-family:monospace,monospace">then specify something like &#39;unit sec&=
#39; in the parted command would print everything in the requested unit.</d=
iv></div></div></div></div><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote">On Sat, Oct 15, 2016 at 12:29 AM, Chris Johnson <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:cj@HIDDEN" target=3D"_blank">cj@HIDDEN</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I&#39;m an admin who prefers details and exact info - I almost always work =
in sectors.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
&gt; On Oct 14, 2016, at 3:43 PM, John Pittman &lt;<a href=3D"mailto:jpittm=
an@HIDDEN">jpittman@HIDDEN</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Phil,<br>
&gt;<br>
&gt;&gt; Kickstart isn&#39;t the typical intended user of parted, and if it=
 wants<br>
&gt;&gt; sectors it can request them.<br>
&gt;<br>
&gt; I didn&#39;t claim it was, I was using it as an example to show that u=
sers don&#39;t necessarily<br>
&gt; need the default print to be compact and likely won&#39;t even need to=
 look at it at all.<br>
&gt; Another and the best example of this, I suppose, would be parted&#39;s=
 claim to fame,<br>
&gt; the script function.=C2=A0 If you&#39;re running things from the comma=
nd line ,or even more so, from<br>
&gt; a script, users do not generally print after creation.<br>
&gt;<br>
&gt;&gt; Yes, seeing the exact sectors is sometimes useful when troubleshoo=
ting,<br>
&gt;&gt; and you can easily request that, but most of the time people peopl=
e<br>
&gt;&gt; don&#39;t need to be concerned with sectors and prefer to work in =
gb, which<br>
&gt;&gt; is why that is the default.=C2=A0 The lvm user interface also does=
 not<br>
&gt;&gt; normally care about sectors.<br>
&gt;<br>
&gt; Seeing sectors is always useful, not sometimes.=C2=A0 It&#39;s GB or M=
B (more and more these days TB)<br>
&gt; or any higher level measurement that is only sometimes useful.=C2=A0 A=
nd if I&#39;m not mistaken,<br>
&gt; lvm uses sector boundaries as a guide to writing it&#39;s labels/metad=
ata.=C2=A0 Higher level<br>
&gt; measurements are only useful with creation and whole disk size printin=
g.<br>
&gt;<br>
&gt;&gt; How do you figure?=C2=A0 If I want a 10 gb root partition and a 10=
0gb home<br>
&gt;&gt; partition, I tell parted to make a partition starting at 1m that i=
s 10g<br>
&gt;&gt; long and another starting at 10g and is 100g long.=C2=A0 When I pr=
int the<br>
&gt;&gt; table to check what I have done, I expect to see 10g and 100g, not=
<br>
&gt;&gt; whatever that works out to in sectors.<br>
&gt;<br>
&gt; This is the one and only argument I could think of for keeping print a=
t<br>
&gt; default compact.=C2=A0 But the user can as easily add a &#39;u GB&#39;=
 or any other unit<br>
&gt; as they can a &#39;u s&#39;.<br>
&gt;<br>
&gt; Further, if a user comes to the parted tool to create, they will speci=
fy the unit in almost all<br>
&gt; cases.=C2=A0 I have never seen, in my working with admins and the like=
, a case where they do not.<br>
&gt; However, if they come to the parted tool using the print command, they=
 are looking for<br>
&gt; information for any number of reasons.=C2=A0 This information should b=
e provided in the exact<br>
&gt; form of sectors.=C2=A0 We should not choose for them how exact the inf=
ormation should be.=C2=A0 This<br>
&gt; is very different than parted automatically choosing the alignment bec=
ause there is no<br>
&gt; inquiry into the partition structure by the user going on in that case=
.<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=
=3D"ltr"><div><font face=3D"monospace, monospace">Thanks,</font></div><div>=
<font face=3D"monospace, monospace">=C2=A0 Jack Waterworth, Red Hat Certifi=
ed Architect</font></div><div><font face=3D"monospace, monospace">=C2=A0 Pr=
incipal OpenStack Technical Support Engineer</font></div><div><font face=3D=
"monospace, monospace">=C2=A0 Red Hat Customer Experience and Engagement</f=
ont></div></div></div>
</div>

--001a113dd46475ea2a053f12adde--




Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 15 Oct 2016 06:00:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 15 02:00:17 2016
Received: from localhost ([127.0.0.1]:57673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bvI13-0001im-Dq
	for submit <at> debbugs.gnu.org; Sat, 15 Oct 2016 02:00:17 -0400
Received: from mout.perfora.net ([74.208.4.197]:49658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cj@HIDDEN>) id 1bvGbD-0007MI-CJ
 for 24502 <at> debbugs.gnu.org; Sat, 15 Oct 2016 00:29:31 -0400
Received: from [100.66.147.120] ([70.198.70.58]) by mrelay.perfora.net
 (mreueus001) with ESMTPSA (Nemesis) id 0LqBsM-1cYi0k0TTM-00dm0R; Sat, 15 Oct
 2016 06:29:18 +0200
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (1.0)
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
From: Chris Johnson <cj@HIDDEN>
X-Mailer: iPhone Mail (13G36)
In-Reply-To: <465428441.2173955.1476474232023.JavaMail.zimbra@HIDDEN>
Date: Sat, 15 Oct 2016 00:29:12 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <1272D4B6-3309-4FCD-A0E1-4AD0E8A6FAF3@HIDDEN>
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
 <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
 <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
 <53051e3a-900f-44b3-3b40-599fa4a4c28a@HIDDEN>
 <465428441.2173955.1476474232023.JavaMail.zimbra@HIDDEN>
To: John Pittman <jpittman@HIDDEN>
X-Provags-ID: V03:K0:tAOFjli70p5VsdfIWjlUU2Ne31GdNWUSIZnvsvNlsUMFioIMSs3
 NOQMLA8vjhbAOmX3S0m8J9OEOIf+hxfU7FXoUhVXaC8gQLfgGDoy7qchQFMTq6w231Efl57
 +Ze3jM7M2R3/lidq5c9jVWKCYhPg4+LjtfDlKywGVV/YQDpZwrzbbloDHa6gok34w4RpFf2
 O0kn+GoTZipQaKDAqKhfg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:KsovaZSa0hI=:olBvD5dJp67FymYEtyDCq7
 cHLUJQmzWfAHUbBia68HCLDtd64we7Oza8ilSFf2qCxA7y1r5vv1cMKdkNVo52Y6TlyEM3a5L
 FNdbWrYhBHu3gEdREclY3SBNkGC8YBm+7NMbJo+S8OGP8wUCBCbNzBT4vO7TfLaIZgyVW9Tij
 1ls28OBkiX8Gwoa5vvbV8C46KTruvE2hR5VAzXOt/pqIwcYJBMp1hyVY3ogEReBrPQjkH/ZQT
 jiZTBRfbLOPuVP4sBKgeY8tIYBi7uMpy9CMevjioHh5skeYsmJqs/ZekjlipBTEOnzWtHh5ip
 FQelge8lvoHCSruwUPOgHzF0MRBWU8bqW6zZxWqR1LLqqmJCPlh1/XJjadEcUt+nNZTNmnqsc
 lM28UKlz9nJ3/HW51IGSk1WkPmHkusgnn9SIByw3MIRYHtGilWVr4590Pdayp+r0uZolSdOVz
 GKUWmhnKQJ/f6GQ9HAdSQ2qtbIUTz0QmyNMlRmBkFDZC9rR6TD8aCxqoG0vDDo8He8K3iNbmw
 RN5HfaCraEAFJ9IZVW+LQiJ2w8PJ3AlO1/rPh9BEg0dwl8F65WCMDWVKRpbyng0h8wsLijSi/
 gsyU6VMSaG1h+BP9wj4ZootVY9x07suqdZvT+XtBo/R0Wd7dh+4z1/CoQDlgYLOuEcMrqkLBG
 KdizHdxpmtVzXWFu7M4DbvaDFEtmLccvK2kZKy6V4Cu6mPLUca4kPVHbKYTR56SC6TKnV8xO2
 kHVJ9TSvbOPMxQoC
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 24502
X-Mailman-Approved-At: Sat, 15 Oct 2016 02:00:16 -0400
Cc: Phil Susi <psusi@HIDDEN>, jwaterwo@HIDDEN, djeffery@HIDDEN,
 24502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)


I'm an admin who prefers details and exact info - I almost always work in se=
ctors. =20

> On Oct 14, 2016, at 3:43 PM, John Pittman <jpittman@HIDDEN> wrote:
>=20
> Hi Phil,
>=20
>> Kickstart isn't the typical intended user of parted, and if it wants
>> sectors it can request them.
>=20
> I didn't claim it was, I was using it as an example to show that users don=
't necessarily=20
> need the default print to be compact and likely won't even need to look at=
 it at all.
> Another and the best example of this, I suppose, would be parted's claim t=
o fame,=20
> the script function.  If you're running things from the command line ,or e=
ven more so, from=20
> a script, users do not generally print after creation.
>=20
>> Yes, seeing the exact sectors is sometimes useful when troubleshooting,
>> and you can easily request that, but most of the time people people
>> don't need to be concerned with sectors and prefer to work in gb, which
>> is why that is the default.  The lvm user interface also does not
>> normally care about sectors.
>=20
> Seeing sectors is always useful, not sometimes.  It's GB or MB (more and m=
ore these days TB)=20
> or any higher level measurement that is only sometimes useful.  And if I'm=
 not mistaken,=20
> lvm uses sector boundaries as a guide to writing it's labels/metadata.  Hi=
gher level=20
> measurements are only useful with creation and whole disk size printing.
>=20
>> How do you figure?  If I want a 10 gb root partition and a 100gb home
>> partition, I tell parted to make a partition starting at 1m that is 10g
>> long and another starting at 10g and is 100g long.  When I print the
>> table to check what I have done, I expect to see 10g and 100g, not
>> whatever that works out to in sectors.
>=20
> This is the one and only argument I could think of for keeping print at=20=

> default compact.  But the user can as easily add a 'u GB' or any other uni=
t
> as they can a 'u s'.
>=20
> Further, if a user comes to the parted tool to create, they will specify t=
he unit in almost all
> cases.  I have never seen, in my working with admins and the like, a case w=
here they do not.
> However, if they come to the parted tool using the print command, they are=
 looking for=20
> information for any number of reasons.  This information should be provide=
d in the exact
> form of sectors.  We should not choose for them how exact the information s=
hould be.  This
> is very different than parted automatically choosing the alignment because=
 there is no=20
> inquiry into the partition structure by the user going on in that case.
>=20





Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 14 Oct 2016 19:44:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 15:44:01 2016
Received: from localhost ([127.0.0.1]:55681 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bv8Of-0001ke-B0
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 15:44:01 -0400
Received: from mx3-phx2.redhat.com ([209.132.183.24]:35005)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jpittman@HIDDEN>) id 1bv8Od-0001k9-2W
 for 24502 <at> debbugs.gnu.org; Fri, 14 Oct 2016 15:43:59 -0400
Received: from zmail10.collab.prod.int.phx2.redhat.com
 (zmail10.collab.prod.int.phx2.redhat.com [10.5.83.12])
 by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9EJhqcX007334;
 Fri, 14 Oct 2016 15:43:52 -0400
Date: Fri, 14 Oct 2016 15:43:52 -0400 (EDT)
From: John Pittman <jpittman@HIDDEN>
To: Phil Susi <psusi@HIDDEN>
Message-ID: <465428441.2173955.1476474232023.JavaMail.zimbra@HIDDEN>
In-Reply-To: <53051e3a-900f-44b3-3b40-599fa4a4c28a@HIDDEN>
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
 <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
 <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
 <53051e3a-900f-44b3-3b40-599fa4a4c28a@HIDDEN>
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.10.58.33]
X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF49 (Linux)/8.0.6_GA_5922)
Thread-Topic: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
Thread-Index: 40FplcP2R7AZJAHjtJwkh/UQ8MYzVA==
X-Spam-Score: -5.4 (-----)
X-Debbugs-Envelope-To: 24502
Cc: jwaterwo@HIDDEN, djeffery@HIDDEN, 24502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.4 (-----)

Hi Phil,

> Kickstart isn't the typical intended user of parted, and if it wants
> sectors it can request them.

I didn't claim it was, I was using it as an example to show that users don't necessarily 
need the default print to be compact and likely won't even need to look at it at all.
Another and the best example of this, I suppose, would be parted's claim to fame, 
the script function.  If you're running things from the command line ,or even more so, from 
a script, users do not generally print after creation.

>Yes, seeing the exact sectors is sometimes useful when troubleshooting,
>and you can easily request that, but most of the time people people
>don't need to be concerned with sectors and prefer to work in gb, which
>is why that is the default.  The lvm user interface also does not
>normally care about sectors.

Seeing sectors is always useful, not sometimes.  It's GB or MB (more and more these days TB) 
or any higher level measurement that is only sometimes useful.  And if I'm not mistaken, 
lvm uses sector boundaries as a guide to writing it's labels/metadata.  Higher level 
measurements are only useful with creation and whole disk size printing.

>How do you figure?  If I want a 10 gb root partition and a 100gb home
>partition, I tell parted to make a partition starting at 1m that is 10g
>long and another starting at 10g and is 100g long.  When I print the
>table to check what I have done, I expect to see 10g and 100g, not
>whatever that works out to in sectors.

This is the one and only argument I could think of for keeping print at 
default compact.  But the user can as easily add a 'u GB' or any other unit
as they can a 'u s'.

Further, if a user comes to the parted tool to create, they will specify the unit in almost all
cases.  I have never seen, in my working with admins and the like, a case where they do not.
However, if they come to the parted tool using the print command, they are looking for 
information for any number of reasons.  This information should be provided in the exact
form of sectors.  We should not choose for them how exact the information should be.  This
is very different than parted automatically choosing the alignment because there is no 
inquiry into the partition structure by the user going on in that case.

> fdisk has always had a poor user interface.  One of the design goals of
> parted is to be more user friendly.

Then why do people cling to fdisk like grim death?  Sure it's ingrained behavior, but 
it can't be that bad with such a following.  And the new function in fdisk, along with 
it being something we've talked about in my group for a long while, is the motivation 
behind this patch.  For the record I and my colleagues preach parted use.  That's why 
I'm here. :)

> Parted should automatically handle alignment without you needing to do
> it manually.

I'm not saying it shouldn't.  This is regarding printing, not creation and auto align.

> By correct I assume you are again referring to alignment, which again,
> you shouldn't need to worry about.

By correct I meant in the correct spot in regards to whatever you were fixing.  In regards
to this, the fix should be as exact as the original layout, which is in sectors.  If I lost
a surrounded partition from 745G to 1.2T, I would not feel comfortable just laying out a partition
by specifying those values and we should not expect users to either.  I would however feel 
comfortable laying out the partition in s.  This comes back to the user needing information 
outside of 'did my initial creation do what i thought'.

>I disagree.  A good tool should free you from needing to do mind numbing
>calculations and worry about the minutia and just do the right thing for
>you.

We're talking about admins and other power users here, not novices.  Additionally, by and large, 
linux users are more adept to this type of material than users of other operating systems.  These 
people know well enough what they're doing to use  this type of information to their advantage, 
and as I mentioned earlier the parted -l would allow an easier exchange of detailed information between users.

I know this seems like a big change as it is very front-facing, and it seems to go against a lot of work 
that has been done, but in reality it doesn't.  It is just an adjustment that aligns more closely with the
basic difference of what is needed during an initial partition creation and what is needed on a day to 
day analysis basis by users. Compact just is not as useful in the print function as sectors.




Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 14 Oct 2016 16:50:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 12:50:54 2016
Received: from localhost ([127.0.0.1]:55458 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bv5h8-00061G-D2
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 12:50:54 -0400
Received: from mail-vk0-f50.google.com ([209.85.213.50]:34543)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillsusi@HIDDEN>) id 1bv5h7-000613-5S
 for 24502 <at> debbugs.gnu.org; Fri, 14 Oct 2016 12:50:53 -0400
Received: by mail-vk0-f50.google.com with SMTP id b186so121090339vkb.1
 for <24502 <at> debbugs.gnu.org>; Fri, 14 Oct 2016 09:50:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:cc:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=V/y7bi+0F3wN3OE812ZE4JqwcRV05QiLUpalcywxCOY=;
 b=GVK/jcI7Du+nLu34c4qNIfoQEq2cMJOXiJuu7WwCqD8Nlst2SbYBQJO/2JAJndmnRo
 7YdQD/+yWsrNKXJKxHJk+2VmjAGmSx4AI3CG+g7Eln/EjPPuZ4228WevVDDclfo7iGU7
 gQlsa/+5qdSmLfFqLQiGlT4PK2OtTtSgnMQEM6NqZYrercAz5fVYTd2/shK0MNYypjby
 KJkr4mVr3g22zUsNba3/wsHXZRmvqGwNnQotkxNgtW0a/yUeVGKyZU5OA4a/RjcQ6sHE
 iA6Q/R54GMhejcn2nkauDcLU5/+tDoKKeZiX0tBhTqVld4SAI2GfJE7OOqzF7iGx5KJK
 4nPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:subject:to:references:cc:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=V/y7bi+0F3wN3OE812ZE4JqwcRV05QiLUpalcywxCOY=;
 b=lVewcaLAVzBL5TxCkoWDzH5tEomcZ3yaIas066QXESjPUbuU+70sKFPbCjnfxApAAI
 v/oCQkt3zFdbYSgOwaKYDhIkEyGzqG3I4kA+BIXjE9WuQRTLzLRkS6sE39fr5ed3b+4i
 yvteKZ2jr98s5TJtyJUaQdnTidXmYDpsn+yfMWvrzRUKJkqcynF+k0ybHF7sH9kRRnte
 jkH6rGkd8+aRgZZMCANM4hPkTmMtCiR55KIjyokVNrMAdhAI/Gr2g8lUCzwUGeU+fu3B
 xp6IW+MWCNMegrsN8K7aqlCcPvjq5mOi2KlGZ6vSj2ggX22Zi0VgGnKZT3k0fbCvJmMd
 Brzw==
X-Gm-Message-State: AA6/9RkqxJllqEAOxhlV24PtO3sYJVjiHbTt9hw1HLT2j2b1lhd8Y66H8FX2vT3VBGNifg==
X-Received: by 10.31.81.135 with SMTP id f129mr8113256vkb.162.1476463847555;
 Fri, 14 Oct 2016 09:50:47 -0700 (PDT)
Received: from [10.1.1.184] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12])
 by smtp.googlemail.com with ESMTPSA id
 o12sm7805341vka.19.2016.10.14.09.50.46
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 14 Oct 2016 09:50:47 -0700 (PDT)
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
To: John Pittman <jpittman@HIDDEN>
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
 <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
 <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
From: Phil Susi <psusi@HIDDEN>
Message-ID: <53051e3a-900f-44b3-3b40-599fa4a4c28a@HIDDEN>
Date: Fri, 14 Oct 2016 12:52:00 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 24502
Cc: jwaterwo@HIDDEN, djeffery@HIDDEN, 24502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 10/14/2016 10:25 AM, John Pittman wrote:
> At initial creation people will still use whatever unit they care about,
> whether it be GB, MB, or TB (or sectors).  But they'll be specifying the units by hand. 
> Likely not even using the print function until the end and possibly not at all (creation
> done through kickstart)

Kickstart isn't the typical intended user of parted, and if it wants
sectors it can request them.

> This patch is not about creating however, it's about printing, which indicates a need
> to "look back" at the partition structure.  Whether admins are troubleshooting performance, 
> a missing partition, a misaligned partition, the need will be to make adjustments in sectors, 
> therefore the need will be to view the boundaries in sectors.  The operating system and the 
> software layers atop it (clustering & lvm for example) care about sectors and so should we.

Yes, seeing the exact sectors is sometimes useful when troubleshooting,
and you can easily request that, but most of the time people people
don't need to be concerned with sectors and prefer to work in gb, which
is why that is the default.  The lvm user interface also does not
normally care about sectors.

> To have the precursory knowledge to know that one needs to manipulate a partition boundary 
> also suggest the knowledge to know that the manipulation should be done in sectors.  All
> else will bring unexpected results.  The majority of users of this tool are administrators
> for servers, not desktop users (desktop users would likey use a gui tool)

How do you figure?  If I want a 10 gb root partition and a 100gb home
partition, I tell parted to make a partition starting at 1m that is 10g
long and another starting at 10g and is 100g long.  When I print the
table to check what I have done, I expect to see 10g and 100g, not
whatever that works out to in sectors.

> The latest fdisk packages print in sectors by default.  They do however, similar

fdisk has always had a poor user interface.  One of the design goals of
parted is to be more user friendly.

> to my patch proposal, provide the whole disk size in B, s, and some other user
> friendly unit.  My colleagues and I are all in linux storage support/maintenance
> engineering; my claims regarding alignment with the needs of administration are based on 
> direct observation of everyday administration issues as seen by our customers.

Parted should automatically handle alignment without you needing to do
it manually.

> I'd argue the opposite, if someone is thinking about partition boundaries, they 
> would not be thinking about what MB boundary it falls on, at least not for long.
> They'd realize quickly that they need sectors to have any certainty that the 
> changes they are making are correct.

By correct I assume you are again referring to alignment, which again,
you shouldn't need to worry about.

> For whole disk size the compact print is great, that's why I've included it in the patch, 
> but for boundary location printing, sectors should be used are are far more useful.
> 
> Additionally, we should, as people providing/supporting these products/services promote 
> sector use, not steer users away from it.

I disagree.  A good tool should free you from needing to do mind numbing
calculations and worry about the minutia and just do the right thing for
you.





Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 14 Oct 2016 14:25:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 10:25:46 2016
Received: from localhost ([127.0.0.1]:55390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bv3Qc-0002bF-AB
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 10:25:46 -0400
Received: from mx6-phx2.redhat.com ([209.132.183.39]:34271)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jpittman@HIDDEN>) id 1bv3QW-0002b0-F2
 for 24502 <at> debbugs.gnu.org; Fri, 14 Oct 2016 10:25:40 -0400
Received: from zmail10.collab.prod.int.phx2.redhat.com
 (zmail10.collab.prod.int.phx2.redhat.com [10.5.83.12])
 by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9EEPXKQ010890;
 Fri, 14 Oct 2016 10:25:33 -0400
Date: Fri, 14 Oct 2016 10:25:33 -0400 (EDT)
From: John Pittman <jpittman@HIDDEN>
To: Phil Susi <psusi@HIDDEN>
Message-ID: <921828480.2128632.1476455133637.JavaMail.zimbra@HIDDEN>
In-Reply-To: <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
 <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.10.58.33]
X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF49 (Linux)/8.0.6_GA_5922)
Thread-Topic: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
Thread-Index: kT4aWGj9Y7pmzJheIMqdsMzCeMnbUQ==
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: 24502
Cc: jwaterwo@HIDDEN, djeffery@HIDDEN, 24502 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

----- Original Message -----
From: "Phil Susi" <psusi@HIDDEN>
To: "John Pittman" <jpittman@HIDDEN>, 24502 <at> debbugs.gnu.org
Cc: jwaterwo@HIDDEN, djeffery@HIDDEN
Sent: Friday, October 14, 2016 9:18:31 AM
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in sectors by default

On 9/21/2016 3:22 PM, John Pittman wrote:
> In parted, by default, we print disk size and partition
> boundaries in compact form.  As partition boundaries fall
> on sector boundaries, this is not useful for administration
> and should be changed.  This patch changes the default_unit

>> No?  People don't care about the exact sector; they think in GB.

At initial creation people will still use whatever unit they care about,
whether it be GB, MB, or TB (or sectors).  But they'll be specifying the units by hand. 
Likely not even using the print function until the end and possibly not at all (creation
done through kickstart)

This patch is not about creating however, it's about printing, which indicates a need
to "look back" at the partition structure.  Whether admins are troubleshooting performance, 
a missing partition, a misaligned partition, the need will be to make adjustments in sectors, 
therefore the need will be to view the boundaries in sectors.  The operating system and the 
software layers atop it (clustering & lvm for example) care about sectors and so should we.

To have the precursory knowledge to know that one needs to manipulate a partition boundary 
also suggest the knowledge to know that the manipulation should be done in sectors.  All
else will bring unexpected results.  The majority of users of this tool are administrators
for servers, not desktop users (desktop users would likey use a gui tool)

> Many partition tools have already migrated to default sector
> use. It offers a 'one-stop-shop' through parted -l, and
> aligns more closely with the needs of partition
> administration activities.

>> How do you figure that?

The latest fdisk packages print in sectors by default.  They do however, similar
to my patch proposal, provide the whole disk size in B, s, and some other user
friendly unit.  My colleagues and I are all in linux storage support/maintenance
engineering; my claims regarding alignment with the needs of administration are based on 
direct observation of everyday administration issues as seen by our customers.

>> Nobody thinks about what sector they want the partition to start and end on.

I'd argue the opposite, if someone is thinking about partition boundaries, they 
would not be thinking about what MB boundary it falls on, at least not for long.
They'd realize quickly that they need sectors to have any certainty that the 
changes they are making are correct.

For whole disk size the compact print is great, that's why I've included it in the patch, 
but for boundary location printing, sectors should be used are are far more useful.

Additionally, we should, as people providing/supporting these products/services promote 
sector use, not steer users away from it.





Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at 24502 <at> debbugs.gnu.org:


Received: (at 24502) by debbugs.gnu.org; 14 Oct 2016 13:17:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 09:17:25 2016
Received: from localhost ([127.0.0.1]:54898 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bv2MX-0000ur-LY
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 09:17:25 -0400
Received: from mail-vk0-f54.google.com ([209.85.213.54]:35192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillsusi@HIDDEN>) id 1bv2MV-0000uY-KZ
 for 24502 <at> debbugs.gnu.org; Fri, 14 Oct 2016 09:17:23 -0400
Received: by mail-vk0-f54.google.com with SMTP id q126so60545820vkd.2
 for <24502 <at> debbugs.gnu.org>; Fri, 14 Oct 2016 06:17:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:cc:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=39QxEv3ozgYlF82+M3loLmUSVtUtYKeTzhCq8FwKm/k=;
 b=iMAzC5hKhw0+4PEl3pXgz8l46fM2k0uVPt3IaIp4JGbvbRVRrj31lkLHmAsBWRj5cD
 nZwFp9IqXg+2jyv8NnXwTxqu6sOhRIxJ+KE/c12B2z6x5oyDZw0lASJQNZAgaKaRJaO7
 +Tcqs/45aT7puMMsAuz64ffqHSI8/yARdGv+yBSc2wjJEC2P6hw5nBm7HtmsjGMDHrsp
 TOJvX/a2IKnHh1+JbwkyOPhxKUP5TAtNs0yQXhfaixZ/DcrHmTlo9P2d/IrKUfdd3d0N
 NeFXlhR4aU4YnarSL1Kp8zSFE5RWVEChvVUnhMUtgkz+skecb0I2DbcLqDPX53z1b0ll
 e7+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:subject:to:references:cc:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=39QxEv3ozgYlF82+M3loLmUSVtUtYKeTzhCq8FwKm/k=;
 b=bJixixi90HKeJ7Kdl3hOzzYxbo/K6BElLnR4ujmTB6ogYo8Sl+agK8fCyY0ayI5djA
 P0ln2Ru5tqVVJmtFMCcGgWND4ib+Ujw/YIL2WrtClXZqLYQ1z2d1qW2TXTb5wRnb01Ca
 gv7sE/GuaUL+ZRNnz2UIkuUNjY2sHB3vh9jmEJal9aaRSOu9pW3RdkBO3auzCNsVow6a
 HVENzbWFkQOtRgbQdlUYHJyeNnM2NNJMb3/iiY5ADlAf03g1l4P8/5VUBR9bShj+eRoU
 ejsu4e8al+JmR4DtZn+PUr9VzmClGQWM//zXF5kHS/Ma0oHfVIpF+s6GURDDuKCUN7ZC
 6Zwg==
X-Gm-Message-State: AA6/9Rm4GY5TK28pc2BxgAFVD9GXPJl606L0OnOAC6Yf4qQ4rKfXr4Fz6q5yfOgwUgPLpQ==
X-Received: by 10.31.153.17 with SMTP id b17mr8777023vke.84.1476451038261;
 Fri, 14 Oct 2016 06:17:18 -0700 (PDT)
Received: from [10.1.1.184] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12])
 by smtp.googlemail.com with ESMTPSA id
 p6sm7409506vkf.22.2016.10.14.06.17.17
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 14 Oct 2016 06:17:17 -0700 (PDT)
Subject: Re: bug#24502: [PATCH] libparted: Show partition boundaries in
 sectors by default
To: John Pittman <jpittman@HIDDEN>, 24502 <at> debbugs.gnu.org
References: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
From: Phil Susi <psusi@HIDDEN>
Message-ID: <5cbfbfbe-dc40-6547-ed06-1079771b31ff@HIDDEN>
Date: Fri, 14 Oct 2016 09:18:31 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 24502
Cc: jwaterwo@HIDDEN, djeffery@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

On 9/21/2016 3:22 PM, John Pittman wrote:
> In parted, by default, we print disk size and partition
> boundaries in compact form.  As partition boundaries fall
> on sector boundaries, this is not useful for administration
> and should be changed.  This patch changes the default_unit

No?  People don't care about the exact sector; they think in GB.

> Many partition tools have already migrated to default sector
> use. It offers a 'one-stop-shop' through parted -l, and
> aligns more closely with the needs of partition
> administration activities.

How do you figure that?  Nobody thinks about what sector they want the
partition to start and end on.






Information forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Sep 2016 19:35:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 15:35:05 2016
Received: from localhost ([127.0.0.1]:59953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bmnIP-0003YE-35
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2016 15:35:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59770)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6Z-0003C5-5c
 for submit <at> debbugs.gnu.org; Wed, 21 Sep 2016 15:22:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6Q-0007ZH-7C
 for submit <at> debbugs.gnu.org; Wed, 21 Sep 2016 15:22:46 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56754)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6Q-0007Z6-4x
 for submit <at> debbugs.gnu.org; Wed, 21 Sep 2016 15:22:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50714)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6O-0004lE-JD
 for bug-parted@HIDDEN; Wed, 21 Sep 2016 15:22:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6N-0007Xl-DE
 for bug-parted@HIDDEN; Wed, 21 Sep 2016 15:22:40 -0400
Received: from mx1.redhat.com ([209.132.183.28]:50170)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jpittman@HIDDEN>) id 1bmn6N-0007X4-4C
 for bug-parted@HIDDEN; Wed, 21 Sep 2016 15:22:39 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
 (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id DF532C04B93F
 for <bug-parted@HIDDEN>; Wed, 21 Sep 2016 19:22:37 +0000 (UTC)
Received: from dhcp145-120.rdu.redhat.com.com (vpn-57-98.rdu2.redhat.com
 [10.10.57.98])
 by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 u8LJMZtg025647
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Wed, 21 Sep 2016 15:22:37 -0400
From: John Pittman <jpittman@HIDDEN>
To: bug-parted@HIDDEN
Subject: [PATCH] libparted: Show partition boundaries in sectors by default
Date: Wed, 21 Sep 2016 15:22:28 -0400
Message-Id: <1474485748-2675-1-git-send-email-jpittman@HIDDEN>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.31]); Wed, 21 Sep 2016 19:22:38 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 21 Sep 2016 15:35:04 -0400
Cc: jwaterwo@HIDDEN, bcl@HIDDEN, djeffery@HIDDEN,
 jpittman@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)

In parted, by default, we print disk size and partition
boundaries in compact form.  As partition boundaries fall
on sector boundaries, this is not useful for administration
and should be changed.  This patch changes the default_unit
to sectors and adjusts the content of _print_disk_info.
PedUnit, uf_unit (user friendly unit), is used to adjust the
output dependent on the default unit chosen from the
command line.

The full disk size will be shown in both sectors and
compact for convenience, while the partition boundaries
will only be shown in sectors.  Partition boundary unit and
full disk default compact output will still be changeable via
the 'u' option on the command line, but full disk sector
output will not.

Many partition tools have already migrated to default sector
use. It offers a 'one-stop-shop' through parted -l, and
aligns more closely with the needs of partition
administration activities.

Signed-off-by: John Pittman <jpittman@HIDDEN>
---
 libparted/unit.c |  2 +-
 parted/parted.c  | 36 ++++++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/libparted/unit.c b/libparted/unit.c
index e545985..c167464 100644
--- a/libparted/unit.c
+++ b/libparted/unit.c
@@ -67,7 +67,7 @@
 #endif /* ENABLE_NLS */
 
 
-static PedUnit default_unit = PED_UNIT_COMPACT;
+static PedUnit default_unit = PED_UNIT_SECTOR;
 static const char* unit_names[] = {
 	"s",
 	"B",
diff --git a/parted/parted.c b/parted/parted.c
index b20d432..682451d 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -711,12 +711,19 @@ do_mkpart (PedDevice** dev)
                 if (!added_ok)
                         goto error_remove_part;
 
+                PedUnit default_unit = ped_unit_get_default (), uf_unit;
+
+                if (default_unit == PED_UNIT_SECTOR)
+                        uf_unit = PED_UNIT_COMPACT;
+                else
+                        uf_unit = default_unit;
+
                 if (!ped_geometry_test_sector_inside(range_start, part->geom.start) ||
                     !ped_geometry_test_sector_inside(range_end, part->geom.end)) {
-                        start_usr = ped_unit_format (*dev, start);
-                        end_usr   = ped_unit_format (*dev, end);
-                        start_sol = ped_unit_format (*dev, part->geom.start);
-                        end_sol   = ped_unit_format (*dev, part->geom.end);
+                        start_usr = ped_unit_format_custom (*dev, start, uf_unit);
+                        end_usr   = ped_unit_format_custom (*dev, end, uf_unit);
+                        start_sol = ped_unit_format_custom (*dev, part->geom.start, uf_unit);
+                        end_sol   = ped_unit_format_custom (*dev, part->geom.end, uf_unit);
 
                         /* In script mode failure to use specified values is fatal.
                          * However, in interactive mode, it merely elicits a warning
@@ -950,10 +957,18 @@ _print_disk_info (const PedDevice *dev, const PedDisk *disk)
                                          "md", "loopback"};
 
         char* start = ped_unit_format (dev, 0);
-        PedUnit default_unit = ped_unit_get_default ();
-        char* end = ped_unit_format_byte (dev, dev->length * dev->sector_size
+        PedUnit default_unit = ped_unit_get_default (), uf_unit;
+
+        if (default_unit == PED_UNIT_SECTOR)
+                uf_unit = PED_UNIT_COMPACT;
+        else
+                uf_unit = default_unit;
+
+        char* end = ped_unit_format_custom_byte (dev, dev->length * dev->sector_size
                                     - (default_unit == PED_UNIT_CHS ||
-                                       default_unit == PED_UNIT_CYLINDER));
+                                       default_unit == PED_UNIT_CYLINDER), uf_unit);
+        char* end_sect = ped_unit_format_custom_byte (dev, dev->length * dev->sector_size,
+                                                                 PED_UNIT_SECTOR);
 
         const char* pt_name = disk ? disk->type->name : "unknown";
         char *disk_flags = disk_print_flags (disk);
@@ -968,20 +983,21 @@ _print_disk_info (const PedDevice *dev, const PedDisk *disk)
                                         break;
 
             }
-            printf ("%s:%s:%s:%lld:%lld:%s:%s:%s;\n",
-                    dev->path, end, transport[dev->type],
+            printf ("%s:%s:%s:%s:%lld:%lld:%s:%s:%s;\n",
+                    dev->path, end, end_sect, transport[dev->type],
                     dev->sector_size, dev->phys_sector_size,
                     pt_name, dev->model, disk_flags);
         } else {
             printf (_("Model: %s (%s)\n"),
                     dev->model, transport[dev->type]);
-            printf (_("Disk %s: %s\n"), dev->path, end);
+            printf (_("Disk %s: %s: %s\n"), dev->path, end, end_sect);
             printf (_("Sector size (logical/physical): %lldB/%lldB\n"),
                     dev->sector_size, dev->phys_sector_size);
         }
 
         free (start);
         free (end);
+	free (end_sect);
 
         if (ped_unit_get_default () == PED_UNIT_CHS
             || ped_unit_get_default () == PED_UNIT_CYLINDER)
-- 
2.5.5





Acknowledgement sent to John Pittman <jpittman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#24502; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.