3
Example Case A:
Example Case B:
howto reinstall GRUB in rescue mode while using lvm / mdadm
This article is how to activate LVM and mdadm software raid in rescue and reinstall GRUB boot loader, since the boot CD will not do this job for you. By following the steps, you may able to do system recovery or disk operation.
RedHat 5.x
Activate the RAID
mkdir /etc/mdadm mdadm --examine --scan > /etc/mdadm/mdadm.conf mdadm -A --scan
RedHat 4.x
Activate the RAID
vi /etc/mdadm.conf
DEVICE /dev/sda1 /dev/sdb1 /dev/sda2 /dev/sdb2
scan it
mdadm --examine --scan >> /etc/mdadm.conf
or put it in /etc/mdadm.conf maunally
DEVICE /dev/sda1 /dev/sdb1 /dev/sda2 /dev/sdb2 ARRAY /dev/md0 level=raid1 devices=/dev/sda1,/dev/sdb1 ARRAY /dev/md1 level=raid1 devices=/dev/sdb2,/dev/sdb2
LVM2
Activate LVM
If your root partition located on logical volume.
lvm pvscan lvm vgscan lvm lvscan lvm vgchange -ay
Reinstall GRUB?
Example Case A:
/boot on md0
/ on md1
/ on md1
Prepare the environment
mkdir /mnt/sysimage mount /dev/md1 /mnt/sysimage mount -o bind /dev /mnt/sysimage/dev mount -o bind /proc /mnt/sysimage/proc chroot /mnt/sysimage /bin/bash mount /dev/md0 /boot
Install GRUB
grub grub>root (hd0,0) grub>setup (hd0)
Example Case B:
/boot on md0
/ on /dev/VolGroup00/LogVol00
/ on /dev/VolGroup00/LogVol00
Prepare the environment,
mkdir /mnt/sysimage mount /dev/VolGroup00/LogVol00 /mnt/sysimage mount -o bind /dev /mnt/sysimage/dev mount -o bind /proc /mnt/sysimage/proc chroot /mnt/sysimage /bin/bash mount /dev/md0 /boot
Install GRUB
grub grub>root (hd0,0) grub>setup (hd0)
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'griffin_comment' not found or invalid function name in /u01/mydream.com.hk/wwwroot/blog/wp-includes/class-walker-comment.php on line 174
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'griffin_comment' not found or invalid function name in /u01/mydream.com.hk/wwwroot/blog/wp-includes/class-walker-comment.php on line 174
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'griffin_comment' not found or invalid function name in /u01/mydream.com.hk/wwwroot/blog/wp-includes/class-walker-comment.php on line 174