I had installed my server using software RAID1, I am referring them by the descriptive names(md0, md1 and md2). I figured out my boot drive which is second partition of the first hard-disk drive, tried loading the kernel and initramfs as below -
Код: Выделить всё
grub>set prefix=(hd0,msdos2)/grub2
grub>set root=(hd0,msdos2)
grub>linux16 /vmlinuz-3.10.0-123.el7.x86_64
grub>initrd16 /initramfs-3.10.0-123.el7.x86_64.img
grub>bootКод: Выделить всё
# journalctl
Not switching root: /sysroot does not seem to be an OS tree. <<<=============
/etc/os-release is missing.
Initrd-switch-root.service: main process exited, code=exited,
status=1/FAILURE
Failed to start Switch Root. <<<<=====================
. . . . .
Triggering OnFailure= dependencies of initrd-switch-root.service.
Starting Emergency Shell. . .
Failed to issue method call: Invalid argumentSo, I thought to assemble the RAID volumes, mount the root volumes and fix the grub devices to match what 'mdadm --detail' says ..
I had booted into 'CentOS' server install's DVD rescue system, Chose to execute a shell from the installer environment and not to use a root file system.
Код: Выделить всё
#cat /proc/mdstat
- this would show the meta devices, (md125, md126, md127), stop those devices.
# mdadm -S /dev/md125
# mdadm -S /dev/md126
# mdadm -S /dev/md127Код: Выделить всё
# mdadm -Av --run /dev/md0 /dev/sda1 /dev/sdb1
# mdadm -Av --run /dev/md1 /dev/sda2 /dev/sdb2
# mdadm -Av --run /dev/md2 /dev/sda3 /dev/sdb3Код: Выделить всё
# cat /proc/mdstat
# mdadm --detail /dev/md0
# mdadm --detail /dev/md1
# mdadm --detail /dev/md2Код: Выделить всё
# mkdir /sysroot
# mount -o bind /dev/ /sysroot/dev
# mount -o bind /proc /sysroot/proc
# mount -o bind /sys /sysroot/sys
# mount -o bind /dev/pts /sysroot/dev/pts
Код: Выделить всё
# chroot /sysroot /bin/bashКод: Выделить всё
#cp -p /boot/grub2/device.map /boot/grub2/device.map.old
#for i in /dev/disk/by-id/md-uuid-*; do DEV=$(readlink $i); echo "(${DEV##*/}) $i"; done|sort|tee /boot/grub2/device.mapКод: Выделить всё
#dracut -vf /boot/initramfs-3.10.0-123.el7.x86_64.imgКод: Выделить всё
# grub2-install /dev/sda
# grub2-install /dev/sdbКод: Выделить всё
# grub2-mkconfig -o /boot/grub2/grub.cfghttp://sunlnx.blogspot.ru/2015/05/grub- ... emble.html


