Skip to content

Instantly share code, notes, and snippets.

@thanandorn
Last active October 12, 2018 08:49
Show Gist options
  • Save thanandorn/7ea2734d891a8cf44fbc to your computer and use it in GitHub Desktop.
Save thanandorn/7ea2734d891a8cf44fbc to your computer and use it in GitHub Desktop.
LVM on /dev/md127 fixes on CentOS5

LVM on /dev/md127 fixes on CentOS5

+---------------------------+
|        LVM Volumes        |
+---------------------------+
|     /dev/md1 (raid1)      |
+-------------+-------------+
|  /dev/sda2  |  /dev/sdb2  |
+-------------+-------------+
  1. Boot into rescue mode (without mounting anything)
  2. Scan raid devices and activate them.
  sh-3.2# mdadm --examine --scan >> /dev/mdadm.conf
  sh-3.2# mdadm --assemble --scan /dev/md0
  mdadm: /dev/md0 has been started with 2 drives.
  sh-3.2# mdadm --assemble --scan /dev/md1
  mdadm: /dev/md1 has been started with 2 drives.
  1. Scan and activate LVM volumes
  sh-3.2# lvm vgscan -v
  sh-3.2# lvm vgchange -ay
  1. Mount the volumes
  sh-3.2# mount /dev/VolGroup00/root /mnt/sysimage
  sh-3.2# mount /dev/VolGroup00/var /mnt/sysimage/var
  sh-3.2# mount /dev/md0 /mnt/sysimage/boot
  sh-3.2# mount --bind /dev /mnt/sysimage/dev
  sh-3.2# mount --bind /proc /mnt/sysimage/proc
  sh-3.2# mount --bind /sys /mnt/sysimage/sys
  1. Correct GRUB
  sh-3.2# chroot /mnt/sysimage
  sh-3.2# grub-install /dev/sda
  1. Exit and reboot
  sh-3.2# exit
  sh-3.2# exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment