Getting recognition from Linux / Part One - Recognizing The Be File System

This article was written when Ubuntu 10.10 was the latest version. Starting with Ubuntu 11.10 (Oneiric Ocelot), BFS file systems should be recognized out of the box.

places menuLate 2009 I made the switch from Windows to Ubuntu as my primary operating system. During the first weeks of using it, I began to wonder why it would recognize my old Windows file system on the hard disk but not the BFS file systems. The partitions were correctly recognized as BeOS BFS (0xEB) and I could mount them from the command-line with mount -t befs /dev/sda5 /media/Haiku, but they didn't show up in the Places menu or elsewhere in the system.

After some investigation it turned out that Ubuntu uses a library called libblkid to get the necessary information from the file system it needed to recognize it. This library is part of the util-linux project and it probes each file system for known magic constants. If a magic is found, the library will return -among others- the file system's type, label and uuid. You can try it out with the blkid program: sudo blkid to get a summary of all the recognized file systems, and sudo blkid -p /dev/sda1 to get a detailed report of the file system on /dev/sda1.

As expected, this library didn't have the code to recognize the Be File System, so I began the task of implementing it. Thankfully, this was made relatively easy due to the excellent book by Dominic Giampaolo, the BFS driver in Haiku and the BeFS driver in Linux. (Note: in Linux, BeFS is used to refer to the Be File System.) And as of util-linux v2.18, libblkid correctly recognizes the Be File System.

But that is not the end of the story. Contrary to Fedora (which uses util-linux v2.18 in its 14th edition), Ubuntu stays with util-linux v2.17 for now. The solution to this problem was to backport the BFS recognition code to v2.17 and provide a Personal Package Archive (PPA) for the modified util-linux package. This package is now ready for your testing pleasure, just follow the following steps to install it:

    add ppa dialog
  1. Open Update Manager and click the Settings... button.
  2. In the window that opens, select the Other Software tab and click the Add... button.
  3. In the dialogue box that opens, add the following text to the text box: ppa:idefix/befs-support
  4. update manager
  5. After clicking the Add Source button and then the Close button, it will ask you to reload the information about available software.
  6. Click the Reload button and after a while you will be greeted by the main window showing that there are 6 updates.
  7. Click the Install Updates button and restart the computer after it has finished updating.

places menuIf all went well you should now see your BFS file systems in the Places menu and elsewhere in the system.

Where to go from here?

If you have followed the previous steps and played a little with the BFS file systems, you will probably have found out that you can't write to the BFS file systems. This is a limitation of the BeFS driver in Linux - it is read-only. But thanks to HCD student Raghu Nagireddy there is a FUSE module for BFS that can also write to the Be File System. I intend to create a PPA package for it, but for now you will have to build it yourself. However, Ubuntu won't automatically pick up the BFS FUSE module to mount BFS file systems. It needs a mount-helper for that to work, which needs to be written.

Questions & Answers

Is it safe?
The BFS recognition code will only read from the file system, so you don't have to worry about any data loss. It could -theoretically- crash as I have only tested it on my two computers running Ubuntu Lucid and Ubuntu Maverick.

Can I remove the modified util-linux package?
Yes, the ppa-purge program will revert the package to the one provided by Ubuntu. Just run:

sudo ppa-purge ppa:idefix/befs-support

How about other distributions?
I only know that Fedora 14 ships with BFS recognition support out of the box. You will have to consult the package information of your favourite distribution whether it comes with util-linux v2.18 or higher.