How to Chroot in Rescue Mode
This document (7018126) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11
Situation
Resolution
mount /dev/<device name> /mnt
cat /proc/partitions
lvdisplay
ls /mnt
for i in proc sys dev run; do mount --rbind /$i /mnt/$i ; done
mount --rbind /proc /mnt/proc mount --rbind /sys /mnt/sys mount --rbind /dev /mnt/dev mount --rbind /run /mnt/run
chroot /mnt
mount -a
Example of corrective actions that can be done in rescue chroot:
If the initrd has been damaged or invalid , it can be recreated :
Command to use in SLES 11 :
mkinitrdCommand to use in SLES 12 and SLES 15 :
dracut
Note, that you need to explicitly define the kernel version for 'dracut(8)' since without defining one, the auto-detected version uses 'uname(2)' syscall which would return the kernel version from the (ISO) rescue environment, and thus it would fail with 'Cannot file module directory...'.
Steps to identify the installed kernel version and run the dracut command using that information:
First check the kernel version(s) in installed system using 'ls -1 /boot/vmlinuz-* /lib/modules/' command.
Example:
rescue:/ # ls -1 /boot/vmlinuz-* /lib/modules/ /boot/vmlinuz-5.3.18-150300.59.101-default /boot/vmlinuz-5.3.18-150300.59.147-default /lib/modules/: 5.3.18-150300.59.101-default 5.3.18-150300.59.112-default 5.3.18-150300.59.147-defaultThen run the dracut command targetting installed kernel-version .
dracut -f --kver 5.3.18-150300.59.147-default
Cause
There are several possible causes for that behavior.
Additional Information
When using multipath with lvm, you should start multipathd before using lvm. If you do not, lvm may not detect the physical volumes needed to mount filesystems due to the lvm filter.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7018126
- Creation Date: 06-Oct-2016
- Modified Date:13-May-2024
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com