Восстановление linux red hat

Chapter 33. System Recovery

Red Hat Enterprise Linux 6 offers three system recovery modes, rescue mode , single-user mode , and emergency mode that can be used to repair malfunctioning systems. This chapter describes how to boot into each system recovery mode and gives guidance to resolve certain problems that can only be solved with help of system recovery modes.

You need to resolve hardware or software problems that cannot be resolved while the system is running normally, or you want to access some important files off of your hard drive.

Some of the problems behind are further discussed in Section 33.4, “Resolving Problems in System Recovery Modes”.

33.1. Rescue Mode

Rescue mode provides the ability to boot a small Red Hat Enterprise Linux environment entirely from external media, such as CD-ROM or USB drive, instead of the system’s hard drive. It contains command-line utilities for repairing a wide variety of issues. In this mode, you can mount file systems as read-only or even to not mount them at all, blacklist or add drivers provided on a driver disc, install or upgrade system packages, or manage partitions.

Procedure 33.1. Booting into Rescue Mode

Boot the system from either minimal boot media, or a full installation DVD or USB drive, and wait for the boot menu to appear. For details about booting the system from the chosen media, see the respective chapters in the Installation Guide.

From the boot menu, append the rescue keyword as a kernel parameter to the boot command line.

If your system requires a third-party driver provided on a driver disc to boot, append the additional option dd to the boot command line to load that driver:

For more information about using a disc driver at boot time, see the respective chapters in the Installation Guide.

If a driver that is a part of the Red Hat Enterprise Linux 6 distribution prevents the system from booting, blacklist that driver by appending the rdblacklist option to the boot command line:

rescue rdblacklist=driver_name

Answer a few basic questions and select the location of a valid rescue image as you are prompted to. Select the relevant type from Local CD-ROM , Hard Drive , NFS image , FTP , or HTTP . The selected location must contain a valid installation tree, and the installation tree must be for the same version of Red Hat Enterprise Linux as is the disk from which you booted. For more information about how to setup an installation tree on a hard drive, NFS server, FTP server, or HTTP server, see the respective chapters in the Installation Guide.

If you select a rescue image that does not require a network connection, 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.

The rescue environment will now attempt to find your Linux installation and mount it under the directory /mnt/sysimage. You can then make any changes required to your system. If you want to proceed with this step choose 'Continue'. You can also choose to mount your file systems read-only instead of read-write by choosing 'Read-only'. If for some reason this process fails you can choose 'Skip' and this step will be skipped and you will go directly to a command shell.

If you select Continue , the system attempts to mount your root partition under the /mnt/sysimage/ directory. The root partition typically contains several file systems, such as /home/ , /boot/ , and /var/ , which are automatically mounted to the correct locations. If mounting the partition fails, you will be notified. If you select Read-Only , the system attempts to mount your file systems under the directory /mnt/sysimage/ , but in read-only mode. If you select Skip , your file systems will not be mounted. Choose Skip if you think your file system is corrupted.

Читайте также:  Checking memory usage in linux

Once you have your system in rescue mode, the following prompt appears on the virtual console (VC) 1 and VC 2. Use the CtrlAltF1 key combination to access VC 1 and CtrlAltF2 to access VC 2:

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:

sh-3.00b# 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 to return to the prompt.

If you selected Skip , you can still try to mount a partition or a LVM2 logical volume manually inside rescue mode by creating a directory and typing the following command:

sh-3.00b# mkdir /directory sh-3.00b# mount -t ext4 /dev/mapper/VolGroup00-LogVol02 /directory

where /directory 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 ext2 or ext3 type, replace ext4 with ext2 or ext3 respectively.

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.

Источник

Глава 26. Основы восстановления системы

Если в работе системы возникают проблемы, существуют способы их исправить. Однако эти способы требуют достаточно хорошего понимания системы. В этой главе описывается, как загрузиться в режиме восстановления, монопольном и аварийном режиме, чтобы исправить систему.

26.1. Распространенные проблемы

You are having hardware or software problems, and you want to get a few important files off of your system’s hard drive.

Читайте также:  Life linux на флешку

26.1.1. Невозможно загрузить Red Hat Enterprise Linux

Эта проблема часто возникает в результате установки другой операционной системы после установки Red Hat Enterprise Linux. Некоторые другие операционные системы предполагают, что никакие операционные системы на компьютере не установлены, и переписывают главную загрузочную запись (Master Boot Record, MBR), до этого содержащую загрузчик GRUB. Если загрузчик был переписан, вы не сможете загрузить Red Hat Enterprise Linux, пока не попадете в режим восстановления и не перенастроите загрузчик.

Другая распространенная проблема возникает, если вы с помощью инструмента разбиения диска измените размер раздела после установки или создадите новый раздел, используя свободное место, и это повлияет на порядок ваших разделов. Если номер раздела вашего каталога / изменяется, загрузчик может не найти его, чтобы смонтировать этот раздел. Чтобы исправить эту проблему, загрузитесь в режиме восстановления и измените файл /boot/grub/grub.conf .

For instructions on how to reinstall the GRUB boot loader from a rescue environment, refer to Раздел 26.2.1, «Переустановка загрузчика».

26.1.2. Аппаратные или программные проблемы

В эту категорию входят самые разные ситуации. Например, это может быть отказ жестких дисков или указание неверного ядра или корневого устройства в файле конфигурации загрузчика. В любой из этих ситуаций вы не сможете загрузить Red Hat Enterprise Linux. Но если вы загрузитесь в одном из режимов восстановления системы, вы сможете решить проблему или как минимум сделать копии важных файлов.

26.1.3. Пароль root

Что делать, если вы забыли пароль root? Его можно сменить, загрузившись в режиме восстановления или в монопольном режиме и воспользовавшись командой passwd .

Источник

Chapter 7. Recovering and restoring a system

To recover and restore a system using an existing backup, Red Hat Enterprise Linux provides the Relax-and-Recover (ReaR) utility.

You can use the utility as a disaster recovery solution and also for system migration.

The utility enables you to perform the following tasks:

  • Produce a bootable image and restore the system from an existing backup, using the image.
  • Replicate the original storage layout.
  • Restore user and system files.
  • Restore the system to a different hardware.

Additionally, for disaster recovery, you can also integrate certain backup software with ReaR.

Setting up ReaR involves the following high-level steps:

  1. Install ReaR.
  2. Modify ReaR configuration file, to add backup method details.
  3. Create rescue system.
  4. Generate backup files.

7.1. Setting up ReaR

Use the following steps to install the package for using the Relax-and-Recover (ReaR) utility, create a rescue system, configure and generate a backup.

Prerequisites

  • Necessary configurations as per the backup restore plan are ready. Note that you can use the NETFS backup method, a fully-integrated and built-in method with ReaR.

    Install the ReaR utility by running the following command:

BACKUP=NETFS BACKUP_URL=backup.location
NETFS_KEEP_OLD_BACKUP_COPY=y

Alternatively, you can create the rescue system and the backup in a single step by running the following command:

7.2. Using a ReaR rescue image on the 64-bit IBM Z architecture

Basic Relax and Recover (ReaR) functionality is now available on the 64-bit IBM Z architecture as a Technology Preview. You can create a ReaR rescue image on IBM Z only in the z/VM environment. Backing up and recovering logical partitions (LPARs) has not been tested.

ReaR on the 64-bit IBM Z architecture is supported only with the rear package version 2.6-17.el9 or later. Earlier versions are available as a Technology Preview feature only. For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview.

Читайте также:  Extracting exe files in linux

The only output method currently available is Initial Program Load (IPL). IPL produces a kernel and an initial RAM disk (initrd) that can be used with the zIPL boot loader.

Prerequisites

Add the following variables to the /etc/rear/local.conf to configure ReaR for producing a rescue image on the 64-bit IBM Z architecture:

  1. To configure the IPL output method, add OUTPUT=IPL .
  2. To configure the backup method and destination, add BACKUP and BACKUP_URL variables. For example:

BACKUP=NETFS BACKUP_URL=nfs:// /

Currently, the rescue process reformats all the DASDs (Direct Attached Storage Devices) connected to the system. Do not attempt a system recovery if there is any valuable data present on the system storage devices. This also includes the device prepared with the zipl boot loader, ReaR kernel, and initrd that were used to boot into the rescue environment. Ensure to keep a copy.

Additional resources

Источник

Chapter 27. Basic System Recovery

When things go wrong, there are ways to fix problems. However, these methods require that you understand the system well. This chapter describes how to boot into rescue mode, single-user mode, and emergency mode, where you can use your own knowledge to repair the system.

27.1. Common Problems

You are having hardware or software problems, and you want to get a few important files off of your system’s hard drive.

27.1.1. Unable to Boot into Red Hat Enterprise Linux

This problem is often caused by the installation of another operating system after you have installed Red Hat Enterprise Linux. Some other operating systems assume that you have no other operating system(s) on your computer. They overwrite the Master Boot Record (MBR) that originally contained the GRUB boot loader. If the boot loader is overwritten in this manner, you cannot boot Red Hat Enterprise Linux unless you can get into rescue mode and reconfigure the boot loader.

Another common problem occurs when using a partitioning tool to resize a partition or create a new partition from free space after installation, and it changes the order of your partitions. If the partition number of your / partition changes, the boot loader might not be able to find it to mount the partition. To fix this problem, boot in rescue mode and modify the /boot/grub/grub.conf file.

For instructions on how to reinstall the GRUB boot loader from a rescue environment, refer to Section 27.2.1, “Reinstalling the Boot Loader”.

27.1.2. Hardware/Software Problems

This category includes a wide variety of different situations. Two examples include failing hard drives and specifying an invalid root device or kernel in the boot loader configuration file. If either of these occur, you might not be able to reboot into Red Hat Enterprise Linux. However, if you boot into one of the system recovery modes, you might be able to resolve the problem or at least get copies of your most important files.

27.1.3. Root Password

What can you do if you forget your root password? To reset it to a different password, boot into rescue mode or single-user mode, and use the passwd command to reset the root password.

Источник

Оцените статью
Adblock
detector