CentOS / Redhat: Chroot And Mount Raid Or Actual Hard Disk From Rescue Kernel / CD

www.‮iruttual‬.com
CentOS / Redhat: Chroot And Mount Raid Or Actual Hard Disk From Rescue Kernel / CD

To chroot and mount a RAID array or an actual hard disk from a rescue kernel or CD on a CentOS or Red Hat Enterprise Linux (RHEL) system, you can follow these steps:

  1. Boot the system from the rescue kernel or CD.

  2. Identify the device name for the RAID array or hard disk that you want to mount. You can use the fdisk -l command to list the available block devices:

fdisk -l

This will display a list of the available block devices, including the device names and the partition table type.

  1. Create a mount point for the RAID array or hard disk. For example:
mkdir /mnt/root

This will create a directory called /mnt/root that will be used as the mount point for the RAID array or hard disk.

  1. Mount the RAID array or hard disk to the mount point. For example, to mount the device /dev/sda1 to the /mnt/root mount point:
mount /dev/sda1 /mnt/root
  1. Change the root directory to the mount point using the chroot command:
chroot /mnt/root

This will change the root directory to the mount point, which will allow you to access the files and directories on the RAID array or hard disk.

  1. You can now access the files and directories on the RAID array or hard disk as if you were logged into the system normally. For example, to list the directories in the root directory:
ls -l /

Note: The chroot command allows you to change the root directory of the system, which means that you can access the files and directories on the RAID array or hard disk as if they were on the root of the file system. This can be useful for troubleshooting or repairing a system when you cannot boot into the normal operating system. Consult the documentation for the chroot command for more information on how to use this tool.

Note: It is important to be careful when working with the file system from a rescue kernel or CD, as there is a risk of data loss or corruption if you make changes to the file system. It is a good idea to make a backup of any important data before making any changes to the file system.

Created Time:2017-10-16 14:38:41  Author:lautturi