How to implement a rescue system on a SUSE Linux Enterprise Server 12
This document (7018607) is provided subject to the disclaimer at the end of this document.
Environment
Situation
Resolution
Assumption: It is desired to have the files from rescue media in /boot. /dev/sda1 is mounted there.
1. Mount the SLE ISO to /mnt
2. cd /mnt
3. Copy the following content to a directory (e.g /boot). The following script may help with the given task:
#!/bin/bash4. Create a new grub2 boot entry in /etc/grub.d/40_custom:
set -x
DEST=/boot
mkdir -p /$DEST/media/boot/x86_64/loader
for i in \
content \
content.asc \
boot/x86_64/loader/initrd \
boot/x86_64/loader/linux \
boot/x86_64/rescue \
boot/x86_64/common \
boot/x86_64/config \
boot/x86_64/cracklib-dict-full.rpm
do
cp -av /mnt/$i /$DEST/media/$i
done
set +x
#!/bin/sh5. Activate the new boot loader configuration:
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Rescue with FS Path: /boot" --class sles --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod btrfs
insmod ext2
insmod lvm
set root=(hd1)
#set root=(lvm/system-lvboot)
set loader=(hd1)
linux $loader/media/boot/x86_64/loader/linux rescue=1 install=hd:/media?device=sdb* keytable=de namescheme= splash=silent vga=0x318 panic=10 linemode=1 linuxrc.debug=4,trace
initrd $loader/media/boot/x86_64/loader/initrd
}
grub2-mkconfig -o /boot/grub2/grub.cfg6. Reboot and test
Scenario 2: Boot the rescue media from an ISO from disk
1. Mount your SLE ISO to /mnt
2. Copy the following content to a local directory of your need (e.g /tmp)
#!/bin/bash3. Create an ISO file from the created directory
set -x
DEST=/tmp
mkdir -p /$DEST/media/boot/x86_64/loader
for i in \
content \
content.asc \
boot/x86_64/loader/initrd \
boot/x86_64/loader/linux \
boot/x86_64/rescue \
boot/x86_64/common \
boot/x86_64/config \
boot/x86_64/cracklib-dict-full.rpm
do
cp -av /mnt/$i /$DEST/media/$i
done
set +x
cd /tmp4. Add a new grub2 boot entry in /etc/grub.d/40_custom
mkisofs -o /boot/media.iso -l media
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Rescue with ISO" --class sles --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod btrfs
insmod ext2
insmod lvm
set isofile=(hd0,1)/media.iso
loopback loop $isofile
set root=(hd0,1,msdos2)
linux (loop)/boot/x86_64/loader/linux rescue=1 install=hd:/media.iso keytable=de namescheme= splash=silent vga=0x318 panic=10 linemode=1 linuxrc.debug=4,trace
initrd (loop)/boot/x86_64/loader/initrd
}
Cause
Additional Information
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:7018607
- Creation Date: 10-Feb-2017
- Modified Date:03-Mar-2020
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com