mount.conf.8 revision 307403
Copyright (c) 2013 Marcel Moolenaar
Copyright (c) 2013 Craig Rodrigues
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

$FreeBSD: stable/10/sbin/mount/mount.conf.8 307403 2016-10-16 22:02:50Z sevan $


.Dd July 7, 2013 .Dt MOUNT.CONF 8 .Os .Sh NAME .Nm mount.conf .Nd root file system mount configuration file .Sh SYNOPSIS

a /.mount.conf .Sh DESCRIPTION During the bootup process, the .Fx kernel will try to mount the root file system using the logic in the .Fn vfs_mountroot function in

a src/sys/kern/vfs_mountroot.c . The root mount logic can be described as follows: l -enum t The kernel will synthesize in memory a config file with default directives for mounting the root file system. The logic for this is in .Fn vfs_mountroot_conf0 . t The kernel will first mount .Xr devfs 8 as the root file system. t Next, the kernel will parse the in-memory config file created in step 1 and try to mount the actual root file system. See .Sx FILE FORMAT for the format of the config file. t When the actual root file system is mounted, .Xr devfs will be re-mounted on the

a /dev directory. t If a

a /.mount.conf file does not exist in the root file system which was just mounted, the root mount logic stops here. t If a

a /.mount.conf file exists in the root file system which was just mounted, this file will be parsed, and the kernel will use this new config file to try to re-mount the root file system. See .Sx FILE FORMAT for the format of the config file. t If the new root file system has a

a /.mount directory, the old root file system will be re-mounted on

a /.mount . t The root mount logic will go back to step 4. .El

p 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

a /.mount.conf file. .Sh FILE FORMAT The kernel parses each line in

a .mount.conf and then tries to perform the action specified on that line as soon as it is parsed. l -tag -width "XXXXXXXXXX" t Ic # A line beginning with a # is a comment and is ignored. t Ic {FS}:{MOUNTPOINT} {OPTIONS} The kernel will try to mount this in an operation equivalent to: d -literal -offset indent mount -t {FS} -o {OPTIONS} {MOUNTPOINT} / .Ed

p If this is successfully mounted, further lines in

a .mount.conf are ignored. If all lines in

a .mount.conf have been processed and no root file system has been successfully mounted, then the action specified by c .onfail is performed. t Ic .ask When the kernel processes this line, a .Li mountroot> command-line prompt is displayed. At this prompt, the operator can enter the the root mount. t Ic .md Ar file Create a memory backed .Xr md 4 virtual disk, using .Ar file as the backing store. t Ic .onfail Ar [panic|reboot|retry|continue] If after parsing all the lines in

a .mount.conf the kernel is unable to mount a root file system, the c .onfail directive tells the kernel what action to perform. t Ic .timeout Ar N Before trying to mount a root file system, if the root mount device does not exist, wait at most .Ar N seconds for the device to appear before trying to mount it. If c .timeout is not specified, the default timeout is 3 seconds. .El .Sh EXAMPLES The following example

a .mount.conf will direct the kernel to try mounting the root file system first as an ISO CD9660 file system on

a /dev/cd0 , then if that does not work, as an ISO CD9660 file system on

a /dev/acd0 , and then if that does not work, as a UFS file system on

a /dev/ada0s1a . If that does not work, a .Li 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. d -literal -offset indent .Li .onfail panic .Li .timeout 3 cd9660:/dev/cd0 ro .Li .timeout 0 cd9660:/dev/acd0 ro .Li .timeout 3 ufs:/dev/ada0s1a .Li .ask .Ed

p The following example

a .mount.conf will direct the kernel to create a .Xr md 4 memory disk attached to the file

a /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. d -literal -offset indent .Li .timeout 3 .Li .md /data/OS-1.0.iso .Li cd9600:/dev/md# ro .Li # Can also use cd9660:/dev/md0 ro .Ed

p The following example

a .mount.conf will direct the kernel to create a .Xr md 4 memory disk attached to the file

a /data/base.ufs.uzip and then mount the UFS file system on the md uzip device which was just created by the .Xr geom_uzip 4 driver. d -literal -offset indent .Li .md /data/base.ufs.uzip .Li ufs:/dev/md#.uzip ro .Li # Can also use ufs:/dev/md0.uzip ro .Ed

p The following example

a .mount.conf will direct the kernel to do a unionfs mount on a directory

a /jail/freebsd-8-stable which has a .Xr chroot 2 environment. d -literal -offset indent .Li .timeout 3 .Li unionfs:/jail/freebsd-8-stable .Ed .Sh NOTES For each root file system which is mounted, a

a /dev directory .Em must exist so that the root mount logic can properly re-mount .Xr devfs 8 . If this directory does not exist, the system may hang during the bootup process. .Sh SEE ALSO .Xr nmount 2 , .Xr md 4 , .Xr boot.config 5 , .Xr fstab 5 , .Xr boot 8 , .Xr loader 8 , .Xr mount 8 .Sh HISTORY The .Nm file first appeared in .Fx 9.0 . .Sh AUTHORS .An -nosplit The root mount logic in the .Fx kernel which parses

a /.mount.conf was written by .An Marcel Moolenaar Aq Mt marcel@FreeBSD.org . This man page was written by .An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .