warning /dev/centos/root swap centos-root does not exist -- after configuring DRBD
The reason why you’re seeing this is due of initramfs kernel image being build for the specific system it's running on, so migrating to a new hardware will cause it to fail to boot.
Rebuilding initramfs in emergency mode(or go to the Rescue Mode ):
Then
1) List the initramfs images you have:
ls -ltrh /boot/initramfs-*
2) Locate the kernel version you’re using and create a backup of it:
cp -iv /boot/initramfs-3.10.0-1062.el7.x86_64.img /boot/initramfs-3.10.0-1062.el7.x86_64.img.back
3) Rebuild the kernel image for that specific kernel
dracut -f
4) Select the new kernel image
ls -ltrh /boot/initramfs-*
5) Specify the new kernel version (For Example):
dracut -f /boot/initramfs-3.10.0-1062.el7.x86_64.img 3.10.0-1062.el7.x86_64
6) Go to the Grub config
vim /boot/grub2/grub
7) Delete the old menuentry and make sure that the new menuentry is top of all
8) Generate a GRUB configuration file
grub-mkconfig
9) Reboot
10) Done.
Related videos on Youtube
bakasan
Updated on September 18, 2022Comments
-
bakasan over 1 year
I configured DRBD on default CentOS 7.3 Installation like following:
/dev/centos/home
was taking all the space insda2
so reduced it and created/dev/centos/home
(20% space) and/dev/centos/drbd
(remaining space usinglvcreate -l 100%VG -n drbd centos
)DRBD resource device is
/dev/drbd0
and disk is/dev/mapper/centos-drbd
formatted asext4
.Now everytime I reboot the system I get the errors:
Warning: /dev/centos/root does not exist Warning: /dev/centos/swap does not exist Warning: /dev/mapper/centos-root does not exist
From dracut shell I run :
$ lvm vgscan $ lvm vgchange -ay $ exit
and system boots fine. But It fails again at
reboot
.Any solution?
UPDATE: Found the cause, drbd device was causing the issue. I removed it from both servers and it fixed the 2nd server but not the 1st one.
blkid
still shows wrong UUID and Type of/dev/sda2
$ blkid /dev/sda1: UUID="bdfa3672-b24b-41ec-88f8-d0f0a81057d1" TYPE="xfs" /dev/sda2: UUID="d8d241f07976f3ce" TYPE="drbd" /dev/mapper/centos-swap: UUID="3c8653bb-060a-4e46-8eaa-ce51637752ee" TYPE="swap" /dev/mapper/centos-root: UUID="93941d8b-22e0-4ad7-8666-1ce8ba8d1109" TYPE="xfs" /dev/mapper/centos-home: UUID="63c9a5ad-9b4b-4852-8e95-22b356d8729a" TYPE="xfs"
-
duct_tape_coder about 2 yearsA couple errors but you got me through an IDE-SCSI conversion, thanks! On 3) it should be
dracut -f <kernel img>
otherwise it'll do the booted rescue kernel version. Don't do 6), it tells you in/boot/grub2/grub.conf
not to edit the file. 8) should begrub2-mkconfig
-
Admin almost 2 yearsPlease don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review