Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 33364 - checkfs starts up md raid devices using a hazardously wrong concept
Summary: checkfs starts up md raid devices using a hazardously wrong concept
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-12 22:25 UTC by Rumi Szabolcs
Modified: 2004-10-09 23:49 UTC (History)
1 user (show)

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 Rumi Szabolcs 2003-11-12 22:25:18 UTC
The /etc/init.d/checkfs script is checking for the existence of /etc/raidtab
and /proc/mdstat and then it tries to start all raid devices except those
which are explicitly listed in the fstab with the noauto flag. I think this
is a completely wrong approach and leads to various problems.

Reproducible: Always
Steps to Reproduce:
1. Create a half written /etc/raidtab like you had been just left off writing 
one
2. Reboot your system (or run /etc/init.d/checkfs)
3.

Actual Results:  
At the very least you get dropped into single user mode because of the
failure to start some devices. It might be possible that with certain
scenarios an md device gets started which should not be, and this may
lead to irreparable damage to a raid array.

Expected Results:  
This functionality should be implemented in a controllable fashion, preferably
a separate /etc/init.d/raidstart script which can be controlled via variables
like RAID_AUTOSTART="yes|no" (globally) and RAID_START_DEVICES="md0 md1 md2"
(per device) in some file like /etc/conf.d/raidstart so that only those arrays
get started which are explicitly declared as ones to be started, regardless
of what is or isn't present in the fstab.

I think this one is rather easy to fix, especially for someone who has a
good overview of the gentoo rc system. There are a couple of related problems
with bug ids #23693, #9163, #29243 which should be reviewed when fixing this.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-15 08:06:34 UTC
So what is wrong with expecting to know how, and setup a proper /etc/raidtab
if they are using raid ?  Most other initsystem out there (all I checked) do
expect this.  Its the same as to say:  You should not use /etc/fstab to try
and detiremine what partitions to mount.
Comment 2 SpanKY gentoo-dev 2003-11-15 21:15:43 UTC
the raid stuff worked perfectly on my system ... i only had to setup /etc/raidtab (like i had it in slackware) and /etc/fstab and everything else fell into place ...
Comment 3 Rumi Szabolcs 2003-11-16 00:27:12 UTC
Well, automounting filesystems from fstab is trivial among all Unices. The
md device is a Linux-specific creature, so I don't think it should be trivial
to start it up without the system administrator explicitly wanting this to
happen. Another point of view is that in the Gentoo concept, not even starting
up network interfaces, or syslog, etc. from rc is a trivial default, one has to
explicitly add them via rc-update, so with this in mind one would expect that
he also has to explicitly add some raidstart script into rc, or, if that
functionality is integrated into some other script then one has to enable it
via some generic configuration mechanism, like conf.d for example.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-16 15:03:33 UTC
It is not done automatically - you need to setup raidtab ... ?
Comment 5 SpanKY gentoo-dev 2003-11-16 15:11:45 UTC
i dont know what you mean by 'setup raidtab' ... what i mean is this:
root@rux0r 0 root # cat /etc/raidtab 
raiddev /dev/md0
        raid-level              0
        nr-raid-disks   4
        persistent-superblock   1
        chunk-size              4
        device                  /dev/hde
        raid-disk               0
        device                  /dev/hdf
        raid-disk               1
        device                  /dev/hdg
        raid-disk               2
        device                  /dev/hdh
        raid-disk               3
                                
raiddev /dev/md1                
        raid-level              0
        nr-raid-disks   4       
        persistent-superblock   1
        chunk-size              4
        device                  /dev/hdi
        raid-disk               0
        device                  /dev/hdj
        raid-disk               1
        device                  /dev/hdk
        raid-disk               2
        device                  /dev/hdl
        raid-disk               3
root@rux0r 0 root # grep md /etc/fstab 
/dev/md0    /stuff     reiserfs   rw,notail           0 0
/dev/md1    /raid      reiserfs   rw,notail           0 0
Comment 6 SpanKY gentoo-dev 2004-10-09 23:49:34 UTC
dont create bogus files