1.\" $NetBSD: rescue.8,v 1.9 2014/03/18 18:20:40 riastradh 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 April 5, 2012 31.Dt RESCUE 8 32.Os 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.Sh HISTORY 123The 124.Nm 125utilities first appeared in 126.Nx 2.0 . 127.Sh AUTHORS 128.An -nosplit 129The 130.Nm 131system was written by 132.An Luke Mewburn Aq Mt lukem@NetBSD.org . 133This manual page was written by 134.An Simon L. Nielsen Aq Mt simon@FreeBSD.org , 135based on text by 136.An Tim Kientzle Aq Mt kientzle@FreeBSD.org . 137