2020-02-17 19:11:53 +03:00
.. SPDX-License-Identifier: GPL-2.0
========================
BFS Filesystem for Linux
2005-04-17 02:20:36 +04:00
========================
The BFS filesystem is used by SCO UnixWare OS for the /stand slice, which
usually contains the kernel image and a few other files required for the
boot process.
In order to access /stand partition under Linux you obviously need to
know the partition number and the kernel must support UnixWare disk slices
(CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not
depend on having UnixWare disklabel support because one can also mount
2020-02-17 19:11:53 +03:00
BFS filesystem via loopback::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# losetup /dev/loop0 stand.img
# mount -t bfs /dev/loop0 /mnt/stand
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
where stand.img is a file containing the image of BFS filesystem.
2005-04-17 02:20:36 +04:00
When you have finished using it and umounted you need to also deallocate
2020-02-17 19:11:53 +03:00
/dev/loop0 device by::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# losetup -d /dev/loop0
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
You can simplify mounting by just typing::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# mount -t bfs -o loop stand.img /mnt/stand
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
this will allocate the first available loopback device (and load loop.o
2005-04-17 02:20:36 +04:00
kernel module if necessary) automatically. If the loopback driver is not
2008-07-08 21:00:25 +04:00
loaded automatically, make sure that you have compiled the module and
that modprobe is functioning. Beware that umount will not deallocate
/dev/loopN device if /etc/mtab file on your system is a symbolic link to
/proc/mounts. You will need to do it manually using "-d" switch of
losetup(8). Read losetup(8) manpage for more info.
2005-04-17 02:20:36 +04:00
To create the BFS image under UnixWare you need to find out first which
2020-02-17 19:11:53 +03:00
slice contains it. The command prtvtoc(1M) is your friend::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# prtvtoc /dev/rdsk/c0b0t0d0s0
2005-04-17 02:20:36 +04:00
(assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you
look for the slice with tag "STAND", which is usually slice 10. With this
2020-02-17 19:11:53 +03:00
information you can use dd(1) to create the BFS image::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# umount /stand
# dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
2005-04-17 02:20:36 +04:00
Just in case, you can verify that you have done the right thing by checking
2020-02-17 19:11:53 +03:00
the magic number::
2005-04-17 02:20:36 +04:00
2020-02-17 19:11:53 +03:00
# od -Ad -tx4 stand.img | more
2005-04-17 02:20:36 +04:00
The first 4 bytes should be 0x1badface.
If you have any patches, questions or suggestions regarding this BFS
implementation please contact the author:
2017-05-13 01:46:44 +03:00
Tigran Aivazian <aivazian.tigran@gmail.com>