

Wow. You did something wrong, then.Dark Foo wrote:the way described to install grub onto a raid system may have wiped the partition table
Yes.Dark Foo wrote:if you encrypt a system would you advise encrypting everything
Grub does not even have to know about RAID. You can make a /boot partition with RAID 1 (simple mirroring over four drives), with 0.90 metadata for /boot, you can even use old raid unaware Grub 1 to boot. You install Grub on all four drives (so it still boots regardless which drive fails), each grub sees a single disk with a single /boot partition (as that's what is there when it's mirrored) and loads the kernel. Grub is done at that point, kernel is booting.i know grub can boot from raid
Use whatever makes you happy! Gentoo requires more know-how than others, and RAID and encryption certainly don't make things easier.My only other option may be to use one of those hold your hand distros, or (gasp) stick with windows home server

you should not need to use lvm, unless you happen to want to use lvmDark Foo wrote:I am also guessing I will need an initramfs, but i dont know how to include raid in it, it works for the laptop but not sure how to add raid

Code: Select all
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
#for a french azerty keyboard
loadkmap < /etc/kmap-us
rescue() {
echo "Dropping to rescue shell" >&2
/bin/sh </dev/tty1 >/dev/tty1 2>&1
}
/bin/cryptsetup luksOpen /dev/sda2 gentoo || rescue
/bin/lvm pvscan || rescue
/bin/lvm vgscan || rescue
/bin/lvm vgchange -ay vg || rescue
mount -r /dev/mapper/vg-root /newroot || rescue
CMDLINE=`cat /proc/cmdline`
umount /dev
umount /sys
umount /proc
exec /bin/busybox switch_root /newroot /sbin/init ${CMDLINE}
i think i know where this confusion comes fromDark Foo wrote: I thought if you used encryption you were required to use lvm as it uses /dev/mapper - guess i misunderstood
Code: Select all
hplaptop ~ # equery depends lvm2
* These packages depend on lvm2:
net-fs/nfs-utils-1.2.6 (nfsv41 ? sys-fs/lvm2)
sys-block/gparted-0.13.1 (dmraid ? >=sys-fs/lvm2-2.02.45)
sys-block/parted-3.1 (device-mapper ? >=sys-fs/lvm2-2.02.45)
sys-fs/cryptsetup-1.4.3 (static-libs ? >=sys-fs/lvm2-2.02.64[static-libs(+)])
(>=sys-fs/lvm2-2.02.64)
(static ? >=sys-fs/lvm2-2.02.64[static-libs(+)])

Code: Select all
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
#for a french azerty keyboard
loadkmap < /etc/kmap-us
rescue() {
echo "Dropping to rescue shell" >&2
/bin/sh </dev/tty1 >/dev/tty1 2>&1
}
/bin/mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
/bin/mdadm --assemble /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
/bin/mdadm --assemble /dev/md2 /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sdd3
/bin/mdadm --assemble /dev/md3 /dev/sda4 /dev/sdb4 /dev/sdc4 /dev/sdd4
/bin/cryptsetup luksOpen /dev/md0 gentoo-boot || rescue
mount -o ro /dev/mapper/gentoo-boot /boot || rescue
/bin/cryptsetup luksOpen /dev/md1 gentoo-root || rescue
mount -o rw /dev/mapper/gentoo-swap / || rescue
/bin/cryptsetup luksOpen /dev/md2 gentoo-swap || rescue
mount -o rw /dev/mapper/gentoo-root / || rescue
/bin/cryptsetup luksOpen /dev/md3 gentoo-root || rescue
mount -o rw /dev/mapper/gentoo-root / || rescue
/bin/cryptsetup luksOpen /dev/md4 gentoo-home || rescue
mount -o rw /dev/mapper/gentoo-home /home || rescue
CMDLINE=`cat /proc/cmdline`
umount /dev
umount /sys
umount /proc
exec /bin/busybox switch_root /newroot /sbin/init ${CMDLINE}
Code: Select all
/bin/cryptsetup luksOpen /dev/md0 gentoo-boot || rescue
mount -o ro /dev/mapper/gentoo-boot /boot || rescue
Code: Select all
#!/bin/busybox sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
#for a french azerty keyboard
loadkmap < /etc/kmap-us
rescue() {
echo "Dropping to rescue shell" >&2
/bin/sh </dev/tty1 >/dev/tty1 2>&1
}
# assemble root
/bin/mdadm --assemble /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
# unlock root
/bin/cryptsetup luksOpen /dev/md1 gentoo-root || rescue
# mount root ro
mount -o ro /dev/mapper/gentoo-root / || rescue
CMDLINE=`cat /proc/cmdline`
umount /dev
umount /sys
umount /proc
exec /bin/busybox switch_root /newroot /sbin/init ${CMDLINE}


basically meaning that the init script provided for openrc can do the job of decrypting everything *but* rootDark Foo wrote:do you mean that i should use dmcrypt to open the other raid drives? Is there a way I could do that automatically, instead of having to putting in the passcode 4 times?
Code: Select all
target=gentoo-home
source='/dev/md4'
key='/full/path/to/homecrypt.key'
target=gentoo-swap
source='/dev/md2'
key='/full/path/to/swapcrypt.key'
Code: Select all
head -c64 /dev/urandom | base64 > /homecrypt.key
head -c64 /dev/urandom | base64 > /swapcrypt.key


you'd need an MUA (mail client), not necessarily an MTA (mail server)Dark Foo wrote: One last question, seeing as this PC will be headless, how would be the best way to get it to email me should something go wrong with the raid, would i need to install a sntp server on there? ISP has rules about that, other than me checking the logs every few days, or is there a simpler method?
