1 .\" Copyright (c) 2013 Marcel Moolenaar
2 .\" Copyright (c) 2013 Craig Rodrigues
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd root file system mount configuration file
38 During the bootup process, the
40 kernel will try to mount the root file system
41 using the logic in the
44 .Pa src/sys/kern/vfs_mountroot.c .
45 The root mount logic can be described as follows:
48 The kernel will synthesize in memory a config file
49 with default directives for mounting
51 The logic for this is in
52 .Fn vfs_mountroot_conf0 .
54 The kernel will first mount
56 as the root file system.
58 Next, the kernel will parse the in-memory config file created in step 1
59 and try to mount the actual root file system.
62 for the format of the config file.
64 When the actual root file system is mounted,
66 will be re-mounted on the
72 file does not exist in the root file system which was
73 just mounted, the root mount logic stops here.
77 file exists in the root file system which was just mounted,
78 this file will be parsed, and the kernel will use this new config
79 file to try to re-mount the root file system.
82 for the format of the config file.
84 If the new root file system has a
86 directory, the old root file system will be re-mounted
90 The root mount logic will go back to step 4.
93 The root mount logic is recursive, and step 8 will
94 be repeated as long as each new root file system
95 which is mounted has a
99 The kernel parses each line in
101 and then tries to perform the action specified on that line as soon as it is parsed.
102 .Bl -tag -width "XXXXXXXXXX"
104 A line beginning with a # is a comment and is ignored.
105 .It Ic {FS}:{MOUNTPOINT} {OPTIONS}
106 The kernel will try to mount this in an
107 operation equivalent to:
108 .Bd -literal -offset indent
109 mount -t {FS} -o {OPTIONS} {MOUNTPOINT} /
112 If this is successfully mounted,
118 have been processed and no root file system has been successfully
119 mounted, then the action specified by
123 When the kernel processes this line, a
125 command-line prompt is displayed.
126 At this prompt, the operator can enter the root mount.
128 Create a memory backed
132 as the backing store.
133 .It Ic .onfail Ar [panic|reboot|retry|continue]
134 If after parsing all the lines in
136 the kernel is unable to mount a root file system,
139 directive tells the kernel what action to perform.
141 Before trying to mount a root file system,
142 if the root mount device does not exist, wait at most
144 seconds for the device to appear before trying to mount it.
147 is not specified, the default timeout is 3 seconds.
150 The following example
152 will direct the kernel to try mounting the root file system
153 first as an ISO CD9660 file system on
155 then if that does not work, as an ISO CD9660 file system on
157 and then if that does not work, as a UFS file system on
159 If that does not work, a
161 command-line prompt will be displayed where the operator
162 can manually enter the root file system to mount.
163 Finally if that does not work, the kernel will panic.
164 .Bd -literal -offset indent
175 The following example
177 will direct the kernel to create a
179 memory disk attached to the file
181 and then mount the ISO CD9660 file system
182 on the md device which was just created.
183 The last line is a comment which is ignored.
184 .Bd -literal -offset indent
186 .Li .md /data/OS-1.0.iso
187 .Li cd9600:/dev/md# ro
188 .Li # Can also use cd9660:/dev/md0 ro
191 The following example
193 will direct the kernel to create a
195 memory disk attached to the file
196 .Pa /data/base.ufs.uzip
197 and then mount the UFS file system
198 on the md uzip device which was just created
202 .Bd -literal -offset indent
203 .Li .md /data/base.ufs.uzip
204 .Li ufs:/dev/md#.uzip ro
205 .Li # Can also use ufs:/dev/md0.uzip ro
208 The following example
210 will direct the kernel to do a unionfs
212 .Pa /jail/freebsd-8-stable
216 .Bd -literal -offset indent
218 .Li unionfs:/jail/freebsd-8-stable
221 For each root file system which is mounted, a
225 exist so that the root mount logic can properly re-mount
227 If this directory does not exist, the system
228 may hang during the bootup process.
240 file first appeared in
244 The root mount logic in the
249 .An Marcel Moolenaar Aq Mt marcel@FreeBSD.org .
250 This man page was written by
251 .An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .