xref: /freebsd/share/man/man8/rescue.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
161860dd7SSimon L. B. Nielsen.\" Copyright (c) 2003 Tim Kientzle <kientzle@acm.org>
261860dd7SSimon L. B. Nielsen.\" Copyright (c) 2003 Simon L. Nielsen <simon@FreeBSD.org>
361860dd7SSimon L. B. Nielsen.\" All rights reserved.
461860dd7SSimon L. B. Nielsen.\"
561860dd7SSimon L. B. Nielsen.\" Redistribution and use in source and binary forms, with or without
661860dd7SSimon L. B. Nielsen.\" modification, are permitted provided that the following conditions
761860dd7SSimon L. B. Nielsen.\" are met:
861860dd7SSimon L. B. Nielsen.\" 1. Redistributions of source code must retain the above copyright
961860dd7SSimon L. B. Nielsen.\"    notice, this list of conditions and the following disclaimer.
1061860dd7SSimon L. B. Nielsen.\" 2. Redistributions in binary form must reproduce the above copyright
1161860dd7SSimon L. B. Nielsen.\"    notice, this list of conditions and the following disclaimer in the
1261860dd7SSimon L. B. Nielsen.\"    documentation and/or other materials provided with the distribution.
1361860dd7SSimon L. B. Nielsen.\"
1461860dd7SSimon L. B. Nielsen.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
1561860dd7SSimon L. B. Nielsen.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1661860dd7SSimon L. B. Nielsen.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1761860dd7SSimon L. B. Nielsen.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
1861860dd7SSimon L. B. Nielsen.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1961860dd7SSimon L. B. Nielsen.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2061860dd7SSimon L. B. Nielsen.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2161860dd7SSimon L. B. Nielsen.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2261860dd7SSimon L. B. Nielsen.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2361860dd7SSimon L. B. Nielsen.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2461860dd7SSimon L. B. Nielsen.\" SUCH DAMAGE.
2561860dd7SSimon L. B. Nielsen.\"
26*7963c02cSMateusz Piotrowski.Dd June 30, 2022
2761860dd7SSimon L. B. Nielsen.Dt RESCUE 8
28aa12cea2SUlrich Spörlein.Os
2961860dd7SSimon L. B. Nielsen.Sh NAME
3061860dd7SSimon L. B. Nielsen.Nm rescue
3161860dd7SSimon L. B. Nielsen.Nd rescue utilities in
3261860dd7SSimon L. B. Nielsen.Pa /rescue
3361860dd7SSimon L. B. Nielsen.Sh DESCRIPTION
3461860dd7SSimon L. B. NielsenThe
3561860dd7SSimon L. B. Nielsen.Pa /rescue
3661860dd7SSimon L. B. Nielsendirectory contains a collection of common utilities intended for use
3761860dd7SSimon L. B. Nielsenin recovering a badly damaged system.
3861860dd7SSimon L. B. NielsenWith the transition to a dynamically-linked root beginning with
3961860dd7SSimon L. B. Nielsen.Fx 5.2 ,
4061860dd7SSimon L. B. Nielsenthere is a real possibility that the standard tools in
4161860dd7SSimon L. B. Nielsen.Pa /bin
4261860dd7SSimon L. B. Nielsenand
4361860dd7SSimon L. B. Nielsen.Pa /sbin
4461860dd7SSimon L. B. Nielsenmay become non-functional due to a failed upgrade or a disk error.
4561860dd7SSimon L. B. NielsenThe tools in
4661860dd7SSimon L. B. Nielsen.Pa /rescue
4761860dd7SSimon L. B. Nielsenare statically linked and should therefore be more resistant to
4861860dd7SSimon L. B. Nielsendamage.
4961860dd7SSimon L. B. NielsenHowever, being statically linked, the tools in
5061860dd7SSimon L. B. Nielsen.Pa /rescue
5161860dd7SSimon L. B. Nielsenare also less functional than the standard utilities.
5261860dd7SSimon L. B. NielsenIn particular, they do not have full use of the locale,
5361860dd7SSimon L. B. Nielsen.Xr pam 3 ,
5461860dd7SSimon L. B. Nielsenand nsswitch libraries.
5561860dd7SSimon L. B. Nielsen.Pp
5661860dd7SSimon L. B. NielsenIf your system fails to boot, and it shows a prompt similar to:
5761860dd7SSimon L. B. Nielsen.Pp
5861860dd7SSimon L. B. Nielsen.Dl "Enter full pathname of shell or RETURN for /bin/sh: "
5961860dd7SSimon L. B. Nielsen.Pp
6061860dd7SSimon L. B. Nielsenthe first thing to try running is the standard shell,
6161860dd7SSimon L. B. Nielsen.Pa /bin/sh .
6261860dd7SSimon L. B. NielsenIf that fails, try running
6361860dd7SSimon L. B. Nielsen.Pa /rescue/sh ,
6461860dd7SSimon L. B. Nielsenwhich is the
6561860dd7SSimon L. B. Nielsen.Nm
6661860dd7SSimon L. B. Nielsenshell.
6761860dd7SSimon L. B. NielsenTo repair the system, the root partition must first be remounted
6861860dd7SSimon L. B. Nielsenread-write.
6961860dd7SSimon L. B. NielsenThis can be done with the following
7061860dd7SSimon L. B. Nielsen.Xr mount 8
7161860dd7SSimon L. B. Nielsencommand:
7261860dd7SSimon L. B. Nielsen.Pp
7361860dd7SSimon L. B. Nielsen.Dl "/rescue/mount -uw /"
7461860dd7SSimon L. B. Nielsen.Pp
7561860dd7SSimon L. B. NielsenThe next step is to double-check the contents of
7661860dd7SSimon L. B. Nielsen.Pa /bin , /sbin ,
7761860dd7SSimon L. B. Nielsenand
7861860dd7SSimon L. B. Nielsen.Pa /usr/lib ,
7961860dd7SSimon L. B. Nielsenpossibly mounting a
8061860dd7SSimon L. B. Nielsen.Fx
8161860dd7SSimon L. B. Nielsenrescue or
8261860dd7SSimon L. B. Nielsen.Dq "live file system"
83*7963c02cSMateusz PiotrowskiCD-ROM and copying files from there.
8461860dd7SSimon L. B. NielsenOnce it is possible to successfully run
8561860dd7SSimon L. B. Nielsen.Pa /bin/sh , /bin/ls ,
8661860dd7SSimon L. B. Nielsenand other standard utilities, try rebooting back into the standard
8761860dd7SSimon L. B. Nielsensystem.
8861860dd7SSimon L. B. Nielsen.Pp
8961860dd7SSimon L. B. NielsenThe
9061860dd7SSimon L. B. Nielsen.Pa /rescue
9161860dd7SSimon L. B. Nielsentools are compiled using
9261860dd7SSimon L. B. Nielsen.Xr crunchgen 1 ,
9361860dd7SSimon L. B. Nielsenwhich makes them considerably more compact than the standard
9461860dd7SSimon L. B. Nielsenutilities.
9561860dd7SSimon L. B. NielsenTo build a
9661860dd7SSimon L. B. Nielsen.Fx
9761860dd7SSimon L. B. Nielsensystem where space is critical,
9861860dd7SSimon L. B. Nielsen.Pa /rescue
9961860dd7SSimon L. B. Nielsencan be used as a replacement for the standard
10061860dd7SSimon L. B. Nielsen.Pa /bin
10161860dd7SSimon L. B. Nielsenand
10261860dd7SSimon L. B. Nielsen.Pa /sbin
10361860dd7SSimon L. B. Nielsendirectories; simply change
10461860dd7SSimon L. B. Nielsen.Pa /bin
10561860dd7SSimon L. B. Nielsenand
10661860dd7SSimon L. B. Nielsen.Pa /sbin
10761860dd7SSimon L. B. Nielsento be symbolic links pointing to
10861860dd7SSimon L. B. Nielsen.Pa /rescue .
10961860dd7SSimon L. B. NielsenSince
11061860dd7SSimon L. B. Nielsen.Pa /rescue
11161860dd7SSimon L. B. Nielsenis statically linked, it should also be possible to dispense with much
11261860dd7SSimon L. B. Nielsenof
11361860dd7SSimon L. B. Nielsen.Pa /usr/lib
11461860dd7SSimon L. B. Nielsenin such an environment.
11561860dd7SSimon L. B. Nielsen.Pp
11661860dd7SSimon L. B. NielsenIn contrast to its predecessor
11761860dd7SSimon L. B. Nielsen.Pa /stand ,
11861860dd7SSimon L. B. Nielsen.Pa /rescue
11961860dd7SSimon L. B. Nielsenis updated during normal
12061860dd7SSimon L. B. Nielsen.Fx
12161860dd7SSimon L. B. Nielsensource and binary upgrades.
12261860dd7SSimon L. B. Nielsen.Sh FILES
12361860dd7SSimon L. B. Nielsen.Bl -tag -width ".Pa /rescue" -compact
12461860dd7SSimon L. B. Nielsen.It Pa /rescue
12561860dd7SSimon L. B. NielsenRoot of the
12661860dd7SSimon L. B. Nielsen.Nm
12761860dd7SSimon L. B. Nielsenhierarchy.
12861860dd7SSimon L. B. Nielsen.El
12961860dd7SSimon L. B. Nielsen.Sh SEE ALSO
13061860dd7SSimon L. B. Nielsen.Xr crunchgen 1 ,
13161860dd7SSimon L. B. Nielsen.Xr crash 8
13261860dd7SSimon L. B. Nielsen.Sh HISTORY
13361860dd7SSimon L. B. NielsenThe
13461860dd7SSimon L. B. Nielsen.Nm
13561860dd7SSimon L. B. Nielsenutilities first appeared in
13661860dd7SSimon L. B. Nielsen.Fx 5.2 .
13761860dd7SSimon L. B. Nielsen.Sh AUTHORS
13861860dd7SSimon L. B. Nielsen.An -nosplit
13961860dd7SSimon L. B. NielsenThe
14061860dd7SSimon L. B. Nielsen.Nm
14161860dd7SSimon L. B. Nielsensystem was written by
142a63d6c94SBaptiste Daroussin.An Tim Kientzle Aq Mt kientzle@FreeBSD.org ,
1434a483830STim Kientzlebased on ideas taken from
1444a483830STim Kientzle.Nx .
14561860dd7SSimon L. B. NielsenThis manual page was written by
146a63d6c94SBaptiste Daroussin.An Simon L. Nielsen Aq Mt simon@FreeBSD.org ,
14761860dd7SSimon L. B. Nielsenbased on text by
148a63d6c94SBaptiste Daroussin.An Tim Kientzle Aq Mt kientzle@FreeBSD.org .
14961860dd7SSimon L. B. Nielsen.Sh BUGS
15061860dd7SSimon L. B. NielsenMost of the
15161860dd7SSimon L. B. Nielsen.Nm
15261860dd7SSimon L. B. Nielsentools work even in a fairly crippled system.
15361860dd7SSimon L. B. NielsenThe most egregious exception is the
15461860dd7SSimon L. B. Nielsen.Nm
15561860dd7SSimon L. B. Nielsenversion of
15661860dd7SSimon L. B. Nielsen.Xr vi 1 ,
15761860dd7SSimon L. B. Nielsenwhich currently requires that
15861860dd7SSimon L. B. Nielsen.Pa /usr
15961860dd7SSimon L. B. Nielsenbe mounted so that it can access the
16061860dd7SSimon L. B. Nielsen.Xr termcap 5
16161860dd7SSimon L. B. Nielsenfiles.
16261860dd7SSimon L. B. NielsenHopefully, a failsafe
16361860dd7SSimon L. B. Nielsen.Xr termcap 3
16461860dd7SSimon L. B. Nielsenentry will eventually be added into the
16561860dd7SSimon L. B. Nielsen.Xr ncurses 3
16661860dd7SSimon L. B. Nielsenlibrary, so that
16761860dd7SSimon L. B. Nielsen.Pa /rescue/vi
16861860dd7SSimon L. B. Nielsencan be used even in a system where
16961860dd7SSimon L. B. Nielsen.Pa /usr
17061860dd7SSimon L. B. Nielsencannot immediately be mounted.
17161860dd7SSimon L. B. NielsenIn the meantime, the
17261860dd7SSimon L. B. Nielsen.Nm
17361860dd7SSimon L. B. Nielsenversion of the
17461860dd7SSimon L. B. Nielsen.Xr ed 1
17561860dd7SSimon L. B. Nielseneditor can be used from
17661860dd7SSimon L. B. Nielsen.Pa /rescue/ed
17761860dd7SSimon L. B. Nielsenif you need to edit files, but cannot mount
17861860dd7SSimon L. B. Nielsen.Pa /usr .
179