Some time ago I had FreeBSD disk from which I needed to copy some data. It was system disk from our old product server. Current server runs the 64 bit version of CentOS 5.5, so there was no straight method to just plug & mount it without additional configuration.

Google suggested me, that disks from BSD systems are UFS and to use it I need kernel ufs module, so I’ve typed into terminal:

linux: ~ # modinfo ufs
modinfo: could not find module ufs
linux: ~ # cat /proc/filesystems #this didn't gave any results either.

I’ve installed DMKS driver for UFS from here:

linux: ~ # wget http://people.centos.org/tru/dkms/RPMS/dkms-ufs-2.6.18_8.1.8
.el5-3.c5.noarch.rpm 
linux: ~ # rpm -i dkms-ufs-2.6.18_8.1.8.el5-3.c5.noarch.rpm
linux: ~ # rpm -qa|grep dkms
dkms-2.1.1.2-1.el5.rf
dkms-ufs-2.6.18_8.1.8.el5-3.c5

Next I enabled and loaded module in kernel:

linux: ~ # cat /boot/config-$(uname -r)|grep UFS 
...
# CONFIG_SYSV_FS is not set
...
linux: ~ # vi /boot/config-$(uname -r)
# uncomment
# # CONFIG_SYSV_FS is not set
# to make it look like:
# CONFIG_UFS_FS=m #m means 'module'
linux: ~ # modprobe ufs
linux: ~ # lsmod|grep ufs
ufs      987862 1

Having support for UFS I was finally able to mount disk:

linux: ~ # fdisk -l
...
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
16 heads, 63 sectors/track, 1938021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1     1938021   976762552+  a5  FreeBSD 

linux: ~ # sfdisk -d /dev/sdc
# partition table of /dev/sdc
unit: sectors

/dev/sdc1 : start=       63, size=1953525105, Id=a5, bootable
/dev/sdc2 : start=        0, size=        0, Id= 0
/dev/sdc3 : start=        0, size=        0, Id= 0
/dev/sdc4 : start=        0, size=        0, Id= 0
/dev/sdc5 : start=       63, size=  8388608
/dev/sdc6 : start=  8388671, size=  8388608
/dev/sdc7 : start= 16777279, size= 37322752
/dev/sdc8 : start= 54100031, size=  8388608
/dev/sdc9 : start= 62488639, size=1891036529 

Partitions /dev/sdc[1-9] are the UFS partitions as they are visible is FreeBSD. In my case /dev/sda9 is /usr and that’s the one I needed.

linux: ~ # mkdir /media/bsd
linux: ~ # mount -r -t ufs -o ufstype=5xbsd /dev/sdc9 /media/bsd/

I hope that it will be useful for someone.

Facebook comments:

Comment now!
















Trackbacks