Getting recognition from Linux / Part One - Recognizing The Be File System
Late 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:
- Open Update Manager and click the button.
- In the window that opens, select the tab and click the button.
- In the dialogue box that opens, add the following text to the text box: ppa:idefix/befs-support
- After clicking the button and then the button, it will ask you to reload the information about available software.
- Click the button and after a while you will be greeted by the main window showing that there are 6 updates.
- Click the button and restart the computer after it has finished updating.
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.