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

Article contributed by Idefix on Wed, 2011-01-26 12:11
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.

Comments

Re: Getting recognition from Linux / Part One - Recognizing ...

Very cool idefix! I haven't tried it yet, but easy BFS mounting and finally maybe even write support is something I've been hoping for for a long time. Thanks very much! Together with korli's work from the other side, data exchange on a dual-boot machine becomes better and better. Regards, Humdinger

Re: Getting recognition from Linux / Part One - Recognizing ...

It doesn't seem to be too late to introduce new util-linux v2.18 in Ubuntu Natty https://wiki.ubuntu.com/NattyReleaseSchedule

Re: Getting recognition from Linux / Part One - Recognizing ...

It may be new to some of you but ZevenOS (& Neptune) supports bfs + write support through the bfs_fuse module since version 3.0 (1.8) . So you can get the bfs_fuse deb package from here : http://www.zevenos.com/packages/zevenos3/binary/bfs-fuse_1.0.1-i386.deb
or by simply adding the zevenos 3.0 repo:

deb http://www.zevenos.com/packages/zevenos3/ ./

It works flawlessly so far by mounting a bfs device like this:

sudo bfs_fuse /dev/sdb1 /mnt

It seems only fully accessible as root though. (or you configure fuse properly)

Feel free to use it.

Its really nice that "befs" support now also part of the util-linux v2.18 package. This is something that we all been waiting for.

Re: Getting recognition from Linux / Part One - Recognizing ...

This is some pretty cool work! Thanks a bunch for doing it! It will certainly make my life easier, and especially so in the future when it trickles into more distribution and works out of the box. Maybe somewhere in the guides section there should be a link back to this article.

Re: Getting recognition from Linux / Part One - Recognizing ...

Thank you for your kind words.

I have created a package for the BFS FUSE driver and added it to my PPA. You should find it in the Ubuntu Software Centre under BeFS Support, after you have refreshed the repository information.

It will take over the mounting from the linux BeFS driver, giving Ubuntu read-write support.

Beware though that it is currently in a highly experimental state.

Re: Getting recognition from Linux / Part One - Recognizing ...

I added an updated os-prober package to my PPA. It will now detect Haiku installations.

If you run sudo update-grub after you have updated os-prober, it will detect your Haiku installations and add their entries to the Grub 2 menu.

dual-boot haiku/ubuntu system with bfs filesystem sharing

Idefix --- thanks very much for your improvements to libblkid and other software necessary for ubuntu to easily read bfs, and also for writing up this and other articles describing this and your experience.

I need to replace one of my systems and i would like to make the new one like yours as i understand it --- dual boot haiku/ubuntu, with the ubuntu able to read the haiku's disk or partition.

I have not got the new hardware yet, so i was wondering if you could describe just what you are using?

My only desired constraint is that i would like to use a tower or mini-tower of some sort so that it is easy to take cards in and out.

Thanks in advance for any info about your hardware (or if anybody else has any advice i'm interested as well).