Blame view
Documentation/filesystems/bfs.rst
2.16 KB
ee68f34d7
|
1 2 3 4 |
.. SPDX-License-Identifier: GPL-2.0 ======================== BFS Filesystem for Linux |
1da177e4c
|
5 6 7 8 9 10 11 12 13 14 |
======================== 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 |
ee68f34d7
|
15 |
BFS filesystem via loopback:: |
1da177e4c
|
16 |
|
ee68f34d7
|
17 18 |
# losetup /dev/loop0 stand.img # mount -t bfs /dev/loop0 /mnt/stand |
1da177e4c
|
19 |
|
ee68f34d7
|
20 |
where stand.img is a file containing the image of BFS filesystem. |
1da177e4c
|
21 |
When you have finished using it and umounted you need to also deallocate |
ee68f34d7
|
22 |
/dev/loop0 device by:: |
1da177e4c
|
23 |
|
ee68f34d7
|
24 |
# losetup -d /dev/loop0 |
1da177e4c
|
25 |
|
ee68f34d7
|
26 |
You can simplify mounting by just typing:: |
1da177e4c
|
27 |
|
ee68f34d7
|
28 |
# mount -t bfs -o loop stand.img /mnt/stand |
1da177e4c
|
29 |
|
ee68f34d7
|
30 |
this will allocate the first available loopback device (and load loop.o |
1da177e4c
|
31 |
kernel module if necessary) automatically. If the loopback driver is not |
a81792f66
|
32 33 34 35 36 |
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. |
1da177e4c
|
37 38 |
To create the BFS image under UnixWare you need to find out first which |
ee68f34d7
|
39 |
slice contains it. The command prtvtoc(1M) is your friend:: |
1da177e4c
|
40 |
|
ee68f34d7
|
41 |
# prtvtoc /dev/rdsk/c0b0t0d0s0 |
1da177e4c
|
42 43 44 |
(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 |
ee68f34d7
|
45 |
information you can use dd(1) to create the BFS image:: |
1da177e4c
|
46 |
|
ee68f34d7
|
47 48 |
# umount /stand # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512 |
1da177e4c
|
49 50 |
Just in case, you can verify that you have done the right thing by checking |
ee68f34d7
|
51 |
the magic number:: |
1da177e4c
|
52 |
|
ee68f34d7
|
53 |
# od -Ad -tx4 stand.img | more |
1da177e4c
|
54 55 56 57 58 |
The first 4 bytes should be 0x1badface. If you have any patches, questions or suggestions regarding this BFS implementation please contact the author: |
cea582247
|
59 |
Tigran Aivazian <aivazian.tigran@gmail.com> |