Slashdot Mirror


Unix File System Issues on Mac OS X?

rlthomps-1 asks: "I've been thinking about reformatting my Mac's hard drive in UFS, since I've seen the option on the install screen. I was looking for advantages of the Unix file system since it sounds like it would have better performance over HFS+. After viewing this Apple kbase article I wasn't so sure. A test system at work won't install software correctly because the drive name is stuck as '/' among other problems. Why would Apple include the UFS option if it offers such reduced functionality, and is anyone out there using it for non-server applications? What for? Are there advantages to UFS on the desktop Mac OS?"

21 of 93 comments (clear)

  1. UFS is there for historical reasons by Matthias+Wiesmann · · Score: 4, Insightful
    As far as I understand, UFS support in OS X is mostly legacy: previous versions (Mac OS X server 1.0 for instance) relied more heavily on it. In Mac OS X, HFS+ has been optimised more heavily than UFS.

    Also understand that many carbon applications have trouble coping with non-HFS+ file-systems. Here in the lab, I mount my solaris home directory thru NFS, and some carbon apps cannot start from my home directory because of this. Some carbon applications even have trouble with files in this file-system (on bad days Acrobat Reader tells me the file does not exist).

    As applications and system frameworks become more file-system agnostic. I suspect Apple will probably put less emphasis on HFS+ and put more effort in other file-systems.

  2. HFS+ versus UFS by Tsk · · Score: 5, Informative
    First let see the state of UFS in Darwin:
    When Darwin was built, Apple used FreeBSD 3.2 has its core BSD os, since then many changes where applied in the UFS code in FreeBSD (softupdates are the ones comes to mind). Since then Apple's version of UFS has not change too much.
    HFS+ is Apple's MacOS native enhanced file system. So if you need to run Classic, if you need to run carbonised application that do have a resource fork then you need an HFS+ partition (see Mozilla's readme).
    If you're more a unix guy like and want to compile OSS, host some CVS reposiroty then you 'll need UFS.
    UFS is case sensitive. HFS+ is not (it might seems to be but is not). I'de say for all macos Apps use HFS+ an create a second UFS partition where you'd put all your unix apps and other unix related stuff (CVS etc ...).
    Other references can be found :
    1. Open Darwin's Thread UFS vs HFS+
    2. Brigging UFS up to date
    3. Meta Data in Mac Filesystems
    --
    none Yet.
    1. Re:HFS+ versus UFS by usr122122121 · · Score: 5, Informative
      UFS is case sensitive. HFS+ is not (it might seems to be but is not)
      Minor addition to your post: UFS is case sensitive [and as a result has to be case-retaining]. HFS+ is case-insensitive, but is still case-retaining.
      --

      -braxton
    2. Re:HFS+ versus UFS by stux · · Score: 3, Informative

      The simple answer is...

      Use HFS+.

      Unless you have a concrete reason to use UFS... and no, wanting to have to get the case right, or wanting "better performance" is not a reason.

      HFS+ is the native file system of Mac OS X... UFS is just a compatibility layer.

      Just like Classic is a compatibility layer...

      You don't want to use Classic do you?

      Well, then you don't want to use UFS.

      UFS does not get tested as heavily as HFS+ (hell why do you think AirPort doesn't work... because it makes case insensitive assumptions)

      Commercial software is NOT tested on UFS.

      UFS is ONLY there to allow the porting of large unix software which makes case sensitive assumption... such as having two files with the same name in the same directory, but different cases.

      Running such software is the only valid reason to install UFS, and normally you'd just fix the problem anywho, doing this (the same files in the one directory) is bad practise anywho.

      So, the moral of the story is, don't use UFS on Mac OS X. (unless you have a DAMN good reason)

      (developing cross-platform UNIX software is actually a fairly good reason to have one UFS partition about)

      --

      ---
      Live Long & Prosper \\//_
      CYA STUX =`B^) 'da Captain,
      Jedi & Last *-fytr
  3. Yes advantages by Leimy · · Score: 3, Informative

    If you are running a server you most certainly want some form of security. HFS+ is not case sensitive. If you restrict certain files like "Hello" outsiders may be able to get to the same file by calling it "HeLlO" or "HELLO". UFS is case sensitive.

    OpenDarwin.org is looking into getting up-to-date UFS with FreeBSD and then maybe UFS2 from FreeBSD -current. I have been one of few people on the opendarwin.org list to respond and the exchange has been good about how to begin. Jordan Hubbard has provided good guidance.... now I just need the time and some help I am sure.

    If you are interested... please sign up.

    1. Re:Yes advantages by Leimy · · Score: 3, Informative

      Actually, as far as I've experienced, HFS+ IS case-sensitive,
      You haven't done much then.

      [dave@tivo dave]$ ssh dleimbac@mac1
      dleimbac@mac1's password:
      Welcome to Darwin!
      mac1% cd /tmp
      mac1% ls
      mac1% touch Hello
      mac1% touch HeLLo
      mac1% ls -l
      total 0
      -rw-r--r-- 1 dleimbac wheel 0 Jun 14 13:14 Hello
      mac1%

    2. Re:Yes advantages by Leimy · · Score: 3, Interesting

      Well UFS with softupdates would be your friend then wouldn't it. :) I am in the midst of doing some of the research necessary to bring this to UFS on OS X. I have McKusick's USENIX paper in hand... an assload of source to look through and a good dose of coffee/tea [mood depending].

      So far one other OpenDarwinite and myself seem to be interested in making this happen + Jordan Hubbard [who probably just doesn't have the time to help much.]

      Dave

  4. ufs not for desktop usage by d0n+quix0te · · Score: 4, Interesting

    it is primarily to be used if you are running a web server. Apache is better tuned for UFS than HFS+.

    Use HFS+ if you are going to use it as a desktop. Many apps including Office will have problems because they expect a HFS+ system supporting Type/Creator info.

  5. I use both at home by SandSpider · · Score: 3, Interesting

    I have UFS for my User partition, and all of the rest of my partitions are HFS+. The reason for this is that, if you boot in OS 9, all of your permissions are ignored, and anyone can waltz into your hard drive and play around. UFS isn't readable by OS 9, so no worries there.

    I haven't really had any problems with my setup. Maybe there are some things I'll find the more I use it, but I've had this setup for months, and I haven't really noticed anything. But I certainly wouldn't format my system partition UFS. I tried that once, and it didn't work for non-server use at all. Mostly because, if something went wrong with the hard drive, I didn't have a boot disc that could do anything about it. That probably isn't a problem with things like the new HD tool from Micromat, but at the time it was a pain.

    =Brian

    --
    There is nothing so good that someone, somewhere, will not hate it.
  6. Re:CVS Ref... by Tsk · · Score: 3, Informative

    I do use cvs over ssh and it works (I used it for OpanDarwin).
    I then can ssh anywhere I want.
    The problem with CVSd is the case-sensitive issue that can be found in found in HFS.

    --
    none Yet.
  7. Do NOT install UFS by nachoman · · Score: 5, Informative

    I thought along the same lines... It is Unix, so UFS should be better... So, I formatted my iBook and went with UFS.

    I was wrong. All of the mac applications run much better under HFS. Things like Appleworks need an HFS partition so they work with OS 9 as well as X. And mozilla still won't run in a UFS partition. As of version 10.1.3 (not exactly sure which one I tried) there were still a LOT of problems with UFS. I got a lot of data corruption on my UFS partition. Also, disk IO seemed a lot slower than with an HFS partition. The system kept getting slower and slower.

    Finally, I reinstalled again with HFS. All of my troubles went away. In my opinion, don't use UFS unless you have a really important reason to do so.

  8. OS 9 & Classic by CokeBear · · Score: 4, Informative

    The most important reason to stick with HFS+ is that a UFS drive cannot boot back into OS 9, and does not support Classic. (Also, HFS+ is faster)

    --
    Reality has a liberal bias
  9. Re:Why Not Port XFS by Tsk · · Score: 3, Informative

    it would seem relatively trivial to port XFS to the OS.
    There's a icensing issue Here. SGI'sxfs is GPLed, apple does not endorse GPL or LPGLed software. They removed wget because it was gpled, gnutar has also been removed. Apple want to use BSD like licence exclusively, so one day if they want to they can make a closed source OS again .....
    If you'de want xfs on OS X it should come from The GNU-Darwin project or from Fink. Both project are leading software port (one bringing support for AMD powered ia32 machines).

    --
    none Yet.
  10. Re:Back in the day... by ahknight · · Score: 3, Insightful
    Really, is it so hard to have data structures for file io that have more than 31 places for filenames?

    With 15 years of code under their belt that relied on just that fact, well, yes.

  11. UFS can be used, in its place by depeche · · Score: 4, Informative

    Apple includes UFS becuase all Cocoa applications will run correctly with UFS, and Carbon applications (if written correctly) will also run correctly. Apple uses its previously published standards (see Netatalk list archive for a discussion) to seperate the data and resource forks. The problem is that many MacOS applications--and the entire classic environment--require HFS compatibility. Many applications will not even install onto a UFS drive. If your environment is mostly Unix, and you are a developer or a web designer, having the same case-preserving, case-sensitive file system symantics that other Unix implementations may be a benifit. Otherwise, stick to HFS+. I, for one, have signed and recommend that other sign the Metadata petition which calls for Apple to move towarsd a modern file system which has multiple streams (as apposed to two fixed streams) and a generalized metadata implementation a la BeFS or Attributed FS to provide the core HFS compatible metadata with the ability to extend the metadata use into new areas. A journaled file system would also be a plus. HFS+ is a reasonably efficient and Unix like file system. The only difference is the case-preserving, case-insensitive file symantics, which is arguably (many discussions abound) is preferable for a GUI, and human UI in general.

    A big bonus would be implementing posix compliant multiple stream bsd userland commands like cp so that you don't axe your resource fork when you cp a file from the command line, etc.

  12. You want UFS? Here's a trick: by Anonymous Coward · · Score: 5, Informative

    I was trying to get UMN Gopherd running on my OS X box awhile back, and one neat trick that was suggested to me by the maintainer of the package that helped was to use the Disk Copy application to create a virtual UFS device. I dragged the files I wanted to compile into my virtual drive, cd'ed into it, did the make thing, and presto: it compiled beautifully. Even neater is that I could still install it into the standard hierarchy, which was hfs+ formatted, and it still ran just smooth.

    So my advice is this: format your drive hfs, and when you need to do a project that requires UFS, simplly create a big enough blank UFS drive using Disk Copy, and do your work in it. Talk about having your cake and eating it too!

    ...mmmm... cake.....

  13. Re:case sensitivity as a security measure?! by 1010011010 · · Score: 3, Insightful

    Case-sensitivity is easy, as it's just comparing bytes. Case-insensitivity is hard for non-English (and the more non-English, the harder it gets) languages, because you have to search through a table of equivalent glyphs. It's a lot more overhead. Also, the Unix core of OSX doesn't use Unicode natively, which adds a layer of complexity.

    --
    Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
  14. Re:Why Not Port XFS by 1010011010 · · Score: 3, Informative

    They still use GCC... but then, there are no BSD-licensed compilers.

    --
    Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
  15. Myths and Facts, plus a suggestion by gseidman · · Score: 5, Informative
    First off, I see a lot of people posting about how UFS does not support resource forks. This is technically true, but false in practice. Any non-Classic application which reads or writes resource forks will work just fine on files stored on a UFS partition. Same with metadata (type/creator). While HFS and HFS+ associate the data fork with the hidden resource fork and metadata one way, UFS does it another. The resource fork and metadata are hidden and associated with the data fork by a naming convention rather than by an intrinsic aspect of the filesystem.

    Second, I cannot recommend UFS for a root partition. Too many installers rely on the root partition being HFS+. They give errors about not being able to install on a "network file system" (which should be possible regardless). I had my system set up with several UFS partitions and no HFS+ partition at all, and ran into problems trying to install a bunch of stuff I genuinely wanted. So I gave up and made my root partition HFS+.

    What I recommend, however, is that only the root be HFS+. My /Users partition is UFS. A couple of other partitions are UFS. I ordered an external FireWire drive and the several partitions I will be putting on it (including /Library, /Applications, and /Developer) will all be UFS.

    (For those who are worried about /Library being externally mounted -- I haven't figured out what difference Apple intends there to be between /System/Library and /Library since both seem to be used identically, but I have chosen to treat /System/Library as containing things central to the running system such as StartupItems and Extensions, and /Library to be things related to applications, such as Application Support and Fonts.)

    To maintain my various UFS partitions, I have an /etc/fstab and run fsck -p in the Disks StartupItem. I've been doing things this ways for months and it seems to work quite nicely. I will mention that I do not use any Classic applications, so having partitions (such as my home directory) visible from Classic is not a concern. YMMV.

    1. Re:Myths and Facts, plus a suggestion by am+2k · · Score: 3, Informative
      For those who are worried about /Library being externally mounted -- I haven't figured out what difference Apple intends there to be between /System/Library and /Library since both seem to be used identically
      /System is reserved for Apple and may be completely replaced after a system update (wiping all your changes away).
  16. HFS+ was designed for performance by Megane · · Score: 4, Insightful
    I think one problem people are having with the HFS+ vs UFS issue is they think "Well, I haven't seen this UFS thing before, and HFS+ has been around for a long time, so UFS must be newer, and therefore it must be better!" All this without understanding one thing about how either file system works.

    UFS was included for those few people who needed a real, genuine, Unix file system. It has the "real inodes" and the case sensitivity that Unix apps expect. But (as far as I know), directories are stored as files with a special attribute, all over the disk, just like the MS-DOS FAT file system does. It does things this way after all this time because that's the way Unix has always done things.

    HFS+, however, is an extension to HFS to give it a few extra things that it needed to become a serious file system. Stuff like support for volumes larger than 2G, really long file names, Unix file attributes, etc. HFS stores directories in a B-tree file. In other words, it uses a database. This is much more efficient than a bunch of scattered files and inodes holding directory information.

    Basically, if you don't know a specific reason why you need UFS, don't use it.

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }