MOUNT.CONF(5) | MidnightBSD File Formats Manual | MOUNT.CONF(5) |
mount.conf
— root
file system mount configuration file
/.mount.conf
During the bootup process, the FreeBSD
kernel will try to mount the root file system using the logic in the
vfs_mountroot
()
function in src/sys/kern/vfs_mountroot.c. The root
mount logic can be described as follows:
vfs_mountroot_conf0
().The root mount logic is recursive, and step 8 will be repeated as long as each new root file system which is mounted has a /.mount.conf file.
The kernel parses each line in .mount.conf and then tries to perform the action specified on that line as soon as it is parsed.
#
{FS}:{MOUNTPOINT}
{OPTIONS}
mount -t {FS} -o {OPTIONS} {MOUNTPOINT} /
If this is successfully mounted, further lines in
.mount.conf are ignored. If all lines in
.mount.conf have been processed and no root file
system has been successfully mounted, then the action specified by
.onfail
is performed.
.ask
mountroot>
command-line prompt is displayed. At
this prompt, the operator can enter the root mount..md
file.onfail
[panic|reboot|retry|continue].onfail
directive tells the kernel what action to
perform..timeout
N.timeout
is
not specified, the default timeout is 3 seconds.The following example .mount.conf will
direct the kernel to try mounting the root file system first as an ISO
CD9660 file system on /dev/cd0, then if that does
not work, as an ISO CD9660 file system on /dev/cd1,
and then if that does not work, as a UFS file system on
/dev/ada0s1a. If that does not work, a
mountroot>
command-line prompt will be displayed
where the operator can manually enter the root file system to mount. Finally
if that does not work, the kernel will panic.
.onfail panic
.timeout 3
cd9660:/dev/cd0 ro.timeout 0
cd9660:/dev/cd1 ro.timeout 3
ufs:/dev/ada0s1a.ask
The following example .mount.conf will direct the kernel to create a md(4) memory disk attached to the file /data/OS-1.0.iso and then mount the ISO CD9660 file system on the md device which was just created. The last line is a comment which is ignored.
.timeout 3
.md /data/OS-1.0.iso
cd9600:/dev/md# ro
# Can also use cd9660:/dev/md0 ro
The following example .mount.conf will direct the kernel to create a md(4) memory disk attached to the file /data/base.ufs.uzip and then mount the UFS file system on the md uzip device which was just created by the geom_uzip(4) driver.
.md /data/base.ufs.uzip
ufs:/dev/md#.uzip ro
# Can also use ufs:/dev/md0.uzip ro
The following example .mount.conf will direct the kernel to do a unionfs mount on a directory /jail/freebsd-8-stable which has a chroot(2) environment.
.timeout 3
unionfs:/jail/freebsd-8-stable
For each root file system which is mounted, a /dev directory must exist so that the root mount logic can properly re-mount devfs(5). If this directory does not exist, the system may hang during the bootup process.
nmount(2), md(4), boot.config(5), fstab(5), boot(8), loader(8), mount(8)
The mount.conf
file first appeared in
FreeBSD 9.0.
The root mount logic in the FreeBSD kernel which parses /.mount.conf was written by Marcel Moolenaar <marcel@FreeBSD.org>. This man page was written by Craig Rodrigues <rodrigc@FreeBSD.org>.
October 17, 2013 | midnightbsd-3.1 |