xref: /freebsd/share/man/man8/rescue.8 (revision 193d9e768ba63fcfb187cfd17f461f7d41345048)
1.\" Copyright (c) 2003 Tim Kientzle <kientzle@acm.org>
2.\" Copyright (c) 2003 Simon L. Nielsen <simon@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
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.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd July 23, 2003
29.Dt RESCUE 8
30.Os
31.Sh NAME
32.Nm rescue
33.Nd rescue utilities in
34.Pa /rescue
35.Sh DESCRIPTION
36The
37.Pa /rescue
38directory contains a collection of common utilities intended for use
39in recovering a badly damaged system.
40With the transition to a dynamically-linked root beginning with
41.Fx 5.2 ,
42there is a real possibility that the standard tools in
43.Pa /bin
44and
45.Pa /sbin
46may become non-functional due to a failed upgrade or a disk error.
47The tools in
48.Pa /rescue
49are statically linked and should therefore be more resistant to
50damage.
51However, being statically linked, the tools in
52.Pa /rescue
53are also less functional than the standard utilities.
54In particular, they do not have full use of the locale,
55.Xr pam 3 ,
56and nsswitch libraries.
57.Pp
58If your system fails to boot, and it shows a prompt similar to:
59.Pp
60.Dl "Enter full pathname of shell or RETURN for /bin/sh: "
61.Pp
62the first thing to try running is the standard shell,
63.Pa /bin/sh .
64If that fails, try running
65.Pa /rescue/sh ,
66which is the
67.Nm
68shell.
69To repair the system, the root partition must first be remounted
70read-write.
71This can be done with the following
72.Xr mount 8
73command:
74.Pp
75.Dl "/rescue/mount -uw /"
76.Pp
77The next step is to double-check the contents of
78.Pa /bin , /sbin ,
79and
80.Pa /usr/lib ,
81possibly mounting a
82.Fx
83rescue or
84.Dq "live file system"
85CD-ROM (e.g.,
86.Li disc2
87of the officially released
88.Fx
89ISO images) and copying files from there.
90Once it is possible to successfully run
91.Pa /bin/sh , /bin/ls ,
92and other standard utilities, try rebooting back into the standard
93system.
94.Pp
95The
96.Pa /rescue
97tools are compiled using
98.Xr crunchgen 1 ,
99which makes them considerably more compact than the standard
100utilities.
101To build a
102.Fx
103system where space is critical,
104.Pa /rescue
105can be used as a replacement for the standard
106.Pa /bin
107and
108.Pa /sbin
109directories; simply change
110.Pa /bin
111and
112.Pa /sbin
113to be symbolic links pointing to
114.Pa /rescue .
115Since
116.Pa /rescue
117is statically linked, it should also be possible to dispense with much
118of
119.Pa /usr/lib
120in such an environment.
121.Pp
122In contrast to its predecessor
123.Pa /stand ,
124.Pa /rescue
125is updated during normal
126.Fx
127source and binary upgrades.
128.Sh FILES
129.Bl -tag -width ".Pa /rescue" -compact
130.It Pa /rescue
131Root of the
132.Nm
133hierarchy.
134.El
135.Sh SEE ALSO
136.Xr crunchgen 1 ,
137.Xr crash 8
138.Sh HISTORY
139The
140.Nm
141utilities first appeared in
142.Fx 5.2 .
143.Sh AUTHORS
144.An -nosplit
145The
146.Nm
147system was written by
148.An Tim Kientzle Aq Mt kientzle@FreeBSD.org ,
149based on ideas taken from
150.Nx .
151This manual page was written by
152.An Simon L. Nielsen Aq Mt simon@FreeBSD.org ,
153based on text by
154.An Tim Kientzle Aq Mt kientzle@FreeBSD.org .
155.Sh BUGS
156Most of the
157.Nm
158tools work even in a fairly crippled system.
159The most egregious exception is the
160.Nm
161version of
162.Xr vi 1 ,
163which currently requires that
164.Pa /usr
165be mounted so that it can access the
166.Xr termcap 5
167files.
168Hopefully, a failsafe
169.Xr termcap 3
170entry will eventually be added into the
171.Xr ncurses 3
172library, so that
173.Pa /rescue/vi
174can be used even in a system where
175.Pa /usr
176cannot immediately be mounted.
177In the meantime, the
178.Nm
179version of the
180.Xr ed 1
181editor can be used from
182.Pa /rescue/ed
183if you need to edit files, but cannot mount
184.Pa /usr .
185