legacy-wiki
Kernel
Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.
initrd contents
booting from a single disk or path
[root@ut40xl033 boot]# cd /tmp
[root@ut40xl033 tmp]# mkdir initrd-bad
[root@ut40xl033 tmp]# cd initrd-bad/
[root@ut40xl033 initrd-bad]# zcat /boot/initrd-2.6.18-164.6.1.el5.img.bak | cpio -idv
[root@ut40xl033 initrd-bad]# cat init | tail -n15
mkblkdevs
echo Scanning and configuring dmraid supported devices
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure system
resume /dev/system/swap.0
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/system/root
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot
booting from multipath
[root@ut40xl033 ~]# cd /tmp
[root@ut40xl033 tmp]# mkdir initrd
[root@ut40xl033 initrd]# zcat /boot/initrd-2.6.18-194.8.1.el5.img | cpio -idv
[root@ut40xl033 initrd]# cat init | tail -n 18
mkblkdevs
echo Creating multipath devices
/bin/multipath -v 0
dmsetup ls --target multipath --exec 'kpartx -a -p p'
echo Scanning and configuring dmraid supported devices
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure system
resume /dev/system/swap.0
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/system/root
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot
Converting or rebuilding an initrd to boot from mpath
- http://post-office.corp.redhat.com/archives/tech-list/2009-May/msg00005.html
- http://post-office.corp.redhat.com/archives/tech-list/2009-May/msg00006.html
linux rescue mpath
* choose no networking
* continue to scan for installs
# Make sure the rescue environment activated the VG on top of a dm device instead of a /dev/sd* device ...
lvm pvs
# Mount additional virtual filesystems as needed
mount /sys /mnt/sysimage/sys
mount /proc /mnt/sysimage/proc
mount /dev /mnt/sysimage/dev
mount /dev/mapper/mpath0p1 /mnt/sysimage/boot
# Invoke the system environment
chroot /mnt/sysimage
# Clean out the old bindings
rm -f /var/lib/multipath/bindings
# Remove any blacklists in /etc/multipath.conf
# Backup the existing initrd which is the default used by grub.conf
less /boot/grub/grub.conf
cp /boot/initrd-version.img /boot/initrd-version.img.bak
rm /boot/initrd-version.img
# Rebuild the initrd
mkinitrd /boot/initrd-version.img kernelversion
# Extract the new file
mkdir /tmp/initrd
cd /tmp/initrd
zcat /boot/initrd-version.img | cpio -idv
# examine the init file for references to the multipath command
less init
# change entries in fstab to use mpath devices
# do not use LABEL= or /dev/sd* for the /boot mount definition, use /dev/mapper/mpath0p1
reboot