Here's a little background on the situation at hand. I have a DELL Precision T7600 at work that I'm responsible for maintaining, which just lost a hard-drive, thankfully just the /home directory was on it, and has now been recovered. Now I've been tasked with making a RAID 1 of the OS drive so that our downtime is to a minimum.
I've read about hard-drive cloning, on the Arch-Linux wiki, but I could not wrap my head around the process. Perhaps I'm making this too complex and it is a simple dd if=/dev/sdc of=/dev/md126
command, but I just want to make sure before I go solo on this.
I'm currently waiting to the array to resync to blank new disks (see my other question if you're interested). I suppose this is necessary. What would happen if I decided to dd
to the array right now? Would stuff just crash? And while I wait, id dd
ing to an array from a device file even possible or recommended? I'm not sure what's best practice here.
Thank you for your time and input!
UPDATE 1
I tried dd
ing to the /dev/md0 device, but it was a tiny bit smaller, than the original, so I got an error from dd
about not being able to copy to /dev/md0
. Also, I tried to boot off of this array, but ran into error: file '/grub/i386-pc/normal.mod' not found.
and was put into a grub rescue>
, which I don't know what to do with. So I tried to mount the array in order to do a grub-install
on it, but was met with failure, as mount
told me: unknown filesystem type 'linux_raid_member'
UPDATE 2
I decided against a RAID1 array, and ran the following command to clone my OS drive to the two blank drives:
sudo pv /dev/sdc | tee >(dd of=/dev/sda) >(dd of=/dev/sdb) | dd of=/dev/null
This cloned my OS drive successfully, without grub errors like the 1st attempt. Grub loaded, but would not boot the OS, and I was thrown into dracut emergency mode. I got out of this by issuing the following commands from my LiveUSB sfdisk -d /dev/sdc | sfdisk /dev/sda
and ditto for sdb
.
Fedora loaded this time, but I was thrown into emergency mode, which is caused, at least in my case, as I've dealt with it before, by inexistant /etc/fstab
entries. So I pruned the fstab to only mount the /
partition.
Now I will endeavor to create the RAID array knowing full well that this will destroy the partition table, so what I will do is back it up first, and hopefully after running:
sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda /dev/sdb
from my Live USB stick I will have a RAID1 array. Or it could end up that I destroy the partition table and need to reload it again. Or I might have to reissue the dd
command and wait another 20 hrs, we'll see :)!