Reading FreeBSD UFS formatted external drive in Mac OS X
I have an external USB drive with backup files formatted in FreeBSD’s UFS file system. When I plug it into a computer running Mac OS X 10.9.4, I cannot read the drive’s contents, and I don’t have physical access to a machine running FreeBSD.
Is there a way to read this drive on a Mac? I only need read-only mode to copy the files to the local filesystem.
I found this tutorial. It’s untested by me but several commenters to the article attested to it working. The article is titled: Mount a ufs2 Volume in MacOS/X 10.7 (Lion).
If you have to mount an ufs2 volume (for example an external FreeNAS
disk) in MacOS/X Lion, you can do the following:
- Download and install OSXFUSE from http://osxfuse.github.com/. Reboot the system.
- Download this ZIP file from https://github.com/osxfuse/filesystems.
- Download and install XCode from http://developer.apple.com/xcode/. This is a prerequisite for step 10.
- Download and install XCode.
- Launch XCode.
- Open XCode preferences.
- Go to tab “Downloads”.
- Locate “Command Line Tools”.
- Click “Install” and enter your credentials.
- Locate the directory
unixfsin the unzipped source code downloaded in step 2.
- Open a terminal window.
sudo -sand supply your admin password.
unixfs(see step 4) to
cp -R unixfs /usr/local/include/osxfuse/).
ln -s /usr/local/include/osxfuse/fuse.
- Create a mount point, for example
diskutil listand look for the identifier of the external drive containing the UFS volume (for me it was “disk1s1”).
./ufs --dmg /dev/disk1s1 --type ufs2 usb, replacing “disk1s1” with the actual identifier under “usb” with the mount point created in step 11.
df -hto see if the volume has been mounted.
The ufs2 volume will be mounted read-only.
I didn’t find a way to see the volume in the Finder, not even with “Go to Folder…”, so I had to copy the files I wanted to work with
using a command like
cp -R macHOTEL /Users/gutzmtho/Downloads. It
didn’t help to create the mount point in
/Volumes. As pointed out in
one of the comments below: “You can see it in Finder, when you are
logged in as root user.” (thanks to the contribution!)
Another option is to set up a virtual machine inside the Mac, for example FreeBSD or Ubuntu. There you see the files in the Finder
equivalent of Linux, but copying files across is awkward because
“.AppleDouble” files will not be copied – at least using drag and
drop, unless you make files starting with a “.” visible.