Mount the file system in Linux
Before performing any operations in Rescue mode, you must mount the OS file system. If the disk with the system partition is mounted in a hardware RAID controller, use the instructions with disk partitioning without software RAID. If the system partition is in LVM, use the instructions for the system with LVM.
Mount the file system with infiltrate-root
Disk partitioning without software RAID
Disk partitioning with software RAID
System without LVM
System with LVM
-
Print information about the partitions on the disks:
lsblkThe response will show information about the partitions on the disks. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSsda 8:0 0 2.9G 0 disk└─sda1 8:1 0 2.9G 0 partsdb 8:16 0 160G 0 disk├─sdb1 8:17 0 159.9G 0 part├─sdb14 8:30 0 4M 0 part└─sdb15 8:31 0 106M 0 partHere
sda1,sdb1,sdb14,sdb15are partition names on the disks. -
Select the system partition, usually the largest partition on the disk. In the example in step 2, this is the
sdb1partition. -
Mount the file system:
infiltrate-root /dev/<partition>Specify
<partition>is the name of the partition on the disk you selected in step 3, in the example it issdb1.The partition will be mounted in the
/newrootdirectory. -
If the
infiltrate-rootcommand does not work, mount the file system manually. -
Perform recovery and diagnostic work.
-
Log out of the environment after the job is complete. The file system will be unmounted automatically:
exit
Mount the file system manually
Disk partitioning without software RAID
Disk partitioning with software RAID
System without LVM
System with LVM
-
Print information about the partitions on the disks:
lsblkThe response will show information about the partitions on the disks. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSsda 8:0 0 2.9G 0 disk└─sda1 8:1 0 2.9G 0 partsdb 8:16 0 160G 0 disk├─sdb1 8:17 0 159.9G 0 part├─sdb14 8:30 0 4M 0 part└─sdb15 8:31 0 106M 0 partHere
sda1,sdb1,sdb14,sdb15are partition names on the disks. -
Select the system partition, usually the largest partition on the disk. In the example in step 2, this is the
sdb1partition. -
Mount the file system to the
/mntdirectory:mount /dev/<partition> /mntSpecify
<partition>is the name of the system partition on the disk you selected in step 3, in the example it issdb1. -
Mount the service file systems:
mount -t proc /proc /mnt/procmount -t sysfs /sys /mnt/sysmount --bind /dev /mnt/devmount -t devpts /dev/pts /mnt/dev/pts -
Connect to the environment:
chroot /mnt /bin/bash -
Export the PATH variable:
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin -
Perform recovery and diagnostic work.
-
Exit the environment when the work is complete:
exit -
Unmount the service file systems:
umount -t devpts /dev/pts /mnt/dev/ptsumount --bind /dev /mnt/devumount -t sysfs /sys /mnt/sysumount -t proc /proc /mnt/proc -
Unmount the file system:
umount /dev/<partition> /mntSpecify
<partition>is the name of the system partition whose file system you mounted in step 4, in the example it issdb1.