How to setup a chroot environment using the rescue system in order to re-create the initrd

This document (7018376) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Desktop 15
SUSE Linux Enterprise Desktop 12
 

Situation

If a SUSE Linux Enterprise Server system does not boot anymore it may be necessary to boot into the rescue system, setup a chroot environment and re-create the initrd.

This document will outline the steps needed to perform the necessary tasks on SLES 12 or SLES 15 based systems.

For SLES 10 and 11 systems review TID#3134230 How to access LVM partitions when system is booted with rescue CD

Resolution

1. Start the system with the SLES ISO or by using a network source.
  • ISO images can be downloaded from:
    SLES
    SLED
2. Choose "Rescue System" from the menu
 
3. Choose the language and login as "root"
 
4. Mount the root device:
mount /dev/rootdev /mnt
    # Use the relevant devicename for the system.
 
5. Depending on the filesystem and/or partition layout, mount the boot device:
mount /dev/bootdev /mnt
   # Use the relevant devicename for the system.
 
6. Depending on the filesystem that is used and/or partition layout make sure to mount the following paths below /mnt:
/bin
/etc
/lib
/lib64
/sbin
/tmp
/usr
/var
 
  example: 
 mount /dev/var /mnt/var
   # Use the relevant devicename for the system.
 
7. Mount proc:
mount -o bind /proc /mnt/proc
 
8. Mount sys:
mount -o bind /sys /mnt/sys
 
9. Mount dev:
mount -o bind /dev /mnt/dev
 
10. Mount run:
mount -o bind /run /mnt/run
 
11. Change root directory:
chroot /mnt
 
12. Re-create the initrd:
mkinitrd
 
13. Exit chroot:
exit

14. Unmount everything in mnt:
umount /mnt/*

15. Unmount mnt:
umount /mnt

16. Reboot the system:
reboot
 

Cause

In the case that mkinitrd is used, the system has booted past the grub2 menu and started loading the kernel but stopped during loading the kernel or has an error mounting disk devices.
Typically, a driver or module is missing in the initrd and a new initrd needs to be created with the mkinitrd command.
 

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:7018376
  • Creation Date: 09-Dec-2016
  • Modified Date:04-Feb-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center