Gentoo Archives: gentoo-user

From: "Nuno Magalhães" <nunomagalhaes@××××××.pt>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Tips for fresh install with GRUB2+RAID1+LVM2
Date: Sun, 17 May 2015 11:49:28
Message-Id: CADqA9uYkvDWYGfrHtBmR+wQuCx5-ffHO+tw0jtiMSnwdKmv7DQ@mail.gmail.com
Hello Gentoo World,


TL;DR warning

I've tested Gentoo and liked it, tried to tune it a bit and borked it. :)

I want to use mdadm to create a RAID1 with 2 SATA disks. From what i
gather, i'll need (bootable)  0xFD partitions, i'll use full disk for
them and no separate /boot (unless required). Is GPT required or can i
stick to MBR? Is fdisk safe? Seems usable to me.

Is 0.90 metadata mandatory for RAID1? What's the recommended version?

I've seen manuals that use mknode, but discovered that mdadm --create
will create a /dev/md for me. (Later i want to get rid of systemd-udev
and use eudev instead.)
Also, why so many tty* and similar in /dev? Is there a way to make it
less crowded? Just a whim...

Does GRUB2 (rather grub2-install) handle well RAID1 stuff or does it
get confused?

What's the difference between dodmraid and domdadm? I don't want to
use fakeraid, so is it safe to just use domdadm?

Then i want to use LVM on the /dev/md and setup my / in an LV. This
seems straightforward (as far as creation goes). Any tips here? I
remember you could tune LVM LVs to the underlying RAID stripe.

I intend to use XFS for /. Incidentally, if i later decide to "fork
out" /usr (or some other subdirectory) into it's own LV, is it "just"
a mater of copying its contents and updating /etc/fstab? Or should i
just do it now and expand the LVs if later required (especially if i
want to use different filesystems)?

The problem will be (has been) getting it to boot.

If i have 2 kernels in /boot, shouldn't grub2-mkconfig generate 2
entries in the GRUB boot menu (not counting the recovery entries)?

I read somewhere that genkernel is a bad choice for creating the
kernel because it un/sets a CONFIG_ flag that interferes with RAID/LVM
(sorry, i should've noted where/what). I use make menuconfig anyway,
it's fun. I do use genkernel to create the initramfs, i'm assuming
"genkernel --lvm --mdadm --bootloader=grub --install initramfs" would
suffice?

I'm assuming the key will be to make sure /etc/mdadm.conf has the
ARRAY= line and that GRUB has the right parameters in
/etc/default/grub, like
GRUB_PRELOAD_MODULES=raid,lvm
Or mdraid09? Where do these come from, /etc/grub/i386pc? Mine's an
amd64 but that's the only directory i could find.
GRUB_CMDLINE_LINUX_DEFAULT="domdadm dolvm rootfstype=xfs"

Are there any USE flags i should be aware of? Currently i'm gonna go
with USE="bindist 3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a
smp ssl unicode -avahi -pulseaudio -selinux -gnome -kde -systemd
-bluetooth -ieee1394 -networkmanager -fortran"
Plus CPU_FLAGS_X86 based on an emerge news item about processor flags.
Neither RAID nor LVM should have an impact, application-wise.

While the Handbook is awesome, it doesn't cover this and all the
information i find is either outdated or conflicting. I had a similar
setup with Debian Wheezy on this same hardware, but that was done
through the debian installer, nifty and under the hood.


Incidentally, the hardware's an Asus M2NPV-VM with 4 SATA II disks.
It's my desktop, not mission-critical, but i want to make the most of
it.

Thanks for the patience and feedback (and the distro!) :)

Cheers,
Nuno

Replies

Subject Author
Re: [gentoo-user] Tips for fresh install with GRUB2+RAID1+LVM2 Peter Humphrey <peter@××××××××××××.uk>
Re: [gentoo-user] Tips for fresh install with GRUB2+RAID1+LVM2 Neil Bothwick <neil@××××××××××.uk>