FS#10651 - Move raid and raid-partitions in one hook mdadm

Attached to Project: Arch Linux
Opened by Glenn Matthys (RedShift) - Friday, 13 June 2008, 12:18 GMT
Last edited by Tobias Powalowski (tpowa) - Thursday, 12 March 2009, 17:46 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently RAID support for mkinitcpio is split into two hooks:
* raid
-> This provides RAID support for normal RAID devices like md0. It is included in the mkinitcpio package.
* raid-partitions
-> This provides RAID support for partitionable RAID devices like md_d0. It is included in the mdadm package.

There's a third necessity for the initial ramdisk to boot from a RAID array: mdassemble. It is included in the klibc-extras package.

What I'm proposing is to get rid of both raid & raid-partitions, and replace them with an mdadm hook, that is included in the mdadm package. Attached you will find the mdadm hook & install file.

Advantages over the old method:
* Only one hook for both normal & partitionable RAID arrays;
* No more kernel command line additions for the RAID arrays;
* RAID sets that are degraded can still be booted:
-> With the current setup if you remove a disk, but that disk is still specified on the kernel commandline, the hook will try to assemble the RAID array with all the disks specified. However, since a disk is missing it will fail and you'll be thrown in the emergency shell;
* Should be compatible with the old method, so the old hooks can remain included while systems are migrated to the new mdadm hook (although I don't recommend this - this is a rolling release distro afterall!);
* Device locations don't matter anymore: while the kernel command line requires you to specify devices, mdadm.static is capable of scanning all the devices (see DEVICE or PARTITIONS in mdadm.conf) and figure out which are part of which RAID array.
* Removes ugly code (raid-partitions, yuk!);
* Having mdadm.static in the initcpio means you have the full complement of RAID commands at your disposal in the emergency shell.

Disadvantages:
Nothing I can think of. One could argue that you need a properly configured mdadm.conf, but with the old hooks you'd need a properly configured kernel command line.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Thursday, 12 March 2009, 17:46 GMT
Reason for closing:  Implemented
Additional comments about closing:  2.6.8-2
Comment by Aaron Griffin (phrakture) - Thursday, 19 June 2008, 21:36 GMT
Thomas what do you think of this. My one fear is that a static mdadm is freaking huge, compared to everything else...
Comment by Glenn Matthys (RedShift) - Thursday, 19 June 2008, 22:00 GMT
-rwxr-xr-x 1 root root 756K Nov 2 2007 mdadm.static

I think we can spare one megabyte?
Comment by Aaron Griffin (phrakture) - Thursday, 19 June 2008, 22:05 GMT
Size makes a big difference when we're talking about initramfs. It is all loaded into ram, for one thing. I'm not saying it's a bad idea, I'm just saying being oblivious and nonchalant about this issue is a BAD thing. We all need to be aware that large initramfs images are bad bad bad.
Comment by Glenn Matthys (RedShift) - Thursday, 19 June 2008, 22:11 GMT
Hmm you're right, I didn't compare to the current size of the initial ramdisk (it's only 549k here). After gzip -9 mdadm.static compresses to 336k. (This would still make the initial ramdisk < 1 MB). Another note is that it can be left out by default, because it's only needed for systems that have their root on RAID.
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 14:41 GMT
Any more thoughts?
Comment by Tobias Powalowski (tpowa) - Sunday, 15 February 2009, 22:19 GMT
hrm tested with mdadm --assemble --scan
nothing happens with no config file, nothing will be assembled :(
Comment by Tobias Powalowski (tpowa) - Sunday, 08 March 2009, 18:22 GMT
please try new mdadm package from testing with mdadm hook, thanks

Loading...