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 698876 - GParted fails to recognize HFS+ partition (possible due to disabled journaling)
GParted fails to recognize HFS+ partition (possible due to disabled journaling)
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
0.12.1
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2013-04-25 17:28 UTC by Mike Strom
Modified: 2013-04-30 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GParted failure (64.05 KB, image/png)
2013-04-25 17:28 UTC, Mike Strom
  Details
GParted 8G-USB (50.55 KB, image/png)
2013-04-25 19:57 UTC, Mike Strom
  Details
Disk Util (88.26 KB, image/jpeg)
2013-04-25 20:00 UTC, Mike Strom
  Details
Make GParted recognise HFSX file systems as HFS+ (1.66 KB, patch)
2013-04-25 21:08 UTC, Mike Fleetwood
none Details | Review

Description Mike Strom 2013-04-25 17:28:22 UTC
Created attachment 242443 [details]
GParted failure

GParted does not recognize an HFS+ partition, even though parted does. 

Here is what parted say:

mike@MacBookPro:~/Desktop$ sudo parted -l
[sudo] password for mike: 
Model: ATA ST9500420AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End    Size    File system     Name                  Flags
 1      20.5kB  210MB  210MB   fat32           EFI                   boot
 2      210MB   304GB  304GB   hfs+            Macintosh
 3      305GB   329GB  23.6GB  ext3
 4      329GB   372GB  43.0GB  ext4
 5      372GB   414GB  41.8GB  ext4
 6      414GB   493GB  79.6GB  hfsx            Share
 7      493GB   500GB  6698MB  linux-swap(v1)  Apple_HFS_Untitled_2


In the attached image you can see that GParted fails to recognize the partition. 

I suspect that this happen after i disabled journaling on the partition in question. Please note that the main HFS+ partition (with journaling enabled) is recognized properly, so it appears this happens only on partitions with journaling disabled.
Comment 1 Curtis Gedak 2013-04-25 17:40:22 UTC
GParted uses the libparted library from the parted project to detect some file system types.

Are the same versions of parted installed in the locations where you use GParted and parted?

You can display the version of parted with the following command:

   parted --version


GParted also uses blkid to determine some file system types.

Would you be able to provide the output from the following command?

   sudo blkid -c /dev/null
Comment 2 Mike Strom 2013-04-25 17:50:40 UTC
Thanks for a lightning fast answer!

Additional information as per request (and a little more):

I run vanilla Ubuntu 12.10/amd64 and installed GParted from the Ubuntu repo via "sudo apt-get install gparted". Nothing funny in the installation as far as i remember. I get exactly the same issue from Ubuntu 12.4/amd64 (running on the same laptop and the same hard drive).

libparted version; libparted0debian1  2.3-10ubuntu2

mike@MacBookPro:~/Desktop$  parted --version
parted (GNU parted) 2.3
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by <http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.


mike@MacBookPro:~/Desktop$ sudo blkid -c /dev/null
/dev/sda1: LABEL="EFI" TYPE="vfat" 
/dev/sda2: UUID="0527ee3b-ed61-3bf6-a558-2d7ea57c5f5d" LABEL="Macintosh" TYPE="hfsplus" 
/dev/sda3: LABEL="Work" UUID="e0992765-5cbc-404e-875d-05222f45da19" TYPE="ext3" 
/dev/sda4: LABEL="Precise" UUID="fcacbf11-02d8-4221-b1b4-3b29b48ad7c9" TYPE="ext4" 
/dev/sda5: LABEL="Quantal" UUID="9559fa4d-e411-4006-a04a-7f04b23e68cc" TYPE="ext4" 
/dev/sda6: UUID="667b1663-7451-365e-9a81-816cfa1a0202" LABEL="Share" TYPE="hfsplus" 
/dev/sda7: LABEL="swap" UUID="b8ad2f41-5f4f-4744-bce0-96c0a4eacca8" TYPE="swap" 

mike@MacBookPro:~/Desktop$ sudo gparted
======================
libparted : 2.3
======================
Comment 3 Curtis Gedak 2013-04-25 18:36:27 UTC
I think I see the problem.

Parted recognizes sda6, not as "hfs+" but as "hfsx" as shown in your first post.

However, GParted does not expect to see "hfsx" from the libparted library.  Instead GParted only expects the types listed in the GParted_Core::get_filesystem method:

https://git.gnome.org/browse/gparted/tree/src/GParted_Core.cc?id=GPARTED_0_16_0#n1224

This difference from libparted might be due to the presence or absence of a journal as you point out in your original post.

I am not sure how this difference impacts the ability of parted to shrink the file system and partition.

