Bug 574780

Summary: parted doesn't show filesystem type of partition
Product: [Fedora] Fedora Reporter: Ruben Kerkhof <ruben>
Component: partedAssignee: Hans de Goede <hdegoede>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: hdegoede
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-18 15:01:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ruben Kerkhof 2010-03-18 14:34:28 UTC
Description of problem:

When creating a partition on a disk image, the File system field remains empty


Version-Release number of selected component (if applicable):
[ruben@slice ~]$ rpm -q parted
parted-2.1-5.fc14.x86_64

How reproducible:
[ruben@slice ~]$ truncate --size 128MB test.img
[ruben@slice ~]$ parted test.img -s mklabel msdos
[ruben@slice ~]$ parted test.img -s mkpart primary ext2 1 100%

Actual results:

[ruben@slice ~]$ parted test.img -s print
Model:  (file)
Disk /home/ruben/test.img: 128MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  128MB  127MB  primary


Expected results:

[ruben@slice ~]$ parted test.img -s print
Model:  (file)
Disk /home/ruben/test.img: 128MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  128MB  127MB  primary linux


Additional info:
The filesystem field is filled in:

[ruben@slice ~]$ fdisk -l test.img 
You must set cylinders.
You can do this from the extra functions menu.

Disk test.img: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000abcd5

   Device Boot      Start         End      Blocks   Id  System
test.img1              17        1952      123904   83  Linux

I've also build parted from the git repo at git.debian.org. Same result.

Comment 1 Hans de Goede 2010-03-18 15:01:43 UTC
The "File system" column in parted's print output is not based on the Id field of the partition tabel entry, but on how the partition is actually formatted.

As the fdisk output shows parted has correctly set the Id field of the partition tabel entry when creating the partition.

Comment 2 Ruben Kerkhof 2010-03-18 19:49:46 UTC
Ah, I see, my mistake.

Is there another way to get the filesystem id from parted?

Comment 3 Hans de Goede 2010-03-18 20:02:08 UTC
(In reply to comment #2)
> Ah, I see, my mistake.
> 
> Is there another way to get the filesystem id from parted?    

I'm afraid not, this is because parted tries to have an interface which is disklabel type (IE sun, bsd, msdos, gpt, dasd) neutral, and not all
disklabel types have an Id concept.