| ### Create mdadm RAID on a RaspPi and store the / partition on it ### | |
| I recently replaced my old VIA-based home server by a fresh new RaspberryPI B+ … | |
| I won't go into details about how to initialize the RAID here, since I already … | |
| Mounting such RAID as an additional mount point is easy, but what if I'd like t… | |
| === no RAID-related modules at boot -> use an initramfs === | |
| The problem that I had to deal with is that the Raspbian kernel doesn't include… | |
| Add the following lines to the /etc/initramfs-tools/modules file: | |
| raid1 | |
| md_mod | |
| ext4 | |
| Then, (re)build the initramfs image: | |
| # update-initramfs -c -k `uname -r` | |
| Having an initramfs image is not all - yet we need to tell the system to use it… | |
| # uname -r | |
| It will be something in the form of 3.10.XX+. Then, add the following 2 lines t… | |
| kernel=kernel.img | |
| initramfs initrd.img-3.12.35+ followkernel | |
| === copy the root partition to the raid === | |
| Now that we have a RAID-aware initramfs, we can finally make use of our RAID to… | |
| # cp -ax / /mnt/newroot/ | |
| === make the boot loader to use your md0 device for boot === | |
| Finally, we will be able to ask the system to use our new root partition during… | |
| # cat /boot/cmdline.txt | |
| dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/md0p1 rootfs… | |
| You should also modify your /etc/fstab file accordingly (although I noticed tha… | |
| Now, if all went fine, we should be able to reboot, and the RaspberryPI will ha… | |