Can you provide a list of steps indicating how to create a file system/partition that is identified as "hfsx" by parted?
Comment 4 Mike Strom 2013-04-25 19:57:27 UTC
Created attachment 242462 [details]
GParted 8G-USB
Comment 5 Mike Strom 2013-04-25 19:58:06 UTC
I was wrong about journaling, it's in fact case sensitive that creates the problem:

In Disk Util (OSX) i partioned an 8G USB stick, like this:
part 1: Mac OS Extended (Journaled)
part 2: Mac OS Extended 
part 3: Mac OS Extended (Case-sensitive, Journaled)
part 4: Mac OS Extended (Case-sensitive)

And here is what parted in Linux says:

Model: JetFlash Transcend 8GB (scsi)
Disk /dev/sdb: 8036MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  2143MB  2143MB  primary   hfs+
 2      2143MB  4287MB  2143MB  primary   hfs+
 3      4287MB  6430MB  2143MB  primary   hfsx
 4      6430MB  8036MB  1606MB  extended
 5      6430MB  8036MB  1606MB  logical   hfsx

OSX created the last partition in an extended partition, but i don't think that really matters in this context.

I provide a screenshot from GParted for reference.
Comment 6 Mike Strom 2013-04-25 20:00:54 UTC
Created attachment 242463 [details]
Disk Util

Just to clarify the formats available in OSX Disk Util
Comment 7 Mike Fleetwood 2013-04-25 20:18:02 UTC
Hi Curtis,

A HFSX file system can be created with:
    mkfs.hfsplus -s -v "my label" /dev/sda8


As you've seen GParted is so far only coded to expect "hfs+" from
parted or "hfsplus" from blkid.  It doesn't yet handle "hfsx" from
parted.  That's a simple fix.  Already checked that fsck.hfsplus can
successfully check an HFSX, the only other operation GParted uses
an external command for.

Would you like me to write this simple fix?

Mike
Comment 8 Curtis Gedak 2013-04-25 20:40:53 UTC
(In reply to comment #7)
> Would you like me to write this simple fix?

A patch to address this problem would certainly be appreciated.

You can learn more about GParted development and git patches at the following links:

http://gparted.org/development.php
http://gparted.org/git.php
Comment 9 Mike Fleetwood 2013-04-25 21:08:42 UTC
Created attachment 242467 [details] [review]
Make GParted recognise HFSX file systems as HFS+

Successfully recognised, checked and shrunk (using libparted 2.3) HFSX.

Thanks,
Mike
Comment 10 Mike Strom 2013-04-25 21:32:20 UTC
Sorry if this is off topic, but i really want to fix this so i tried to follow the instructions and get the dependencies to build GParted:
$ sudo apt-get install build-essential e2fsprogs uuid uuid-dev gnome-common libparted-dev libgtkmm-2.4-dev libdevmapper-dev gnome-doc-utils docbook-xml


And then build, but I get this when i try to build:

mike@MacBookPro:~/workspace/gparted$ ./autogen.sh
/usr/bin/gnome-autogen.sh
Cannot find file: gnome-doc-utils.make
You need to install gnome-doc-utils from the GNOME SVN

Which is funny, because it's already installed. What am I missing? 

Thanks,
Mike
Comment 11 Mike Strom 2013-04-25 21:53:59 UTC
Never mind, i worked it out.

Thanks for the patch, i can confirm it solved the problem.

Possible improvements (hope i don't get flamed...);

1) Indicate type (case-sensitive or not, i.e. display hfsx where applicable)
2) Indicate if journaling is enabled or disabled. Perhaps more important for Linux users?
Comment 12 Mike Fleetwood 2013-04-28 16:02:58 UTC
Hi Mike,

Perfectly reasonable improvement requests, no flaming required :-)

With an eye on possible implementations I can see both being shown as
file system attributes in the Partition Information dialog.

  File system:   hfs+
  Attributes:    [X] Case sensitivity
                 [ ] Journal
  ...

GParted doesn't currently have any support for file system attributes so
it's a reasonable size job to add the code.  If you would like to take
this on please open another bug report.  I want to keep this bug limited
to GParted not recognising HFSX file systems.

Thanks,
Mike
Comment 13 Curtis Gedak 2013-04-28 19:02:24 UTC
Thank you Mike Strom for confirming that the patch in comment #9 fixes the file system recognition problem.

I am in agreement with comment #12, regarding this bug report being only to address GParted not recognizing case-sensitive HFS+ file systems.  The possible improvements in comment #11 should be addressed in a separate bug report.

The patch in comment #9 has been committed to the Gnome repository for inclusion in the next release of GParted.

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

Recognise HFSX variant as an HFS+ file system (#698876)
https://git.gnome.org/browse/gparted/commit/?id=d44971328aaf7698c28431bc33ac47422ae79546
Comment 14 Curtis Gedak 2013-04-30 16:30:12 UTC
The fix to address this bug report has been included in GParted 0.16.1 released on April 30, 2013.