Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 23693 - MD RAID volumes set to autostart confuse checkfs into failing when /etc/raidtab exists
Summary: MD RAID volumes set to autostart confuse checkfs into failing when /etc/raidt...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-29 06:44 UTC by lkd-gentoo
Modified: 2005-03-01 20:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lkd-gentoo 2003-06-29 06:44:56 UTC
Relevant packages installed:
- baselayout-1.8.6.8-r1
- raidtools-1.00.3-r1

Reproducible: Always
- Set up a RAID array, with a properly defined raidtab
- Make sure the partition types of all RAID members is 0xfd (linux RAID)
- Reboot

Kernel:
- linux-2.4.20-gentoo-r5 with MD support built-in

The problem is that /sbin/raidstart will return 1 for any error.  Including an
"already running" error.  With any result code > 0, checkfs drops to shell while
trying to start RAID.  This wouldn't be so bad except that checkfs starts a
maintenance root shell instead of booting.

Either raidtools' raidstart needs to be patched to emit different result codes,
or checkfs needs to capture error output and read it.  A third way to go might
be to add a config variable that makes checkfs skip RAID startup.

This looks like a regression; at least as of baselayout-1.8.6.6, autostart RAIDs
appeared to be handled normally (<A
href="http://bugs.gentoo.org/show_bug.cgi?id=20378">Bug #20378</A>).
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-17 14:10:33 UTC
No way to detect 'already running' ?  Sorry, no real experience in software
RAID.
Comment 2 Brandon Black 2003-08-14 21:59:51 UTC
The issues related to checkfs's raid startup code have hit bugs.gentoo.org several times, and they're never resolved to everyone's satisfaction.  On one particular system I have, it is a requirement for everything to work correctly that I have two both autodetected and non-auto-detected raid devices.  In this case the current checkfs is doubly broken.  Furthermore, I have /dev/md/X in my raidtab rather than /dev/mdX.  Both are legal, and the one I'm using is the real location in devfs, the shorter one is a compat softlink.  The current raid startup can't hack this at all.

It seems to me the only reasons to maintain the current clunky raid startup code is:

1) To support obsolete raid startup with raid0add/raidrun (seems like a bad idea to break working modern setups for this)
2) To support not starting devices which are for noauto filesystems in fstab (again, doesn't seem worth it, if a raid device is defined in raidtab, it should start or give us errors regardless, if you dont want to be stopped on bootup, then fix your raid device or remove it from your raidtab?)

If you're willing to throw those two things out the window, you can let raidtools and/or mdadm do everything for you, correctly, and it will work on all systems without all these bug reports, e.g.:

if [ -f /proc/mdstat -a -f /etc/raidtab -a -f /sbin/raidstart ]
then
  raidstart -a
fi
if [ -f /proc/mdstat -a -f /etc/mdadm.cf -f /sbin/mdadm ]
then
  mdadm -Sa
fi

and be done with it (of course I don't use mdadm so I'm sure my syntax was wrong or the config name was wrong, and I left out return value checking, but you get the idea :)
Comment 3 SpanKY gentoo-dev 2005-03-01 20:34:55 UTC
ok, this is finally fixed

mdadm-1.9.0-r1 / raidtools-1.00.3-r4 utilizes code similar to what you've posted here (with fixed syntax for mdadm of course !)

baselayout-1.11.10+ will take advantage of their addins