Searching for Signal

the n01se blog

md + lvm2

It's just beautiful what happens when you mix Linux md with lvm2. I just added two 15K 146G disks to my system. They show up as sdc and sdd. Now I do this:

for x in sdc sdd; do
    parted /dev/$x mklabel msdos mkpart primary 0 100% set 1 raid on print quit
done
cd /dev; MAKEDEV md
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
pvcreate /dev/md0
vgcreate raid1 /dev/md0
for x in agriffis amg; do
    lvcreate -L 50G -n $x raid1
    mkfs.ext3 -L $x -O dir_index /dev/raid1/$x
    echo "LABEL=$x /home/$x ext3 noatime 1 2" >>/etc/fstab
done
mount -a

That leaves nearly 50G of free space on the physical volume into which I can grow either filesystem eventually, or add a third, depending on future needs.