Answer the question
In order to leave comments, you need to log in
How to boot centos 7 from software raid?
Good day, gentlemen.
the question is.
there is a backup of centos 7. in the form of tar czvf backup.tar.gz /
there is a live cd of centos 7. 2 screws in the server.
breaking screws. 1 partition of 370GB. mark as fd (linux raid autodetect)
build raid
mdadm --create --level 1 /dev/md0 --raid-devices=2 --metadata=0.90 /dev/sda1 /dev/sdb1
everything is going, everything is fine.
format
mkfs.ext4 /dev/md0
mount
/mount /dev/md0 /mnt/cnt
unpack the archive there.
mount the necessary partitions.
mount --bind /dev/ /mnt/cnt/dev/
mount --bind /proc/ /mnt/cnt/proc/
mount --bind /sys/ /mnt/cnt/sys/
and login
chroot /mnt/cnt/ /bin/bash is
where the questions start.
I rewrote fstab (wrote both UUID and /dev/md0)
mdadm --detail --scan > /etc/mdadm.conf
mv initramfs-3.10.0-229.7.2.rt56.141.6.el7.centos.x86_64.img initramfs -3.10.0-229.7.2.rt56.141.6.el7.centos.x86_64.img.baq
dracut /boot/initramfs-3.10.0-229.7.2.rt56.141.6.el7.centos.x86_64.img
then grub2- mkconfig -o /boot/grub2/grub.conf
this is how it sees it:
menuentry 'CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64' --class rhel fedora --class gnu-linux - -class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-1059f673-bc2c-457a-b40c-19ef73554bfc' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod diskfilter
insmod mdraid09
insmod ext2
set root='mduuid/a2e6f8dbfff8a57904894333532a878b'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='mduuid/a2e6f8dbfff8a57904894333532a878b' 1059f673-bc2c-457a-b40c-19ef73554bfc
else
search --no-floppy --fs-uuid --set =root 1059f673-bc2c-457a-b40c-19ef73554bfc
fi
linux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=UUID=1059f673-bc2c-457a-b40c-19ef73554bfc ro crashkernel=auto rhgb0
initrd16 /boot/initramfs-3.10.0-229.el7.x86_64.img
} It
looks like the MD module should be loaded.
then I install the bootloader on both screws
grub2-install --recheck /dev/sda
grub2-install --recheck /dev/sdb
also tried writing to grub rd.auto=1 or rd.md.uuid=UUID which mdadm issues.
but after all these manipulations, I get that they say I can’t boot, /dev/disk/by-uuid/ does not exist. and throws it into the dracut rescue.
how to fix?
Answer the question
In order to leave comments, you need to log in
the solution is the following.
at the moment where dracut generates initramfs - generate on the stock kernel with the obligatory indication of the kernel, i.e. :
dracut /boot/initramfs-$(uname -r).img $(uname -r)
get bogged down in it and rebuild the normal rt kernel from there.
The easy way.
boot-repair-disk-64bit.iso
was googled. make a LiveCD.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question