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 connected to a hardware RAID controller, use the instructions with disk partitioning without software RAID.
Disk partitioning without software RAID
Disk partitioning with software RAID
-
Print information about the partitions on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 2.9G 0 disk
└─sda1 8:1 0 2.9G 0 part
sdb 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
,sdb15
— partitions on the disk. -
Select the system partition, usually the largest partition on the disk. In the example in step 2, this is the partition
sdb1
. -
Mount the file system:
infiltrate-root /dev/<partition>
Specify
<partition>
— partition on the disk you selected in step 3.The partition will be mounted in the directory
/newroot
. -
If the command
infiltrate-root
doesn't 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
-
Check if the system has detected RAID arrays, to do this, display the partition information on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sda2 8:2 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1
sdb 8:16 0 447.1G 0 disk
├─sdb1 8:17 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sdb2 8:18 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1Here.
md0
,md1
— RAID arrays on disk partitions. -
If in step 2 in the output
lsblk
there are RAID arrays, skip this step. If there are no RAID arrays, start RAID build:mdadm --assemble --scan
-
Print information about the partitions on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sda2 8:2 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1
sdb 8:16 0 447.1G 0 disk
├─sdb1 8:17 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sdb2 8:18 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1Here.
md0
,md1
— RAID arrays on disk partitions. -
Select the system RAID array, usually the largest RAID array. In the example in step 4, this is
md1
. -
Mount the file system:
infiltrate-root /dev/<raid_array>
Specify
<raid_array>
— RAID array that you selected in step 5.The partition will be mounted in the directory
/newroot
. -
If the command
infiltrate-root
doesn't 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
-
Print information about the partitions on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 2.9G 0 disk
└─sda1 8:1 0 2.9G 0 part
sdb 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
,sdb15
— partitions on the disk. -
Select the system partition, usually the largest partition on the disk. In the example in step 2, this is the partition
sdb1
. -
Mount the file system to the directory
/mnt
:mount /dev/<partition> /mnt
Specify
<partition>
— partition on the disk you selected in step 3. -
Mount the service file systems:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev -
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 file system:
umount /dev/<partition> /mnt
Specify
<partition>
— partition on the disk to which you mounted the file system in step 4.
-
Check if the system has detected RAID arrays, to do this, display the partition information on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sda2 8:2 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1
sdb 8:16 0 447.1G 0 disk
├─sdb1 8:17 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sdb2 8:18 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1Here.
md0
,md1
— RAID arrays on disk partitions. -
If in step 2 in the output
lsblk
there are RAID arrays, skip this step. If there are no RAID arrays, start RAID build:mdadm --assemble --scan
-
Print information about the partitions on the available disks:
lsblk
A list of disks with partitions will appear in the response. For example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sda2 8:2 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1
sdb 8:16 0 447.1G 0 disk
├─sdb1 8:17 0 500M 0 part
│ └─md0 9:0 0 500M 0 raid1
└─sdb2 8:18 0 446.6G 0 part
└─md1 9:1 0 446.6G 0 raid1Here.
md0
,md1
— RAID arrays on disk partitions. -
Select the system RAID array, usually the largest RAID array. In the example in step 4, this is
md1
. -
Mount the file system to the directory
/mnt
:mount /dev/<raid_array> /mnt
Here.
<raid_array>
— RAID array that you selected in step 5. -
Mount the service file systems:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev -
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 file system:
umount /dev/<raid_array> /mnt
Here.
<raid_array>
— RAID array to which you mounted the file system in step 6.