I'm trying to migrate the drive containing /home to a raid 1, and I've found so many incomplete and wildly divergent instructions I'm not sure where to start, other than spending the next 6 months studying raid and playing around in VBox.
Right now, I have a 3 harddrives.
sda (160GB) with / at sda1, plus a swap partition.
sdb (1TB) for /home at sdb1 (only partition on drive)
sdc (1TB) not in use, but formatted with a single ext4 the same size as sdb1.
I have a motherboard that has a basic RAID controller that can handle raid 1, but there is absolutely zero documentation for it, even from the manufacturer. So, software raid using mdadm seems like a better option.
My goal, is to convert sdb and sdc to a mirrored raid1 array so I have built in data redundancy, but to do so without losing my data.
The best I've cobbled together from different how-to's would be to tell the computer that sdb1 is part of a raid 1 using:
Code:mdadm --create /dev/md0 -n 2 -l 1 /dev/sdb1 missing
...and then add sdc1 to the array using:
...and then modify my fstab to mount md0 as the new /home.Code:mdadm --manage /dev/md0 -a /dev/sdc1
But that leaves me with a lot of questions.
- Will this even work the way I've described?
- Will this be non-destructive to my data, aside from the usual disclaimers?
- Can this be done on a live system?
- Just precisely how do I modify my fstab to mount the array? Is it as simple as changing all references to sdb1 to md0?
- I know that raid 1 is supposed to have increased read performance in addition to the obvious benefit to data safety, but is that still true of a software raid set up through mdadm? (not a deal breaker, just curious)
Again, please note that /home is on it's own physical disk. I don't want or need to move/copy/duplicate the OS. In my particular setup, having my / partition fail is a minor inconvenience. Losing /home would be catastrophic if not for my backups, but would still be a huge pain, even with them.