Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50711 - Checkroot fails when root fs is on EVMS volume
Summary: Checkroot fails when root fs is on EVMS volume
Status: RESOLVED FIXED
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:
: 84242 93408 112948 120852 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-10 23:19 UTC by Dirk Heinrichs
Modified: 2006-01-29 13:43 UTC (History)
10 users (show)

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


Attachments
This is how it could look like. (checkfs,3.75 KB, text/plain)
2004-05-10 23:39 UTC, Dirk Heinrichs
Details
Patch for /etc/init.d/checkroot to support EVMS root filesystem. (checkroot-evms2.patch,430 bytes, patch)
2004-12-18 21:02 UTC, Brant Katkansky
Details | Diff
New checkroot for baselayout (checkroot,2.53 KB, text/plain)
2005-04-07 06:01 UTC, Stian B. Barmen
Details
evms-start.sh for sys-fs/evms/files (evms-start.sh,116 bytes, text/plain)
2005-05-26 01:16 UTC, Asbjorn Sannes
Details
Patch to sys-fs/evms/evms-2.5.2.ebuild (evms-2.5.2-2.5.2-r1.patch,715 bytes, patch)
2005-05-26 01:20 UTC, Asbjorn Sannes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Heinrichs 2004-05-10 23:19:08 UTC
/etc/init.d/checkfs activates LVM and MD volumes, but doesn't care about EVMS. The evms init script is pretty useless for me because even when used in boot runlevel it is called too late, my volumes are not mounted (I have _everything_ on EVMS volumes). The functionality provided by /etc/init.d/evms should move into /etc/init.d/checkfs.

I discovered this yesterday when I switched from devfs to udev. With devfs I mount the _same_ /dev twice, first in the initrd, where I also do evms_activate. Then, on the real root I can just mount /dev again with the evms nodes allready present. With udev, the /dev directory in the initrd is different than the one in the real root so I need to evms_activate in the initrd (to get the root volume) and then again as early as possible in the normal boot process to get the other local volumes.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
Activate EVMS volumes from within the checkfs init script. 

Since EVMS can handle LVM and MD, it should be sufficient to 
call /sbin/evms_activate if present and skip the LVM and MD part alltogether.
Comment 1 Dirk Heinrichs 2004-05-10 23:39:37 UTC
Created attachment 31143 [details]
This is how it could look like.

Since I don't use LVM and MD, this needs some testing first.
Comment 2 Sven Wegener gentoo-dev 2004-05-11 00:04:56 UTC
sys-apps/baselayout-1.8.12 already contains support for evms in
/etc/init.d/checkfs.

when looking at the cvs header:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/checkfs,v 1.23 2003/03/24 15:25:05 azarah Exp $

i suppose you forgot to use etc-update and update pending configration files
Comment 3 Dirk Heinrichs 2004-05-11 01:36:57 UTC
Yep, you're right. Wasn't aware of it. However, there's still a chicken and egg problem when the system tries to fsck the root filesystem. Since checkroot is started before checkfs and my / is on an evms volume, checkroot fails on my system, because there is no node for it in /dev (which is udev managed).
Comment 4 Dirk Heinrichs 2004-10-29 01:52:21 UTC
Hmm, to solve that, I now invoke /sbin/evms_activate from checkroot also. This is possible because /dev is a ramdisk and can stay ro. What about moving the whole MD/LVM/EVMS stuff from checkfs to checkroot or even /sbin/rc (if I look at it, in function populate_udev, there is allready code to create dev nodes for devicemapper and LVM). This way, people with / on MD/LVM/EVMS would be able to get their root volumes checked also.
Comment 5 SpanKY gentoo-dev 2004-10-31 01:36:07 UTC
please review 1.11.4 and see if this is still not fixed
Comment 6 Dirk Heinrichs 2004-11-03 01:05:59 UTC
In 1.11.5 the only place I can find code to detect MD/LVM/EVMS volumes is still /etc/init.d/checkfs. This should IMHO be moved to either checkroot or to a separate script which is run before checkroot to catch the case that root is on a logical volume.
Comment 7 Brant Katkansky 2004-12-18 21:02:33 UTC
Created attachment 46322 [details, diff]
Patch for /etc/init.d/checkroot to support EVMS root filesystem.

This is a simple patch that I did to enable running a root filesystem on an
EVMS volume (using an initrd that supports EVMS, of course).

