0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ========================
0004 BFS Filesystem for Linux
0005 ========================
0006
0007 The BFS filesystem is used by SCO UnixWare OS for the /stand slice, which
0008 usually contains the kernel image and a few other files required for the
0009 boot process.
0010
0011 In order to access /stand partition under Linux you obviously need to
0012 know the partition number and the kernel must support UnixWare disk slices
0013 (CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not
0014 depend on having UnixWare disklabel support because one can also mount
0015 BFS filesystem via loopback::
0016
0017 # losetup /dev/loop0 stand.img
0018 # mount -t bfs /dev/loop0 /mnt/stand
0019
0020 where stand.img is a file containing the image of BFS filesystem.
0021 When you have finished using it and umounted you need to also deallocate
0022 /dev/loop0 device by::
0023
0024 # losetup -d /dev/loop0
0025
0026 You can simplify mounting by just typing::
0027
0028 # mount -t bfs -o loop stand.img /mnt/stand
0029
0030 this will allocate the first available loopback device (and load loop.o
0031 kernel module if necessary) automatically. If the loopback driver is not
0032 loaded automatically, make sure that you have compiled the module and
0033 that modprobe is functioning. Beware that umount will not deallocate
0034 /dev/loopN device if /etc/mtab file on your system is a symbolic link to
0035 /proc/mounts. You will need to do it manually using "-d" switch of
0036 losetup(8). Read losetup(8) manpage for more info.
0037
0038 To create the BFS image under UnixWare you need to find out first which
0039 slice contains it. The command prtvtoc(1M) is your friend::
0040
0041 # prtvtoc /dev/rdsk/c0b0t0d0s0
0042
0043 (assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you
0044 look for the slice with tag "STAND", which is usually slice 10. With this
0045 information you can use dd(1) to create the BFS image::
0046
0047 # umount /stand
0048 # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
0049
0050 Just in case, you can verify that you have done the right thing by checking
0051 the magic number::
0052
0053 # od -Ad -tx4 stand.img | more
0054
0055 The first 4 bytes should be 0x1badface.
0056
0057 If you have any patches, questions or suggestions regarding this BFS
0058 implementation please contact the author:
0059
0060 Tigran Aivazian <aivazian.tigran@gmail.com>