Migrating single disk to RAID1 on Debian

from blog Mumbling about computers, | ↗ original
I have set up a system with /dev/sda as its only disk. I want to avoid any downtime and unplanned surprises (disks deciding to die) so I thought I'd set up the system in a RAID1. So I need to: Copy the partition table from sda to sdb Create the disk array with the new disk and a missing disk Create filesystems on the new partitions (sdb) Set up mdadm Copy the data from...