Professional Documents
Culture Documents
Prev
Next
You are unable to boot normally into Red Hat Enterprise Linux (runlevel 3
or 5).
You are having hardware or software problems, and you want to get a few
important files off of your system's hard drive.
However, there may be times when you are unable to get Red Hat
Enterprise Linux running completely enough to access files on your
system's hard drive. Using rescue mode, you can access the files
stored on your system's hard drive, even if you cannot actually run Red
Hat Enterprise Linux from that hard drive.
To boot into rescue mode, you must be able to boot the system using
one of the following methods [14]:
By booting the system from a boot CD-ROM or DVD.
By booting the system from other installation boot media, such
as USB flash devices.
By booting the system from the Red Hat Enterprise Linux
installation DVD.
Once you have booted using one of the described methods, add the
keyword rescue as a kernel parameter. For example, for an x86 system,
type the following command at the installation boot prompt:
linux rescue
This is useful if you need to run commands such as rpm that require
your root partition to be mounted as /. To exit the chroot environment,
type exit to return to the prompt.
If you selected Skip, you can still try to mount a partition or LVM2
logical volume manually inside rescue mode by creating a directory
such as /foo, and typing the following command:
In the above command, /foo is a directory that you have created and
/dev/mapper/VolGroup00-LogVol02 is the LVM2 logical volume you want
to mount. If the partition is of type ext2 or ext3 replace ext4 with ext2
or ext3 respectively.
If you do not know the names of all physical partitions, use the
following command to list them:
fdisk -l
If you do not know the names of all LVM2 physical volumes, volume
groups, or logical volumes, use the pvdisplay, vgdisplay or lvdisplay
commands, respectively.
From the prompt, you can run many useful commands, such as:
ssh, scp, and ping if the network is started
dump and restore for users with tape drives
parted and fdisk for managing partitions
rpm for installing or upgrading software
vi for editing text files
However, there may be times when you are unable to get Red Hat Enterprise Linux
running completely enough to access files on your system's hard drive. Using rescue
mode, you can access the files stored on your system's hard drive, even if you
cannot actually run Red Hat Enterprise Linux from that hard drive.
To boot into rescue mode, you must be able to boot the system using one of the
following methods:
By booting the system from the Red Hat Enterprise Linux CD-ROM #1.
Once you have booted using one of the described methods, add the keyword rescue
as a kernel parameter. For example, for an x86 system, type the following command
at the installation boot prompt:
linuxrescue
You are prompted to answer a few basic questions, including which language to use.
It also prompts you to select where a valid rescue image is located. Select from
Local CD-ROM, Hard Drive, NFS image, FTP, or HTTP. The location selected must
contain a valid installation tree, and the installation tree must be for the same version
of Red Hat Enterprise Linux as the Red Hat Enterprise Linux CD-ROM #1 from which
you booted. If you used a boot CD-ROM or diskette to start rescue mode, the
installation tree must be from the same tree from which the media was created. For
more information about how to setup an installation tree on a hard drive, NFS server,
FTP server, or HTTP server, refer to the Red Hat Enterprise Linux Installation
Guide.
If you select a rescue image that does not require a network connect, you are asked
whether or not you want to establish a network connection. A network connection is
useful if you need to backup files to a different computer or install some RPM
packages from a shared network location, for example.
You will also see the following message:
TherescueenvironmentwillnowattempttofindyourRed
Hat
Linuxinstallationandmountitunderthedirectory
/mnt/sysimage.Youcanthenmakeanychangesrequiredto
your
system.Ifyouwanttoproceedwiththisstepchoose
'Continue'.Youcanalsochoosetomountyourfile
systems
readonlyinsteadofreadwritebychoosing'Readonly'.
Ifforsomereasonthisprocessfailsyoucanchoose
'Skip'
andthisstepwillbeskippedandyouwillgodirectlyto
a
commandshell.
If you select Continue , it attempts to mount your file system under the directory
/mnt/sysimage/.
it attempts to mount your file system under the directory /mnt/sysimage/, but in readonly mode. If you select Skip , your file system is not mounted. Choose Skip if you
think your file system is corrupted.
Once you have your system in rescue mode, a prompt appears on VC (virtual
console) 1 and VC 2 (use the [Ctrl]-[Alt]-[F1] key combination to access VC 1 and
[Ctrl]-[Alt]-[F2] to access VC 2):
sh-2.05b#
If you selected Continue to mount your partitions automatically and they were
mounted successfully, you are in single-user mode.
Even if your file system is mounted, the default root partition while in rescue mode is
a temporary root partition, not the root partition of the file system used during normal
user mode (runlevel 3 or 5). If you selected to mount your file system and it mounted
successfully, you can change the root partition of the rescue mode environment to
the root partition of your file system by executing the following command:
chroot/mnt/sysimage
This is useful if you need to run commands such as rpm that require your root
partition to be mounted as /. To exit the chroot environment, type exit, and you will
return to the prompt.
If you selected Skip , you can still try to mount a partition manually inside rescue
mode by creating a directory such as /foo, and typing the following command:
mounttext3/dev/hda5/foo
In the above command, /foo is a directory that you have created and /dev/hda5 is
the partition you want to mount. If the partition is of type ext2, replace ext3 with ext2.
If you do not know the names of your partitions, use the following command to list
them:
fdiskl
From the prompt, you can run many useful commands such as
listharddrives
ssh, scp,
dump
parted
rpm
joe
for editing configuration files (If you try to start other popular editors such
as emacs, pico, or vi, the joe editor will be started.)
Notes