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 attached to a hardware RAID controller, use the instructions for partitioning the disk 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:
lsblk
The response will show a list of disks with partitions.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
are 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
sdb1
partition. -
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
/newroot
directory. -
If the
infiltrate-root
command does not work, mount the file system manually. -
Perform recovery and diagnostic work.
-
Log out of the environment when finished.The file system will be unmounted automatically:
exit
-
Activate LVM:
vgchange -ay
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
│ ├─vg0-root 253:0 0 150G 0 lvm
│ └─vg0-swap 253:1 0 9.9G 0 lvm
├─sdb14 8:30 0 4M 0 part
└─sdb15 8:31 0 106M 0 partHere:
vg0
— volume group name;root
,swap
— names of logical volumes in the groupvg0
.
-
Select the system partition, usually the largest partition on the disk.In the example in step 3, this is the
root
logical volume in thevg0
group . -
Mount the file system:
infiltrate-root /dev/<volume_group>/<logical_volume>
Specify:
<volume_group>
— the name of the volume group in which the logical volume with the root partition is located, in the example in step 4 it isvg0
;<logical_volume>
— the name of the logical volume with the root partition you selected in step 4, in the example it isroot
.
The partition will be mounted in the
/newroot
directory. -
If the
infiltrate-root
command does not work, mount the file system manually. -
Perform recovery and diagnostic work.
-
Deactivate LVM:
vgchange -an
-
Log out of the environment when finished.The file system will be unmounted automatically:
exit
System without LVM
System with LVM
-
Check if the system has detected RAID arrays, to do this, display the partition information on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
If there are RAIDs in the
lsblk
output in step 2, skip this step.If there are no RAIDs, run RAID build:mdadm --assemble --scan
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
Select the system partition, usually the largest partition on the disk.In the example in step 4, this is RAID
md1
. -
Mount the file system:
infiltrate-root /dev/<raid_array>
Specify
<raid_array>
is the name of the system partition you selected in step 5, in the example it is RAIDmd1
.The partition will be mounted in the
/newroot
directory. -
If the
infiltrate-root
command does not work, mount the file system manually. -
Perform recovery and diagnostic work.
-
Log out of the environment when finished.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 disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
If there are RAIDs in the
lsblk
output in step 2, skip this step.If there are no RAIDs, run RAID build:mdadm --assemble --scan
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
Activate LVM:
vgchange -ay
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
├─vg0-root 253:0 0 428G 0 lvm
└─vg0-swap 253:1 0 8G 0 lvm
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 raid1
├─vg0-root 253:0 0 428G 0 lvm
└─vg0-swap 253:1 0 8G 0 lvmHere:
vg0
— volume group name;root
,swap
— names of logical volumes in the groupvg0
.
-
Select the system partition, usually the largest partition on the disk.In the example in step 6, this is the
root
logical volume in thevg0
group . -
Mount the file system:
infiltrate-root /dev/<volume_group>/<logical_volume>
Specify:
<volume_group>
— the name of the volume group in which the logical volume with the root partition is located, in the example at step 7 it isvg0
;<logical_volume>
— the name of the logical volume you selected in step 7, in the example it isroot
.
The partition will be mounted in the
/newroot
directory. -
If the
infiltrate-root
command does not work, mount the file system manually. -
Perform recovery and diagnostic work.
-
Deactivate LVM:
vgchange -an
-
Log out of the environment when finished.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:
lsblk
The response will show a list of disks with partitions.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
are 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
sdb1
partition. -
Mount the file system to the
/mnt
directory:mount /dev/<partition> /mnt
Specify
<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/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev
mount -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/pts
umount --bind /dev /mnt/dev
umount -t sysfs /sys /mnt/sys
umount -t proc /proc /mnt/proc -
Unmount the file system:
umount /dev/<partition> /mnt
Specify
<partition>
is the name of the system partition whose file system you mounted in step 4, in the example it issdb1
.
-
Activate LVM:
vgchange -ay
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
│ ├─vg0-root 253:0 0 150G 0 lvm
│ └─vg0-swap 253:1 0 9.9G 0 lvm
├─sdb14 8:30 0 4M 0 part
└─sdb15 8:31 0 106M 0 partHere:
vg0
— volume group name;root
,swap
— names of logical volumes in the groupvg0
.
-
Select the system partition, usually the largest partition on the disk.In the example in step 3, this is the
root
logical volume in thevg0
group . -
Mount the file system to the
/mnt
directory:mount /dev/<volume_group>/<logical_volume> /mnt
Specify:
<volume_group>
— the name of the volume group in which the logical volume with the root partition is located, in the example in step 4 it isvg0
;<logical_volume>
— the name of the logical volume with the root partition you selected in step 4, in the example it isroot
.
-
Mount the service file systems:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev
mount -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/pts
umount --bind /dev /mnt/dev
umount -t sysfs /sys /mnt/sys
umount -t proc /proc /mnt/proc -
Unmount the file system:
umount /dev/<volume_group>/<logical_volume> /mnt
Specify:
<volume_group>
— the name of the volume group you specified when mounting the file system in step 5, in the example it isvg0
;<logical_volume>
— the name of the logical volume with the root partition whose file system you mounted in step 5, in the example it isroot
.
-
Deactivate LVM:
vgchange -an
System without LVM
System with LVM
-
Check if the system has detected RAID arrays, to do this, display the partition information on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
If there are RAIDs in the
lsblk
output in step 2, skip this step.If there are no RAIDs, run RAID build:mdadm --assemble --scan
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
Select the system partition, usually the largest partition on the disk.In the example in step 4, this is RAID
md1
. -
Mount the file system to the
/mnt
directory:mount /dev/<raid_array> /mnt
Here
<raid_array>
is the name of the system partition you selected in step 5, in the example it is RAIDmd1
. -
Mount the service file systems:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev
mount -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/pts
umount --bind /dev /mnt/dev
umount -t sysfs /sys /mnt/sys
umount -t proc /proc /mnt/proc -
Unmount the file system:
umount /dev/<raid_array> /mnt
Here
<raid_array>
is the name of the system partition whose file system you mounted in step 6, in the example it is RAIDmd1
.
-
Check if the system has detected RAID arrays, to do this, display the partition information on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
If there are RAIDs in the
lsblk
output in step 2, skip this step.If there are no RAIDs, run RAID build:mdadm --assemble --scan
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
are RAID names. -
Activate LVM:
vgchange -ay
-
Print information about the partitions on the disks:
lsblk
The response will show a list of disks with partitions.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
├─vg0-root 253:0 0 428G 0 lvm
└─vg0-swap 253:1 0 8G 0 lvm
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 raid1
├─vg0-root 253:0 0 428G 0 lvm
└─vg0-swap 253:1 0 8G 0 lvmHere:
vg0
— volume group name;root
,swap
— names of logical volumes in the groupvg0
.
-
Select the system partition, usually the largest partition on the disk.In the example in step 6, this is the
root
logical volume in thevg0
group . -
Mount the file system to the
/mnt
directory:mount /dev/<volume_group>/<logical_volume> /mnt
Specify:
<volume_group>
— the name of the volume group in which the logical volume with the root partition is located, in the example at step 7 it isvg0
;<logical_volume>
— the name of the logical volume with the root partition you selected in step 7, in the example it isroot
.
-
Mount the service file systems:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount --bind /dev /mnt/dev
mount -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/pts
umount --bind /dev /mnt/dev
umount -t sysfs /sys /mnt/sys
umount -t proc /proc /mnt/proc -
Unmount the file system:
umount /dev/<volume_group>/<logical_volume> /mnt
Specify:
<volume_group>
— the name of the volume group you specified when mounting the file system in step 8, in the example it isvg0
;<logical_volume>
— the name of the logical volume with the root partition whose file system you mounted in step 8, in the example it isroot
.
-
Deactivate LVM:
vgchange -an