Published using Google Docs
Wheezy LVM-RAID Notes
Updated automatically every 5 minutes

Using CD #1 to install. Probably won’t work with netinst CD [no kernel image package; confirm].

Picked install at the menu (normal, not advanced)

Language, keyboard, blah blah blah.

Partitioning method: manual

First disk, one partition, size max, physical volume for LVM

SHORTCUT:

configure LVM, yes, alt-f2 for console

sfdisk -d /dev/vda | sfdisk /dev/vdb (etc.)

alt-f1, go back

configure LVM, yes

create vg, give name, select all

GET DM-RAID MODULE:

alt-f2 for console

cd /tmp

ar x /cdrom/pool/main/l/linux-image-*.deb data.tar.xz

xzcat data.tar.xz | tar x

depmod -a -b /tmp

modprobe -d /tmp dm-raid

CREATE RAIDed LV

lvcreate --type raid5 -i 4 -I 256 -L 10G -n root vg0 (note: -l 256 picked out of thin air… hoping larger size speeds up on the weird VM setup)

PROBLEM: wheezy lvm does not support raid10 (for swap). SOLUTION: use multiple RAID-1s

NOTE: Have to tell it what PVs to use, else it puts them both on the same disks.

lvcreate --type raid1 -m1 -L 1G -n swap0 vg0 /dev/vda1 /dev/vdb1

lvcreate --type raid1 -m1 -L 1G -n swap1 vg0 /dev/vdc1 /dev/vdd1

alt-f1 to get back to installer, select ‘finish’ (on the LVM menu)

Observe now suddenly have tons of LVs showing. Silly installer, most of those should be hidden. Ignore the ones with ‘rimage’ and ‘rmeta’ in their names.

Select LV root, use as ext4 (or whatever), mount point /, done

Select LV swap0, use as swap, done

Select LV swap1, use as swap, done

Finish & write changes to disk, yes

Wait for base system to install. (NOTE: Can watch progress on alt-f4).

Pick whatever for scan another CD and network mirror.

Package usage survey is up to you. Same with software to install.

When asked, install GRUB to the MBR.

PROBLEM: On wheezy, this fails (grub-install gives you a grub-probe command to capture the output of for a bug report, running it gives “grub-probe: info: unknown LVM type raid5” buried in the mess). Requires grub2 2.0 (per Google), which isn’t in Wheezy.

SOLUTION: Locally built a backport. Build was trivial; just grabbed the source package, dch -l +asd, installed build-deps, build. (Not needed on jessie, of course.)

alt-f2

chroot /target /bin/bash

mount /sys

dpkg -i grub-pc_*.deb grub-pc-bin_*.deb grub-common_*.deb grub2-common_*.deb

grub-install /dev/vda … grub-install /dev/vd

echo ‘dm_raid’ >> /etc/initramfs-tools/modules

update-initramfs -kall -u

update-grub     (untested; see problem below)

umount /sys

exit

alt-f1

Continue without a boot loader. Ignore the ‘no boot loader installed’ message.

Continue at the installation complete message.

PROBLEM: no grub config. Booted by specifying at grub prompt.

linux /boot/vmlinuz-3.2.0-4-amd64 root=/dev/mapper/vg0-root

initrd /boot/initrd.image-3.2.0-4-amd64

boot

SOLUTION: added an update-grub above, suspect that will entirely fix. Did after the boot.

TODO

Make sure dm-raid module loads in initramfs

Fix swap priorities in fstab (make them both the same)

PROBLEM: wheezy lvs does not know how to display raid5 sync completion. It does display for raid1 (jessie does both). SOLUTION: dmsetup status shows it, it’s the final column. A little less friendly, but usable.

PROBLEM: lvextend doesn’t work on raid5 LV on wheezy. Suspect it doesn’t on jessie either; dm-raid does not do reshape, per even 3.16 kernel docs. SOLUTION: none

NOTES

dm-raid docs: https://www.kernel.org/doc/Documentation/device-mapper/dm-raid.txt

lvm2-raid: https://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/doc/lvm2-raid.txt?cvsroot=lvm2