Patch is for /etc/init.d/checkroot (baselayout-1.9.4-r6)
Comment 8 Dirk Heinrichs 2005-03-14 23:23:49 UTC
Could somebody apply this patch to 1.11.x, please.
Comment 9 Stian B. Barmen 2005-04-07 06:01:15 UTC
Created attachment 55554 [details]
New checkroot for baselayout

This is a edited checkroot that works. I propose this over the former patch
because that does not allow evms to use a lock file. 

Please add this to baselayout asap as people using evms for / filesystems must
have it to be able to boot!
Comment 10 Stian B. Barmen 2005-05-20 06:25:59 UTC
Could this please be submitted? It is not a big thing and will helt gentooers
with evms alot! :)
Comment 11 SpanKY gentoo-dev 2005-05-20 08:25:59 UTC
no, evms no longer is maintained in baselayout, it's been broken out into
external files

upgrade to baselayout-1.11.12-r1 and update this code to work with the addon
volume code ... see raidtools/mdadm and /lib/rcscripts/addons/raid-start.sh for
an example
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2005-05-21 03:20:18 UTC
*** Bug 93408 has been marked as a duplicate of this bug. ***
Comment 13 Asbjorn Sannes 2005-05-25 13:46:59 UTC
So all we need is a evms-start.sh with:
# EVMS2 summport for /usr, /var ....
if [[ -f /sbin/evms_activate ]] ; then
ebegin "Activating EVMS2"
    evms_activate
    retval=$?       
    eend ${retval}
fi

Installed with the package sys-fs/evms to /lib/rcscripts/addons/ .. or should
that be evms2-start ? .. (this code was ripped out of the previous version of
baselayout, I wonder who ripped it out without putting it back in somewhere..)
Comment 14 Mike Nerone 2005-05-25 15:07:22 UTC
It looks that way to me, as well, but two things must be kept in mind:

1. "start_addon evms" (or evms2) needs to be at the beginning of *checkroot*,
   not checkfs or localmount (the only places where start_addon is used
   currently). Otherwise, it STILL won't support root-on-evms, which is the
   point of this bug; and
2. Since root may (and under normal circumstance is) mount read-only when
   checkroot starts, evms_activate will emit misleading warnings because it
   can't create its lockfile. To avoid this evms_activate's stderr should be
   redirected to /dev/null. Also, current LiveCD behavior (i.e. not activating
   volume managers) should probably be preserved (remember these packages get
   installed in CD images, too):

       if [ -z "${CDBOOT}" -a -f /sbin/evms_activate ]; then
           ebegin "Activating EVMS2"
           evms_activate &> /dev/null
           retval=$?
           eend ${retval}
       fi
Comment 15 Asbjorn Sannes 2005-05-25 23:54:34 UTC
Heh, removed wrong test, I was thinking we could actually do without the check
for /sbin/evms_active because it would be installed with the package which
provides it, and then it would be better if it failed a little bit more noisy
than just sitting there quiet.. because then it would be something seriously
wrong (like somone putting /sbin on a evms or deleting files "on their own")..

Also, evms on root works fine aslong as you have an initrd image (or similar),
which you would need anyways to be able to tell the kernel where root is? It
works for me atleast.. 
Comment 16 Asbjorn Sannes 2005-05-26 01:16:32 UTC
Created attachment 59859 [details]
evms-start.sh for sys-fs/evms/files
Comment 17 Asbjorn Sannes 2005-05-26 01:20:19 UTC
Created attachment 59860 [details, diff]
Patch to sys-fs/evms/evms-2.5.2.ebuild

