Команда IT специалистов выполнит подготовку инфраструктуры для вашего бизнеса.
Внедрение самых передовых решений и технологий.
Поддержка и сопровождение ваших сервисов.
Выполнение работ под "ключ", от покупки сервера, до настройки автоматизации процессов. 8(977)608-78-62 adm@nixm.ru
Внедрение самых передовых решений и технологий.
Поддержка и сопровождение ваших сервисов.
Выполнение работ под "ключ", от покупки сервера, до настройки автоматизации процессов. 8(977)608-78-62 adm@nixm.ru
Software RAID devices assemble after grub prompt - CentOS 7
-
- Местный говорун
- Сообщения: 579
- Зарегистрирован: 19 янв 2015, 15:56
- Откуда: Russian_federation, какой то
Software RAID devices assemble after grub prompt - CentOS 7
Short story is that I tried to make few changes to the grub without having taken backup which costed me several hours to recover when I had only GRUB prompt. I installed the grub2-install and after reboot, I am at the same grub prompt where I was earlier. Hence, I decided to remove the /boot/grub2/grub.cfg file and again re-create the file, which had no luck for me.
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 -
it would start to boot, and unfortunately the system drops into the initramfs rescue shell with the following information in 'journalctl'.
From this log I had to start suspect that root file system was not mounted as it appears to me that there was 'md' devices weren't assembled to run or the naming could have been chaged in the device mappers or because it doesn't know the file system or layers under it.
So, 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.
- Assemble the volumes
- Check the outcome
- create the directory 'sysroot' and would mount the root file system to fix the device maps.
- chroot into it
- correct your device names so that current names of the 'md' devices and their UUIDs are properly read by GRUB.
- Recrete your initramfs
- Just make sure that you install GRUB2 on the two drives which are eligible for booting
- update the grub to make sure that latest configuration to take effect.
- you can leave the chroot environment and reboot.
http://sunlnx.blogspot.ru/2015/05/grub- ... emble.html
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 argument
So, 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.cfg
http://sunlnx.blogspot.ru/2015/05/grub- ... emble.html
Re: Software RAID devices assemble after grub prompt - CentO
Объясните нубу в двух словах, это восстановление загрузки рейд массива? В предверии выхода
Федоры хотела было попробовать rpm дистрибутив, все, перехотела.
Федоры хотела было попробовать rpm дистрибутив, все, перехотела.
"I invented the term Object-Oriented and I can tell you I did not have C++ in mind." - Alan Kay
Re: Software RAID devices assemble after grub prompt - CentO
Могли бы и перевести
Re: Software RAID devices assemble after grub prompt - CentO
Два загрузчика два ядра зеркальные системы -почему тогда одна загрузочная запись,если такие перестраховки и для чего тогда пустой третий раздел?
Правильный линукс-BSD.
Re: Software RAID devices assemble after grub prompt - CentO
CentOS 7 drops to 'grub>' while reboot, GRUB was unable to mount the root file system, instead it drops to initramfs minimal root shell.. with error
Правильный линукс-BSD.