Jul 4, 2014

Recover LVM Boot partition within a live CD (installing GRUB)

This allows you to recover the Master Boot record when a RAID 5 array fails.


  1. Activate LVM partitions
    sudo mdadm --assemble --scan
    sudo vgchange -a y [name of volume group]
  2. Mount all volumes to a single mount-point
    sudo mount /dev/mapper/[volume group]/[root volume] /mnt/
    sudo mount /dev/mapper/[volume group]/[usr volume] /mnt/usr/
    sudo mount /dev/mapper/[volume group]/[home volume] /mnt/home/
    ... etc
  3. Mount and bind directories for grub to detect the underlying hardware
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /dev/pts /mnt/dev/pts
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
  4. Jump into the new mounted system
    sudo chroot /mnt
  5. Install GRUB
    grub-install /dev/sda
    grub-install --recheck /dev/sda
    update-grub
  6. Exit the environment and restart
    exit
    sudo umount /mnt/dev/pts
    sudo umount /mnt/*
    sudo shutdown -r now

No comments:

Post a Comment

Thanks for contributing!! Try to keep on topic and please avoid flame wars!!