1

I configured DRBD on default CentOS 7.3 Installation like following:

/dev/centos/home was taking all the space in sda2 so reduced it and created /dev/centos/home (20% space) and /dev/centos/drbd (remaining space using lvcreate -l 100%VG -n drbd centos)

DRBD resource device is /dev/drbd0 and disk is /dev/mapper/centos-drbd formatted as ext4.

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"
bakasan
  • 21
  • 1
  • 1
  • 5

2 Answers2

1

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 configuration

    vim /boot/grub2/grub.cfg
    
  7. Delete the old menuentry and make sure that the new menuentry is top of all

  8. Generate a GRUB configuration file

    grub2-mkconfig
    
  9. Reboot

  10. Done

AdminBee
  • 21,637
  • 21
  • 47
  • 71
  • A couple errors but you got me through an IDE-SCSI conversion, thanks! On 3) it should be `dracut -f ` 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 be `grub2-mkconfig` – duct_tape_coder Jan 29 '22 at 02:23
0
  • in Centos edit /etc/default/grub as follows:
    GRUB_CMDLINE_LINUX="resume=/dev/mapper/cs-swap rd.lvm.lv=cs/root rd.lvm.lv=cs/swap rhgb quiet"
    
  • change the swap path to the correct path
  • run
    grub2-mkconfig
    
    and
    dracut -f
    
  • reboot
AdminBee
  • 21,637
  • 21
  • 47
  • 71