1.. SPDX-License-Identifier: GPL-2.0
2
3========================
4BFS Filesystem for Linux
5========================
6
7The BFS filesystem is used by SCO UnixWare OS for the /stand slice, which
8usually contains the kernel image and a few other files required for the
9boot process.
10
11In order to access /stand partition under Linux you obviously need to
12know the partition number and the kernel must support UnixWare disk slices
13(CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not
14depend on having UnixWare disklabel support because one can also mount
15BFS filesystem via loopback::
16
17    # losetup /dev/loop0 stand.img
18    # mount -t bfs /dev/loop0 /mnt/stand
19
20where stand.img is a file containing the image of BFS filesystem.
21When you have finished using it and umounted you need to also deallocate
22/dev/loop0 device by::
23
24    # losetup -d /dev/loop0
25
26You can simplify mounting by just typing::
27
28    # mount -t bfs -o loop stand.img /mnt/stand
29
30this will allocate the first available loopback device (and load loop.o
31kernel module if necessary) automatically. If the loopback driver is not
32loaded automatically, make sure that you have compiled the module and
33that modprobe is functioning. Beware that umount will not deallocate
34/dev/loopN device if /etc/mtab file on your system is a symbolic link to
35/proc/mounts. You will need to do it manually using "-d" switch of
36losetup(8). Read losetup(8) manpage for more info.
37
38To create the BFS image under UnixWare you need to find out first which
39slice contains it. The command prtvtoc(1M) is your friend::
40
41    # prtvtoc /dev/rdsk/c0b0t0d0s0
42
43(assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you
44look for the slice with tag "STAND", which is usually slice 10. With this
45information you can use dd(1) to create the BFS image::
46
47    # umount /stand
48    # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
49
50Just in case, you can verify that you have done the right thing by checking
51the magic number::
52
53    # od -Ad -tx4 stand.img | more
54
55The first 4 bytes should be 0x1badface.
56
57If you have any patches, questions or suggestions regarding this BFS
58implementation please contact the author:
59
60Tigran Aivazian <aivazian.tigran@gmail.com>
61