I had a disk Running Ubuntu 14.04 LTS Desktop that crashed. I have a disk image of the drive and i want to put it onto a raid 1. That's it, i thought it would almost as easy as it sounds but apparently not. What is the correct way to do this?
If you've created a RAID-1 volume (with
mdadm --create or by any other means), you can copy the disk image onto the volume, provided that it's large enough. You may prefer to copy only one partition instead.
By default, RAID volumes have metadata at the beginning, so the new location of the image is at an offset. Because of this, you need to tell the bootloader that its location has changed. With Grub, you need to run
grub-install again, e.g.
sudo grub-install /dev/sda if
/dev/sda is your Grub disk. You may need to instruct Grub to load its RAID-1 support, though I think with RAID-1 you can actually get away without it. I think it's enough to run
You may also need to regenerate the initrd or initramfs to make sure it includes support for RAID, if you weren't using RAID before. On Ubuntu, run sudo dpkg-reconfigure linux-image-VERSION (with the version that your system is running) to regenerate the initramfs.
An alternative approach is to create a RAID-1 volume with the metadata at the end, rather than at the beginning. With mdadm, this means superblock format 1.0 instead of the default 1.2. See How to set up disk mirroring (RAID-1) for a guide to turning a volume into a RAID-1 component in place.