Reading FreeBSD UFS formatted external drive in Mac OS X
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).
excerpt
If you have to mount an ufs2 volume (for example an external FreeNAS disk) in MacOS/X Lion, you can do the following:
Additional Notes
- 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
unixfs
in the unzipped source code downloaded in step 2.- Open a terminal window.
- Enter
sudo -s
and supply your admin password.- Copy
unixfs
(see step 4) to/usr/local/include/osxfuse/
(cp -R unixfs /usr/local/include/osxfuse/
).- Enter
cd /usr/local/include/osxfuse/unixfs/ufs
.- Enter
ln -s /usr/local/include/osxfuse/fuse
.- Enter
make
.- Create a mount point, for example
mkdir usb
.- Enter
diskutil list
and look for the identifier of the external drive containing the UFS volume (for me it was "disk1s1").- Enter
./ufs --dmg /dev/disk1s1 --type ufs2 usb
, replacing "disk1s1" with the actual identifier under "usb" with the mount point created in step 11.- Enter
df -h
to 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.
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
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.
Thanks.
-
Admin almost 10 yearsIf osxfuse doesn't work, I'd boot a freebsd live cd on another computer (or a VM), plug in that external drive, mount the filesystems, and scp the files to the Mac.
-
Admin over 5 yearsFreeBSD in a virtualbox instance?
-
-
sudo almost 10 yearsStep 10 fails for me on OS X 10.8.5. I get an error about an unused function. If I remove the function, I get some syntax errors.
-
slm almost 10 years@9000 - please post the error msgs you've encountered.
-
sudo almost 10 yearsHere's what I see when I run
make
: ufs.c:759:1: error: unused function 'ufs_validate_entry' [-Werror,-Wunused-function] ufs_validate_entry(struct super_block* sb, char* base, unsigned offset, ^ 1 error generated. make: *** [ufs.o] Error 1 -
slm almost 10 years@9000 - post this on the osxfuse's issue tracker, here: github.com/osxfuse/osxfuse/issues
-
sudo almost 10 yearsIsn't it more suitable to post it in the osxfuse/filesystems issue tracker? I've put it there for now.
-
slm almost 10 years@9000 - I don't think that matters that much, let the project determine where they want to track it, reporting it at the top is what I'd typically do.