GNOME Bugzilla – Bug 759972
GParted displays partition names also as file system labels with new blkid for some file systems
Last modified: 2016-01-18 17:42:38 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
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
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
This enhancement was included in the GParted 0.25.0 release on January 18, 2016.