After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759972 - GParted displays partition names also as file system labels with new blkid for some file systems
GParted displays partition names also as file system labels with new blkid fo...
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: Mike Fleetwood
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2015-12-29 19:27 UTC by Mike Fleetwood
Modified: 2016-01-18 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix displaying partition names as labels (v1) (5.44 KB, patch)
2015-12-30 16:00 UTC, Mike Fleetwood
none Details | Review

Description Mike Fleetwood 2015-12-29 19:27:59 UTC
The requirements for this to happen are:
1) Using GPT
   * Partition table supporting partition naming.
2) File system without a working GParted specific file system label
   read method
   * File systems with no read_label(): exfat, f2fs, ufs, unknown
   * File systems with no working read_label(): hfs, hfsplus
     Their read_label() depends on vol_id which no longer exists.
   * So that file system specific method isn't used, so can't report no
     file system label, and GParted falls back to using FS_Info module
     which gets it's information from the blkid command.
3) Recent blkid (util-linux >= 2.22, released 2012-09-04)
   * Which also reports partition name as PARTLABEL="..." values.
4) Blank label
   * so that LABEL="..." does not appear on the blkid line (before
     PARTLABEL="...").


On Fedora 23 with /dev/loop0 partitioned using GPT thus:

# sgdisk -p /dev/loop0
Disk /dev/loop0: 4194304 sectors, 2.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): AF55A9F5-5EC9-4D75-912B-DC39680683FA
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 4194270
Partitions will be aligned on 2048-sector boundaries
Total free space is 1048509 sectors (512.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          526335   256.0 MiB   8300  empty partition
   2          526336         1050623   256.0 MiB   8300  exfat partition
   3         1050624         1574911   256.0 MiB   8300  f2fs partition
   4         1574912         2099199   256.0 MiB   AF00  hfs partition
   5         2099200         2623487   256.0 MiB   AF00  hfsplus partition
   6         2623488         3147775   256.0 MiB   8300  ufs partition

# parted /dev/loop0 print
Model: Loopback device (loopback)
Disk /dev/loop0: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size   File system  Name               Flags
 1      1049kB  269MB   268MB               empty partition
 2      269MB   538MB   268MB               exfat partition
 3      538MB   806MB   268MB               f2fs partition
 4      806MB   1075MB  268MB  hfs          hfs partition
 5      1075MB  1343MB  268MB  hfs+         hfsplus partition
 6      1343MB  1612MB  268MB               ufs partition

# blkid | sort | fgrep /dev/loop0p
/dev/loop0p1: PARTLABEL="empty partition" PARTUUID="ba628174-7c9a-4b15-a072-a0c48bebdbb5"
/dev/loop0p2: UUID="4753-55A1" TYPE="exfat" PTTYPE="dos" PARTLABEL="exfat partition" PARTUUID="a313544d-70f0-4dba-8f6c-3d4ed1ee3743"
/dev/loop0p3: UUID="68398479-d702-412a-a6e5-20f5116cce77" TYPE="f2fs" PARTLABEL="f2fs partition" PARTUUID="31a520dc-8ee4-4c73-90bf-4569153ee6a0"
/dev/loop0p4: TYPE="hfs" PARTLABEL="hfs partition" PARTUUID="839fe603-8321-49c9-b522-2555de881c2a"
/dev/loop0p5: UUID="6eb474b1-9df8-30f7-b947-1693bd0c7bd8" TYPE="hfsplus" PARTLABEL="hfsplus partition" PARTUUID="c812a1a7-ed6f-4f56-99c1-38f9345a022f"
/dev/loop0p6: UUID="4b0e640aec56ac70" TYPE="ufs" PARTLABEL="ufs partition" PARTUUID="fdedb454-cc79-4a32-a591-9f0d19843e89"


GParted reports all those partitions has having file system label as
"something partition".  Also for the first empty partition which also
doesn't have a file system UUID, GParted reports the GPT partition UUID
as the file system UUID.

Both of these issues are because: (1) FS_Info module uses regular
expressions matching LABEL="..." and UUID="...", and (2) recent versions
of blkid have added PARTLABEL= and PARTUUID= values to the output.  So
in the absence of LABEL= and UUID= values the PART ones will always
match instead.


I'll work on the fix,
Mike
Comment 1 Mike Fleetwood 2015-12-30 16:00:30 UTC
Created attachment 318046 [details] [review]
Fix displaying partition names as labels (v1)

Hi Curtis,

Here's a simple fix for this.
Tested on Fedora 23 where I saw the problem and CentOS 5 to make sure
there was no regression on old blkid output.

Thanks,
Mike
Comment 2 Curtis Gedak 2016-01-01 18:52:59 UTC
Good catch on this issue Mike.

I confirmed the problem on Fedora 23, and also confirmed that patch v1 fixed the problem on Fedora 23 and had no adverse affects on an earlier distro (kubuntu 12.04).

Patch v1 from comment #1 has been committed to the git repository.

The relevant git commit can be viewed at the following link:

Fix displaying partition names also as file system labels in some cases (#759972)
https://git.gnome.org/browse/gparted/commit/?id=bfb6a3800d2a316a901d9a47c4864efa5bbbf73c
Comment 3 Curtis Gedak 2016-01-18 17:42:38 UTC
This enhancement was included in the GParted 0.25.0 release on January 18, 2016.