Rhyming Panda
I do not understand this line of reasoning... | Main | Dumb questions I have been asked

Finished converting my Kubuntu 6.06LTS system to RAID1

Had the hardest time finding a document about converting an existing system in-place. Found one that covered setting up RAID1 from scratch (RAID-1 in My Ubuntu Installation); found another that showed how to convert a single partition on an existing system (Personal Bytes » Software RAID in Ubuntu).

Of course, I had made the classic mistake of not looking at the easily-accessible documentation first. The mdadm utility controls the raid process, and its documentation is at /usr/share/doc/mdadm. It also includes a handy little guide: Convert Root System to Bootable Software RAID1 (Debian) (note: local link). The guide includes instructions for using both LILO and grub bootloaders.

<sigh>

I followed the directions, and despite fat-fingering the second of four partitions (swap), causing me to reboot several times to try to fix the /dev/mdN device ordering, I finally got the system completely up and running. I even followed the testing suggestion and pulled the power for the first RAID device, and the second HD booted flawlessly, and reported the obvious - degraded array.

I had the capital and foresight to copy my drive-to-convert bit-for-bit to an external drive, so I knew that if I had to start from scratch, it would cost me a grand total of two hours restoring the image.

The cool thing about the mdadm convert root system docs? I converted my entire system in-place - I did not have to copy to a third hard drive. The instructions were easy to follow, and contained numerous checkpoints as well as several appendices.

Now, my Kubuntu system boots fine, activity that requires reading as opposed to writing happens noticeably quicker, and if one drive fails, I have a perfect duplicate of it, and can restore very easily.

Some useful commands:

df -h
show the mounted filesystems
dd if=/dev/sdX of=/dev/sdY bs=10M & ddpid=$!
copy bit-for-bit from /dev/sdX to /dev/sdY, using 10MB chunks, which speeds up the transfer considerably. I copied a 400GB disk to another identically-sized disk in under 2 hours.
kill -USR1 $ddpid
show the dd command's status without stopping it

Some useful notes: