Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc



The UFS file system is used in the BSD operating systems (among others). The filesystem has slices and partitions which makes it a bit strange to mount. This how to is based heavily on a how to found in the gentoo forums.

Kernel Configuration

This is applicable to the 2.6 kernel. UFS file system support is not enabled by default. First, the kernel should be compiled with support for the UFS file system.

Linux Kernel Configuration: file systems
File Systems --->
   Miscellaneous Filesystems  --->
     <*> UFS file system support

If this is a FreeBSD partition, you'll also want support for the partition type

Linux Kernel Configuration: file systems
File Systems --->
   Partition Types  --->
     [*] Advanced partition selection
     [*]   PC BIOS (MSDOS partition tables) support
     [*]     BSD disklabel (FreeBSD partition tables) support

Save your settings, recompile your kernel (and reboot), or load the modules when finished.

Mounting Partitions

UFS has some special mount options. (See MAN Mount 8 for more information) If the partition is UFS1 (FreeBSD < 5) then the option ufstype=44bsd should be included. If the partition is UFS2 then the option ufstype=ufs2 should be used.

mount -r -t ufs -o ufstype=44bsd /dev/hda1 /mnt/point

This will mount the first partition on the slice that gentoo believes to be the partition hda1. If you want to mount other partitions that are on your (freebsd) ufs drive you should do something like:

dmesg | grep bsd

This should show you which harddrive has which (freebsd) partitions on it, the line you really need looks like:

p1: <bsd: p5 p6 >

In this case there are 2 partitions on the drive. But keep in mind that you may also see thing in this list like your /tmp and /swap partitions from your freebsd drive, as well as your /home link which you won't be able to mount (since it's a softlink to /usr/home under freebsd, unless you made it a real partition during your install).

In the example above p5 means that you are able to mount /dev/hdX5 (replace X with your drive letter) to your mount destination. Which would look something like:

mount -r -t ufs -o ufstype=44bsd /dev/hdX5 /mnt/fbsd_partion5

Desired Additions

Please improve it in any way that you see fit, and remove this notice {{Cleanup}} from the article. For tips on cleaning and formatting see Cleanup process

Retrieved from ""

Last modified: Sat, 21 Jun 2008 02:10:00 +0000 Hits: 12,035