Kasperian Moving Parts

kinda like Batman, but with a wife and 3 kids

VLC patch for hfsplus partitions, yay!

I have a 13″ MacBook Pro that I use for my personal and non-work shtuff. I resized OS X down, installed Linux (Kubuntu), and set up a shared partition so that I can keep files there that I want to access from both OS X and Linux. Things like my music and video collection, Snooker torrents, VMware virtual machines, etc. It appears that there are basically 4 decent options for a shared filesystem between OS X and Linux, but IMHO only 2 of them are worth trying and only 1 of them seems to actually work almost perfectly:

  1. The venerable FAT32 filesystem. Yes, it works. No, it doesn’t work like you’d want a UNIX filesystem to work. You can’t store files that are bigger than 4 GB on it, and the whole lack of permissions and filename length limitations thing just really sticks in my craw, so this isn’t a viable option for me.
  2. The newer and even more proprietary NTFS filesystem. Come on, seriously? Why would anybody pick NTFS, which is native to only one proprietary operating system in the world (hint: not Linux and not OS X) and try to use it in Linux and OS X? Insanity, I say. Moving on.
  3. ext2/ext3. Thanks to FUSE and fuse-ext2, the native-to-Linux ext2 and ext3 filesystem can be accessed in OS X. Of course, it works perfectly in Linux. However, in testing, it feels like trying to navigate through the ext2 partition in OS X’s finder is REALLY slow and choppy. I’m not sure what’s going on, and it doesn’t seem like the CPU is getting pegged or anything. But it felt slow enough that I don’t think I want to put all my data on it and hope it works right.
  4. hfsplus. Now this one actually works (or seems to thus far) really well. Reading up on it a bit after having been using it makes me a smidge nervous, since it would seem that it’s extremely unloved from the Linux kernel devs and currently unmaintained. Yay! But if you set up an unjournaled hfsplus partition from OS X, Linux can very happily read/write it and it seems to be very stable and fast in both Linux and OS X.

Great. So why am I blogging about this? Well, like I said, hfsplus access in Linux is working almost perfectly. Except for VLC. Apparently, hfsplus has some nasty problems and isn’t actually POSIX compliant when it comes to opening directories. Due to how VLC handles “files” that it is asked to play (it accepts both directories and files as playlist arguments and VLC chooses to try to open the playlist element as a directory first, and this doesn’t fail with hfsplus the way it should in POSIX-compliant filesystems) VLC is unable to play anything that’s on an hfsplus partition. This is quite a bummer for me and others who use hfsplus as a filesystem and also like to use VLC.

Enter this bug report and Tobias’s awesome little patch for VLC. After using his patch and applying it over the top of my 1.0.3 VLC here in Kubuntu Karmic, I am now able to watch movies and listen to music stored on my hfsplus shared partition again from Linux, using VLC. Huzzah! Maybe this’ll help someone else out there struggling with this (or just generate a lot of “you suck, why would you use proprietary Apple hardware or OS X?!?!” comments).

Oh, and while this is a hfsplus filesystem problem at the root, because of how Kaffeine or KDE’s own Dragon Player open files, they are not affected by this bug. Only VLC is. So…. yeah.

I am curious, though… I know I’m not the only KDE hacker out there who’s using a MacBook or MBP, and who *gasp* also has OS X and Linux sharing the hard drive. What do you guys use for a shared partition between Linux and OS X?

12 Replies to “VLC patch for hfsplus partitions, yay!”

  • i love you. really.

    ok, that’s an exaggeration. but the vlc-sucks-playing-from-hfsplus has annoyed me to to end for at least the last year, so thanks for the heads up!

    i’ve been sharing stuff with a non-journaled hfsplus external harddrive as well, and that seems to be the easiest way for me. osx can’t read my linux ext3 partition for some reason, too

  • HAH. Hey Leo!!! =:) Yeah, I’ve been totally irked by the vlc-unable-to-play-from-hfsplus-and-devs-unwilling-to-fix thing too. So glad I found that bug and so glad Tobias provided a workaround. =:)

    Also, okay, cool, and I’m glad I’m not the only one using non-journaled hfsplus. =:) Have you tried using the latest fuse-ext2 version (0.0.7–just came out a couple of weeks ago)? I tried with an ext3 partition over the weekend and it worked. I had to manually run /usr/local/bin/fuse-ext2 -force … something something something… (found the incantation on a website), and it seemed to work just fine except for the weird slowness I mentioned (and I didn’t spend any time looking into what that might have been caused by).

    Thanks for commenting!!! =:)

  • I had the same problem finding an Multi-OS filesystem. but for me it also has to support windows (mainly for work stuff)… so udf should be the perfect solution to my problem… but then… linux des not really like udf on harddisks ;_; so now i am using ntfs… because it is the only fs i know that supports files > 4GB and has read/write support on all 3 major OSes :/

    (I didn’t take a look at exfat yet)

  • Can you write to journaled HFS+ partitions? When I still had a Mac, Linux couldn’t do it. Even accessing files and folders only worked only sometimes.
    After some research I found out that Linux’ HFS driver was too stupid to handle journaling at that time.
    Wonder if it improved later.

    Anyways, I used an external FAT32 HDD for sharing data.

  • Well, 1st of all, I found that post:
    http://linuxforen.de/forums/showthread.php?p=1716797

    …telling you about ext3 to be able to be mounted in osx when setting the inode-size to 128 instead of 256 by:
    mkfs.ext3 -I 128

    But I, too, used hfsplus w/o journal to share between osx and linux for about 1 year now w/o trouble. The only thing: The actual hfsplus kernel driver does ignore mounting by group id and user id. That is extremely stupid, because while osx uses 1000, debian has 500 by default, so files written under one system aren’t deleteable under the other (except for linux root).

    One solution would be to set the user/root id in osx to 500, too, but this could lead to serious troubles with some installations, as google told me.

    The best solution would be to mount the hfsplus partition in debian setting the guid and uid, which should work, but simply doesn’t.

    See:
    http://falsepositive.eu/archives/20080307-hfsplus-UIDGID-remapping/21

    There is a patch for that:
    http://lkml.org/lkml/fancy/2007/6/20/364

    ..but I have no idea how to apply that to actual kernels.

    Greetings,
    StN

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.