Talk:HOWTO Gentoo Install on Software RAID mirror and LVM2 on top of RAID
From Gentoo Linux Wiki
What Kernel modules do I require to get this happening?
raid1 and dm-mod I think...
Contents |
[edit] if reboot from livecd was neccessary
You wont see your devices after reboot as you have the ARRAY information lost in the live session.
Was some figuring out, but you need only to do these steps:
RAIDx:
modprobe raidX -> your raid mode here
make the device nodes:
cd /dev MAKEDEV md
make the mdadm.conf settings for your array:
DEVICE /dev/$HDA* DEVICE /dev/$HDB* ARRAY /dev/md1 devices=/dev/$HDA1,/dev/$HDB1 ARRAY /dev/md2 devices=/dev/$HDA2,/dev/$HDB2 ARRAY /dev/md3 devices=/dev/$HDA3,/dev/$HDB3 ARRAY /dev/md4 devices=/dev/$HDA4,/dev/$HDB4
you can also hold the device line this way, for my 2 sata harddisks (sda,sdb) it is:
DEVICE /dev/sd[ab]*
re-assemble the array:
mdadm --assemble /dev/mdX
one-liner (look that you have no typos in config):
for i in `seq 1 4`;do mdadm --assemble /dev/md$i;done
cat /proc/mdstat -> your raid arrays should appear
LVM2:
modprobe dm-mod vgscan vgchange -ay - this re-activates the logical volumes
set the filter line in lvm.conf
echo 'filter=["a|dev/md4|", "r/.*/"]' >/etc/lvm/lvm.conf
You can then go on with HOWTO Gentoo Install on Software RAID mirror and LVM2 on top of RAID#Mounting from this howto...
[edit] AMD64
After completing the installation I think it's important to note that udev does not create the md0-4 device entries rendering a system that is not bootable. To fix this, I ended up unmerging udev and emerging devfsd. - useperl
[edit] AMD64
I have followed this excellent HOWTO and installed LVM on a RAID1 system. I did not include /dev/md.* in the /etc/lvm/lvm.conf file, since it prevented any of the LVM volumes being mounted.
[edit] udev and mdX dev nodes
I'm not sure which of the following two changes resolved the problem, but here is what I did to get the md device nodes made fast enough for the system to complete booting:
1) in /etc/udev/rules.d/50-udev.rules I moved the 'md' specific ruleset to be just after the ide-devices section close to the top
2) in /etc/init.d/checkroot. just after the 'start() {' line I added:
mknod /dev/md0 b 9 0
mknod /dev/md1 b 9 1
mknod /dev/md2 b 9 2
mknod /dev/md3 b 9 3
Thus, if #1 above doesn't get the nodes created before checkroot executes, the checkroot script itself will bring the md nodes into existence before trying to access them.
[edit] note
I tested this with Gentoo 2005.1 and step 2 above is not neccesary. Udev will create the nodes for you during boot.
[edit] Swap in RAID-1
- ...sounds quite stupid, doesn't it?
- I personally followed this guide and used the setup for a few weeks until I noticed how useless mirrored swap partitions actually are.
- Maybe the original author should think about this part again and rewrite it, since I don't like to mess up his work. ;)
- Well, if you do not put swap on a redundant array then a failing disk will cause a serious crash possibly causing data corruption. On a server high availability is usually more important than speed.
I think having a swap on a raid 1 array is a good idea. Specially on a machine where the swap in normally not used (thanx for a really good howto btw.). --E Norm 12:59, 13 October 2005 (GMT)
[edit] Adding drives
Say I have 2 x 120gb drives on raid1.. I get 2 more 120gb drives. How do I add them and resize the logical volume to the new size? --81.178.112.8 23:05, 24 September 2005 (GMT)
- super late reply, but for those who are interested....create a new raid with the two new drives. Add the new raid device /dev/md? to your lvm...I think it's a "pvcreate /dev/md?" on that, then a "vgextend vg /dev/md?" Something like that, anyways. Replace the "?" with a number, obviously. Dgrant 17:55, 25 January 2007 (UTC)
[edit] lvm.conf filter in lvm2
Is it still necessary to add the device filter into lvm.conf if you use lvm2?? I just saw this in there:
# By default, LVM2 will ignore devices used as components of # software RAID (md) devices by looking for md superblocks. # 1 enables; 0 disables. md_component_detection = 1
[edit] GRUB and booting on the second disk (if the first one fails)
It should be possible to add an entry in grub's menu which points to the boot partition from the second disk. IIRC, there is an option in grub for a "failsafe" menu entry which is used when the first one failed. Or am I mistaking?
- I guess if the first disk goes down, the second becomes the first, so the grub setup will work without any change.
