Next Previous Contents

5. Mounting filesystems

5.1 Mounting UFS filesystems under Linux

Unfortunately the UFS driver in the Linux 2.0.xx kernels do not include support for FreeBSD. When you try to mount a FreeBSD filesystem, you just get some error messages (the filesystem actually gets mounted, but you cannot do anything with it.) This problem has been solved in the newer Linux kernels (version 2.1.87 and higher.)

There is another version of the UFS driver for Linux 2.0.xx kernels (xx <= 30) on metalab.unc.edu (the former sunsite.unc.edu). It is called U2FS and the current version is u2fs-0.4.3.tar.gz. A version of U2FS (ufs-0.4.4.tar.gz) for Linux 2.0.31 and higher (2.0.xx; not 2.1.xx) can be found at this site along with further information about U2FS (and UFS.)

Now you have to build a new kernel with support for the U2FS filesystem and BSD disklabels. See section Installing and preparing Linux for more information on this. You can leave out UFS filesystem support from the kernel when you use U2FS.

When you have installed the new kernel, you can mount your UFS filesystems (all the partitions in the FreeBSD slice except the swap partition) with a command like this:

mount -t u2fs /dev/hda8 /mnt

You should use a command like

mount -t ufs /dev/hda8 /mnt
if you use a Linux kernel version 2.1.87 or higher. From Linux kernel version 2.1.112 you must add -o ufstype=44bsd to the command like this:
mount -t ufs -o ufstype=44bsd /dev/hda8 /mnt

The UFS (and U2FS) driver is read-only. That is; you can read from the UFS filesystems but you cannot write to them. An experimental read-write UFS driver has replaced the read-only driver in Linux kernels version 2.1.112 and higher; writing to FreeBSD partitions is supported from version 2.1.127.

5.2 Mounting ext2fs filesystems under FreeBSD

To mount ext2fs filesystems under FreeBSD, you first have to build a new kernel with ext2fs support. Read the FreeBSD handbook to learn how to do that. Put the line

options         "EXT2FS"
in your kernel configuration file for the new kernel.

When you have booted with the new kernel, you can mount an ext2fs filesystem by giving a command like:

mount -t ext2fs /dev/wd0s3 /mnt

Due to a bug in FreeBSD 2.2.8 and earlier you will have to unmount all ext2fs filesystems before you shut down FreeBSD if you are using these any of these versions. If you shut down FreeBSD with an ext2fs filesystem mounted, FreeBSD cannot sync the UFS filesystems. This results in fsck being run the next time FreeBSD is booted. You can work around this bug by putting the line:

umount -a -t ext2fs
in the /etc/rc.shutdown file. The bug has been fixed in FreeBSD 3.x.


Next Previous Contents