-
Notifications
You must be signed in to change notification settings - Fork 3
Usage
retro-fuse consists of set of filesystem handler programs, each supporting a different filesystem type. The currently available handler programs are:
-
v6fs
— Supports fifth and sixth edition filesystems -
v7fs
— Supports seventh-edition filesystems -
bsd29fs
— Supports 2.9BSD filesystems -
bsd211fs
— Supports 2.11BSD filesystems
Filesystem handlers can be run directly from the command line, or they
can be installed into /usr/local/sbin
on the host system. Installing into /usr/local/sbin
makes it possible
to mount filesystems using the standard mount(8) command.
To mount an ancient Unix filesystem, run the appropriate filesystem handler program directly, supplying the name of the block or image file containing the filesystem, and the desired mount point:
<handler> [<options>] <device-or-image-file> <mount-point>
Alternatively, if the handler programs have been installed in /sbin
or /usr/local/sbin
, you can use the mount command:
sudo mount -t fuse.<handler> [<options>] <device-or-image-file> <mount-point>
When executed directly, the filesystem handlers can be run by a non-root user. This is often more convenient than using the mount command, which must always be run as root.
The first non-option argument to a filesystem handler is the storage location of the filesystem. This can be a regular file containing an image of the filesystem, or a standard Unix block device.
In some cases it may be necessary to specify an offset to
the start of the filesystem within the file or block device. This can be done using the -o fsoffset=x
option. If
not specified, the filesystem is assumed to start at the beginning of the
file/device.
Filesystem handlers accept the standard set of options supported by the mount(8) command, as well as the FUSE mount options described in mount.fuse(8). Additionally, handlers provide their own set of options which are useful for dealing with ancient filesystems.
The following is a summary of some of the more commonly used options:
-o ro
-
Mount the filesystem in read-only mode.
-o rw
-
Mount the filesystem in read-write mode. This is the default.
-o allow_root
-
Allow the root user to access the filesystem, in addition to the mounting user. Mutually exclusive with the
allow_other
option. -o allow_other
-
Allow any user to access the filesystem, including root and the mounting user. Mutually exclusive with the
allow_root
option. -o mapuid=<host-uid>:<fs-uid>
-o mapgid=<host-gid>:<fs-gid>
-
Map a particular user or group id on the host system to different id on the mounted filesystem. This is useful when accessing a filesystem containing files owned by root or other special users.
The specified id mapping applies both ways. Specifically, the uid/gid on the host is mapped to the corresponding id in the filesystem when performing access control checking, or when the id is stored with a file or directory. Conversely, the filesystem id is mapped to the host id whenever a file is stat()ed or a directory is read.
Multiple mapping options may be given, up to a limit of 100.
-o fssize=<blocks>
-
The size of the filesystem, in blocks. This is used to limit the range of I/O on the underlying device/image file. This can be useful to prevent malformed filesystems from accessing blocks outside of the intended area. It is also necessary when initializing a new filesystem using an image file (see the
initfs
option for further details).The size of a block varies by filesystem type:
Filesystem Block Size (bytes) v6
512
v7
512
2.9BSD
1024
2.11BSD
1024
For an existing filesystem, the
fssize
value defaults to the size given in the filesystem superblock. -o fsoffset=<blocks>
-
Offset into the device/image file at which the filesystem starts, in blocks. Defaults to 0.
-o initfs
-o initfs=<params>
-
Create an empty filesystem on the underlying device/image file before mounting. When using the
initfs
option on an image file, the desired size of the filesystem must be specified using thefssize
option.params is a set of initialization parameters which control the layout and configuration of the new filesystem. The interpretation of these parameters varies by filesystem type. Details on the syntax can be found in the help output of the associated filesystem handler (e.g. by running
v6fs --help
).If params is not specified, the filesystem is initialized using the default parameters as used by the original Unix mkfs(8) command.
-o overwrite
-
When used with the
initfs
option, instructs the filesystem handler to overwrite any existing filesystem image file. Without this option, theinitfs
option will fail with an error if an image file exists. -f
--foreground
-
Run in foreground (useful for debugging).
-d
--debug
-
Enable debug output to stderr (implies -f)
-V
--version
-
Print version information
-h
--help
-
Print usage information.
2.11BSD makes use of BSD disklables to
describe the location and size of filesystem partitions on a disk.
Currently, the bsd211fs
handler does not have the
ability to read or create BSD disklabels. As a result, one must typically specify the
block offset of the filesystem when mounting a filesystem on an existing disk.
For example, to mount the /usr filesystem on an RD54 using the standard BSD partition layout (as described in /etc/disktab) one would use the following command:
$ bsd211fs -o fsoffset=16302 system-rd54.dsk /mnt/tmp
Note that the value of the -o fsoffset
option is specified in 1K-byte blocks. This
differs from the values in /etc/disktab, which are given 512-byte sectors.
Because bsd211fs
does not support creating disklabels, in many cases it will be
necessary use the disklabel(8) program within a running 2.11BSD system to setup the
desired partition layout prior to initializing the filesystems. In these situations,
given that one is already working within a running 2.11BSD system, it is often easier
to simply use the native newfs command, rather running bsd211fs -o initfs
on a
modern host.
As a special case, when creating disks that contain a single filesystem positioned at the start of the disk, it is possible to skip the disk labelling process and simply initialize the filesystem directly without writing a disklabel. This works because the BSD kernel will automatically presume a default partition (partition 'a') covering the entire disk for any disk found without a disklabel.
Conveniently, this feature makes it possible to initialize such disks from a modern host using
the bsd211fs
command alone. For example, to create a new filesystem on a disk image matching
the size of an RD54, one can use the following command:
$ bsd211fs -o initfs,fssize=155600 data-rd54.dsk /mnt/tmp
Assuming this image appears as device rd1 on the BSD system, the filesystem can then be mounted as follows:
$ mount /dev/rd1a /mnt