[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24502: [PATCH] libparted: Show partition boundaries in sectors by de

From: Jack Waterworth
Subject: bug#24502: [PATCH] libparted: Show partition boundaries in sectors by default
Date: Mon, 17 Oct 2016 13:12:15 -0400

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:

address@hidden 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.


address@hidden 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 <address@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 <address@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.

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]