[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19836: Missing partition type in machine parseable output
From: |
Brian C. Lane |
Subject: |
bug#19836: Missing partition type in machine parseable output |
Date: |
Thu, 12 Feb 2015 09:53:44 -0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Feb 11, 2015 at 05:32:06PM +0100, Johan Oudinet wrote:
> Hi,
>
> I'd like to use parted in a script to list primary and logical
> partitions only (i.e., without extended partitions).
> I do see the partition type if I use the following command:
> # parted -s /dev/sdc print
> Model: Generic STORAGE DEVICE (scsi)
> Disk /dev/sdc: 3965MB
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
> Disk Flags:
>
> Number Start End Size Type File system Flags
> 1 4194kB 71,3MB 67,1MB primary fat16 boot, lba
> 2 71,3MB 3965MB 3894MB extended lba
> 5 75,5MB 344MB 268MB logical
> 6 344MB 612MB 268MB logical
> 7 612MB 621MB 8388kB logical ext4
> 8 621MB 3965MB 3344MB logical ext4
>
> However, if I run the same command with the --machine option, I get the
> following output:
> # parted -sm /dev/sdc print
> BYT;
> /dev/sdc:3965MB:scsi:512:512:msdos:Generic STORAGE DEVICE:;
> 1:4194kB:71,3MB:67,1MB:fat16::boot, lba;
> 2:71,3MB:3965MB:3894MB:::lba;
> 5:75,5MB:344MB:268MB:::;
> 6:344MB:612MB:268MB:::;
> 7:612MB:621MB:8388kB:ext4::;
> 8:621MB:3965MB:3344MB:ext4::;
>
> where the partition type is missing. This is unfortunate :-\
Thanks for the report. You're correct, the machine output kinda sucks.
We can fix it, but there are at least 2 issue I see:
1. confusion for existing machine output users (parted test cases for
one). When we add a field everyone will have to adjust so we can't
just toss it in there.
2. Different disklabels have different info. GPT doesn't have pri/etc.
for example so the output there will either always be blank or
different.
It would make sense to hand off display of partition specific details to
the disklabel, but that would also mean users of machine output would
need to switch based on disklabel type in the first line.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)