blob: ce14b901880729ba68afd38ea316376a6183d63a [file] [log] [blame]
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +01001.. SPDX-License-Identifier: GPL-2.0
2
3========================
4BFS Filesystem for Linux
Linus Torvalds1da177e2005-04-16 15:20:36 -07005========================
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
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010015BFS filesystem via loopback::
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010017 # losetup /dev/loop0 stand.img
18 # mount -t bfs /dev/loop0 /mnt/stand
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010020where stand.img is a file containing the image of BFS filesystem.
Linus Torvalds1da177e2005-04-16 15:20:36 -070021When you have finished using it and umounted you need to also deallocate
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010022/dev/loop0 device by::
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010024 # losetup -d /dev/loop0
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010026You can simplify mounting by just typing::
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010028 # mount -t bfs -o loop stand.img /mnt/stand
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010030this will allocate the first available loopback device (and load loop.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070031kernel module if necessary) automatically. If the loopback driver is not
Johannes Berga81792f2008-07-08 19:00:25 +020032loaded 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38To create the BFS image under UnixWare you need to find out first which
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010039slice contains it. The command prtvtoc(1M) is your friend::
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010041 # prtvtoc /dev/rdsk/c0b0t0d0s0
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
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
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010045information you can use dd(1) to create the BFS image::
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010047 # umount /stand
48 # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50Just in case, you can verify that you have done the right thing by checking
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010051the magic number::
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Mauro Carvalho Chehabee68f342020-02-17 17:11:53 +010053 # od -Ad -tx4 stand.img | more
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
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
Andrew Mortoncea58222017-05-12 15:46:44 -070060Tigran Aivazian <aivazian.tigran@gmail.com>