1.\" $NetBSD: rescue.8,v 1.4 2008/10/20 07:06:21 wiz Exp $ 2.\" 3.\" Copyright (c) 2003 Tim Kientzle <kientzle@acm.org> 4.\" Copyright (c) 2003 Simon L. Nielsen <simon@FreeBSD.org> 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" FreeBSD: src/share/man/man8/rescue.8,v 1.3 2005/11/10 15:42:51 kientzle Exp 29.\" 30.Dd October 20, 2008 31.Os 32.Dt RESCUE 8 33.Sh NAME 34.Nm rescue 35.Nd rescue utilities in 36.Pa /rescue 37.Sh DESCRIPTION 38The 39.Pa /rescue 40directory contains a collection of common utilities intended for use 41in recovering a badly damaged system. 42With the transition to a dynamically-linked root beginning with 43.Nx 2.0 , 44there is a real possibility that the standard tools in 45.Pa /bin 46and 47.Pa /sbin 48may become non-functional due to a failed upgrade or a disk error. 49The tools in 50.Pa /rescue 51are statically linked and should therefore be more resistant to 52damage. 53However, being statically linked, the tools in 54.Pa /rescue 55are also less functional than the standard utilities. 56In particular, they do not have full use of the locale, 57.Xr pam 3 , 58and nsswitch libraries. 59.Pp 60If your system fails to boot, and it shows an error message similar to: 61.Pp 62.Dl "init: not found" 63.Pp 64try booting the system with the boot flag 65.Dq Fl a 66and supplying 67.Pa /rescue/init , 68which is the 69.Nm 70.Xr init 8 , 71as the init path. 72.Pp 73If your system fails to boot, and it shows a prompt similar to: 74.Pp 75.Dl "Enter full pathname of shell or RETURN for /bin/sh: " 76.Pp 77the first thing to try running is the standard shell, 78.Pa /bin/sh . 79If that fails, try running 80.Pa /rescue/sh , 81which is the 82.Nm 83shell. 84To repair the system, the root partition must first be remounted 85read-write. 86This can be done with the following 87.Xr mount 8 88command: 89.Pp 90.Dl "/rescue/mount -uw /" 91.Pp 92The next step is to double-check the contents of 93.Pa /bin , 94.Pa /lib , 95.Pa /libexec , 96and 97.Pa /sbin , 98possibly mounting a 99.Nx 100installation CD-ROM 101and copying files from there. 102Once it is possible to successfully run 103.Pa /bin/sh , /bin/ls , 104and other standard utilities, try rebooting back into the standard 105system. 106.Pp 107The 108.Pa /rescue 109tools are compiled using 110.Xr crunchgen 1 , 111which makes them considerably more compact than the standard 112utilities. 113.Sh FILES 114.Bl -tag -width ".Pa /rescue" -compact 115.It Pa /rescue 116Root of the 117.Nm 118hierarchy. 119.El 120.Sh SEE ALSO 121.Xr crunchgen 1 , 122.Xr crash 8 123.Sh HISTORY 124The 125.Nm 126utilities first appeared in 127.Nx 2.0 . 128.Sh AUTHORS 129.An -nosplit 130The 131.Nm 132system was written by 133.An Luke Mewburn Aq lukem@NetBSD.org . 134This manual page was written by 135.An Simon L. Nielsen Aq simon@FreeBSD.org , 136based on text by 137.An Tim Kientzle Aq kientzle@FreeBSD.org . 138.Sh BUGS 139Most of the 140.Nm 141tools work even in a fairly crippled system. 142The most egregious exception is the 143.Nm 144version of 145.Xr vi 1 , 146which currently requires that 147.Pa /usr 148be mounted so that it can access the 149.Xr termcap 5 150files. 151Hopefully, a failsafe 152.Xr termcap 3 153entry will eventually be added into the 154.Xr curses 3 155library, so that 156.Pa /rescue/vi 157can be used even in a system where 158.Pa /usr 159cannot immediately be mounted. 160In the meantime, the 161.Nm 162version of the 163.Xr ed 1 164editor can be used from 165.Pa /rescue/ed 166if you need to edit files, but cannot mount 167.Pa /usr . 168