You are not logged in.

#1 2006-06-05 18:05:01

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Initramfs, RAID, LVM, OH MY!

I'm running the beyond kernel w/ initramfs, and I encountered a problem. I devised a workaround but I a) don't like it and b) am not sure why it's necessary, so I thought I'd post up here and see if a wiser archer might have some insight.

First, I must detail my setup: I am running 4 HDDs, one of which is my system drive and contains a LVM volume, vg_sys (which contains the root partition and such, obviously). The other three are running as a RAID 5 array, and have another LVM volume on the resulting RAID device, vg_data (holding /home, my media, my SVN repos, etc). So, from initramfs' point of view, I am running root-on-LVM, but not root-on-RAID.

Now, if I set up mkinitramfs to allow both RAID and LVM, the system boots up, creating the RAID device /dev/md0 and enabling vg_sys, as well as enabling vg_data (but something goes wrong here!). When the reiserfs (which all my partitions are) drivers are loaded and the logical volume vg_data on /dev/md0 is mounted, the system hangs and eats resources until it dies. However, if I *don't* enable RAID in the initramfs, I have a different problem. Since, as far as I can tell, rc.sysinit copies the RAID /dev entries out of the initramfs (as rc.sysinit states: "udev won't create these md nodes, so we steal them from the initrd"), if I don't enable RAID, then I can't assemble my RAID array after the initramfs phase is over and rc.sysinit takes over (as the appropriate /dev nodes don't exist). My "solution" was to hack /lib/intiramfs/init, and simply comment out the call to "mdadm --assemble", and leave RAID enabled in the mkinitramfs. This has the effect of creating the RAID devices, but not actually brining the RAID device online during the initramfs phase (which is fine, since only non-system stuff is on there). Then, when rc.sysinit takes over, it can copy the /dev/md entries out of the initramfs, and /etc/rc.d/mdadm assembles the device, and everything works fine.

So, yes, the problem has been circumvented, but not in a particularly elegant way. I guess my main question is: Does anybody know why the initramfs way of starting up would be creating a problem. i.e.: assemble RAID device, enable logical volume, mount devices (this last step causes the system hang). Regardless of why it happens, I guess I also feel like the initramfs shouldn't have to create the /dev/md nodes for a RAID device that isn't needed for boot (in my case). Either mkinitramfs should honor the REMOVE_RAID flag, and create the device nodes even if RAID_ROOT_ARRAY and RAID_ROOT_DEVICES are not specified (so that rc.sysinit can later copy these over), or rc.sysinit should create the devices instead of relying the existence of the /dev/md entries in the initrd.

All this may be addressed in the new mkinitcpio (I haven't tested it yet); if so, let me know and I'll check it out.

-nogoma


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#2 2006-06-05 20:52:41

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Initramfs, RAID, LVM, OH MY!

Please try mkinitcpio.  It is in testing and already provides for raid and lvm and all that jazz (though not perfectly, there may still be bugs - hence why it's still in testing).

See here: http://wiki.archlinux.org/index.php/Mkinitcpio

Offline

#3 2006-06-06 23:06:26

syamajala
Member
From: here, there, everywhere
Registered: 2005-01-25
Posts: 617
Website

Re: Initramfs, RAID, LVM, OH MY!

you should also look into evms it will help make your setup easier to manage.

Offline

Board footer

Powered by FluxBB