Easily enough read, changes are so small so a manual merge might be best.. just
adds installing the evms-start.sh script (and marks everything unstable because
I havn't tested on any of those archs).
Comment 18 Asbjorn Sannes 2005-05-26 03:23:24 UTC
hm, do we really need CDBOOT check at all? I mean, those that make those livecds
shouldn't be putting evms in RC_VOLUME_ORDER at all should they? If they have to
have a standard /etc/conf.d/rc, evms could be taken out of the default
configuration (and have in a comment above instead), baselayout doesn't even
provide it so I don't think it would matter much?

Just a thought.. 
Comment 19 SpanKY gentoo-dev 2005-05-26 05:52:15 UTC
good point, but baselayout *just* introduced that variable

in the future we'll take that into consideration :)
Comment 20 Mike Nerone 2005-05-26 13:10:22 UTC
(In reply to comment #15)
> Heh, removed wrong test, I was thinking we could actually do without the check
> for /sbin/evms_active because it would be installed with the package which
> provides it

Heh...guess you're right. Force of habit. :P

> and then it would be better if it failed a little bit more noisy
> than just sitting there quiet...

The problem with that is that without the redirection, it will ALWAYS complain.
Maybe something similar to 'evms_activate &| grep -v lockfile' (I forget the
exact error message) is the solution.

> Also, evms on root works fine aslong as you have an initrd image (or similar),
> which you would need anyways to be able to tell the kernel where root is? It
> works for me atleast.. 

No, that doesn't work so simply for me. The initrd is enough to get root
mounted, but by the time the fsck in checkroot comes up, a new /dev has been put
in place, so fsck can't find the root device node (/dev/evms/root is missing
from *this* /dev). fsck errors if you don't put an evms_activate BEFORE
checkroot's fsck (or unless you're using a RC_DEVICE_TARBALL (which you must
have doctored to get it working in the first place), and even then it can still
fail if you move any drives around because the majors/minors will change: see my
bug #93408, and both of these threads from evms-devel:
http://marc.theaimsgroup.com/?l=evms-devel&m=111662718822157&w=2 and
http://marc.theaimsgroup.com/?l=evms-devel&m=111657581202304&w=2 ).
Comment 21 SpanKY gentoo-dev 2005-05-26 20:08:02 UTC
added evms-start.sh to evms-2
Comment 22 Asbjorn Sannes 2005-05-28 02:48:09 UTC
Just realized the problem :) (This wasn't the problem I was actually searching
for.. but that seems to be fixed now so..).

I'm guessing because of the age of this bug, that it isn't trival to fix or
there is some reason to use the proposed solutions.. so a couple of solutions (I
have not tested yet):

1. move start_volumes() from checkfs to checkroot
2. put start_volumes() in checkroot if fsck fails ("retry")
3. put start_volumes() as soon as /dev is available
4. make a alternative start_root_volume() which does exactly the same as
start_volumes() except that it uses another variable and it is run from checkroot.

To me nr 3. makes most sense, but there could be some unforseen sideeffects. 1.
is more of a hack. 2. will make ugly error messages (maybe), but people not
using evms won't notice.. 4. atleast is as logical as putting start_volumes() in
checkfs ..

Any comments? If I have missed something please point it out, but I think bug
should be closed as soon possible in (~arch atleast) shouldn't be too hard?
Comment 23 Asbjorn Sannes 2005-05-28 05:21:54 UTC
Not really tested, but should be working: in /sbin/rc add the line:
[ -x /sbin/evms_activate ] && /sbin/evms_activate &>/dev/null
to udev_populate() function (about line 108).

This is obviously code duplication of some sort.. maybe we should a initscript
that runs before checkroot and checkfs that does the plugins.
 
Comment 24 Mike Nerone 2005-06-09 01:33:07 UTC
What I explained at the bottom of comment #20, about needing evms_activate
before the fsck in checkroot is still broken in baselayout-1.11.12-r4, which is
now marked stable.
Comment 25 MAL 2005-07-28 03:37:56 UTC
Just so summarise, EVMS on root is broken for systems using udev (devfs works, 
right?).

Either a fix needs to be committed to unstable soon, or a notice needs to be 
added to the install guide about not using EVMS.
Comment 26 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-03 12:18:59 UTC
Mike added a start_volumes() to /sbin/rc as well ... I guess we will see how
that works and what can of worms it opens.
Comment 27 Dirk Heinrichs 2005-08-05 00:31:15 UTC
Just a thought: Since users have to use an initrd anyway when having / on an 
EVMS volume, it seems best to me to check the root device from within initrd 
and avoid checkroot alltogether. 
 
Since my own initrd does it already I just gave it a try. 
 
I did it by removing checkroot from the depend() in some init scripts and 
putting a .critical file which doesn't list checkroot into /etc/runlevels/boot. 
 
