- Activate LVM partitions
sudo mdadm --assemble --scan
sudo vgchange -a y [name of volume group] - 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 - 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 - Jump into the new mounted system
sudo chroot /mnt
- Install GRUB
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub - Exit the environment and restart
exit
sudo umount /mnt/dev/pts
sudo umount /mnt/*
sudo shutdown -r now
This blog is a knowledge dump of all the technical information floating around in my head. It deals with anything involving software, hardware, gadgets, and technology.
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.
Jul 3, 2014
Recovering a RAID 5 array
Recently had a RAID 5 array fail on me. These are the steps I took to recover the data.
NOTE! The order of the disks in /dev/sdX follows the numbering of the ports on the motherboard. So if a disk is plugged into port 0, it will show up as /dev/sda. Keep this in mind as if you remove a failed disk, it might mess up the references in the array!.
NOTE! The order of the disks in /dev/sdX follows the numbering of the ports on the motherboard. So if a disk is plugged into port 0, it will show up as /dev/sda. Keep this in mind as if you remove a failed disk, it might mess up the references in the array!.
- Boot up from a Live CD
- Install the software RAID management software
sudo apt-get install mdadm
- Make sure RAID and LVM are unmounted
sudo vgchange -a n [name of your volume group] sudo mdadm -S /dev/md0
- Copy the failed disk to the new disk (in case the disk was the boot disk, you need to copy that flag across so that your system boots)
sudo sfdisk -d /dev/sdx | sudo sfdisk /dev/sdy
- Check that the disks are the same
sudo fdisk -l
- Mount the RAID array, and remove the failed disk
sudo mdadm --assemble --scan sudo mdadm --manage --remove /dev/sdx
- Add the new disk
sudo mdadm --manage --add /dev/sdy
- Watch the progress as mdadm rebuilds your RAID array
sudo cat /proc/mdstat
Subscribe to:
Posts (Atom)