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