So far this works fine for me. 
Comment 28 Mike Nerone 2005-08-10 06:36:12 UTC
You can't force users to do certain things in their initrd. Some of us use
automatically generated initrd (splash users, for example) and some of us use
official initrds (I myself use the official EVMS initrd). No, better to make the
distribution work right than force people to build customized initrds.
Comment 29 Neil Katin 2005-08-20 00:15:03 UTC
This has been fixed in baselayout ...

checkfs calls functions.sh/start_volumes, which
starts all the subsystems in ${RC_VOLUME_ORDER}.

When emvs is installed it makes a file in
/lib/rcscripts/addons/evms and this calls
evms_activate.  No fuss, no muss.

Anyway, someone should mark this bug as FIXED
(I don't have update permissions on the bug)

Comment 30 Neil Katin 2005-08-20 00:33:25 UTC
Sigh; I had read the description but not all the comments.
I guess the mug changed from no evms in checkfs (which is
fixed) to evms being called too late if your root uses
it (which still exists).

Sorry for the bogus comment.
Comment 31 Dirk Heinrichs 2005-08-23 23:37:00 UTC
I'm using baselayout 1.12.0_pre6 now and populate_udev in /sbin/rc still only 
has code for activating LVM volumes. Could somebody please add this simple line 
 
[ -x /sbin/evms_activate ] && /sbin/evms_activate -q 
 
to that function, or put a start_volumes call into it, so that the bug can be 
closed. 
 
The problem also pops up on the gentoo-users and evms-devel mailing 
lists every now and then.  
Comment 32 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-25 03:45:16 UTC
(In reply to comment #31)
> I'm using baselayout 1.12.0_pre6 now and populate_udev in /sbin/rc still only 
> has code for activating LVM volumes. Could somebody please add this simple line 
>  
> [ -x /sbin/evms_activate ] && /sbin/evms_activate -q 
>  
> to that function, or put a start_volumes call into it, so that the bug can be 
> closed. 
>  
> The problem also pops up on the gentoo-users and evms-devel mailing 
> lists every now and then.  

Added to baselayout-1.12 svn.
Comment 33 SpanKY gentoo-dev 2005-08-25 06:22:42 UTC
instead of making the udev populate fatter with every additional filesystem
thingy, why dont we move the start_volumes code out of checkfs and into rc ?
Comment 34 Christian Schnidrig 2005-09-16 07:02:31 UTC
it is important that evms_activate get's called before the dm and lvm stuff in
populate_udev, otherwise evms does not correctly populate the /dev/evms directory.
Comment 35 SpanKY gentoo-dev 2005-11-20 02:48:32 UTC
*** Bug 112948 has been marked as a duplicate of this bug. ***
Comment 36 John Huttley 2005-11-20 11:16:11 UTC
Just add start_volumes
in to /sbin/rc  
Just above 

bootlog start

problem solved!
Comment 37 Jonathan Sailor 2005-12-25 11:48:25 UTC
I agree with John and SpanKY that we should add a start_volumes call before "bootlog start" in /sbin/rc because:

 - It would remove a lot of duplication: we'd no longer have to have the start_volumes call in checkfs nor the dmsetup/vgscan/... stuff in populate_uev
 - It prevents /sbin/rc from having to be changed with each new filesystem remapper (comment 33)
 - It lets /sbin/rc follow $RC_VOLUME_ORDER, which can be important (comment 34)
 - It's the simplest and most flexible way. It requires no new code.

(While I'm add it, I suppose I should ask for it to be included in currently stable baselayout too.)
Comment 38 SpanKY gentoo-dev 2005-12-25 13:10:32 UTC
we should make this change in 1.12.x i think ... less disruption for stable users
Comment 39 SpanKY gentoo-dev 2005-12-26 21:08:09 UTC
the next release of baselayout 1.12.x will start stuff in /sbin/rc

file a new bug for any issues you may have
Comment 40 SpanKY gentoo-dev 2006-01-11 05:22:14 UTC
*** Bug 84242 has been marked as a duplicate of this bug. ***
Comment 41 Mike Nerone 2006-01-20 18:57:43 UTC
I am ecstatic to report that this appears to be working correctly now with baselayout-1.11.14-r2, which recently stabilized. The architectural change you devs were discussing for 1.12.x don't appear to have been necessary for this particular issue, though I look forward to the other benefits.
Comment 42 SpanKY gentoo-dev 2006-01-29 13:43:59 UTC
*** Bug 120852 has been marked as a duplicate of this bug. ***