[prev in list] [next in list] [prev in thread] [next in thread] 

List:       evms-devel
Subject:    Re: [Evms-devel] Minor Numbers
From:       Kevin Corry <corryk () us ! ibm ! com>
Date:       2001-12-18 17:36:58
[Download RAW message or body]

On Monday 17 December 2001 18:28, Andreas Dilger wrote:
> On Dec 17, 2001  17:16 -0600, Kevin Corry wrote:
> > On Monday 17 December 2001 15:50, Tim Clymo wrote:
> > > From: Kevin Corry <corryk@us.ibm.com>
> > >
> > > > As you figured out on your own, if you get in the situation where you
> > > > can't mount root because the minor number switched, you can always
> > > > reboot and specify a new "root=" on the kernel command line to get up
> > > > and running again.
> > >
> > > Only if you have a clue where it's ended up!
> >
> > Well, your machine should have gotten all the way to the point of trying
> > to mount the root fs before croaking. As long as you have the EVMS
> > messaging level set to the default or higher, EVMS should have printed
> > some helpful messages stating which volumes it found and what minors were
> > assigned before the kernel tried to mount root. Hopefully this is enough
> > info to determine what to pass in as the "root=" argument.
>
> What would be nice (and maybe not too hard) is to hack the boot code so
> that it takes a textual root=/dev/evms/lvm/vgroot/lvroot parameter and
> does the name->devno conversion for you.  This would mean that you
> avoid the entire problem.  If EVMS can print out the names, surely it
> can also do the reverse?
>
> There is already a part of the boot process which resolves name->devno
> for the standard devices, so all you would need to do is put a call into
> the EVMS kernel code to resolve it if it starts with /dev/evms.
>
> The only minor problem is LILO doing name->devno conversion when it is
> run.  The solution (which I saw in a similar "mount-by-LABEL/UUID" patch
> is to use "append=root=LABEL" so the name resolution is done at boot time
> instead of when lilo parses lilo.conf.
>
> Cheers, Andreas

Done.

Not too hard at all. I had to add an EVMS entry to the root_dev_names 
structure in main.c. If you have devfs enabled, that is all that is needed, 
since devfs can do the necessary translation to find the correct minor number 
for the specified volume.

In the non-devfs case, I added some code to the end of evms_init to check if 
ROOT_DEV was set to the EVMS major. If it is, evms now searches for the 
volume name specified in root_device_name. If it is found, ROOT_DEV is reset 
to the appropriate minor number.

I've tested this with and without devfs, and it seems to work well. In the 
event that the user still specifies "root = /dev/evms/volume_name" in 
lilo.conf instead of "append "root=/dev/evms/volume_name"", then none of the 
code gets executed, since root_device_name is not set to the textual volume 
name, so you still have the possibility of sliding minors.

The entry I added to root_dev_names still assumes that the EVMS volumes are 
in /dev/evms. I know we discussed moving this to /dev/volumes/evms a little 
while ago. We've made all of the necessary modifications to allow this 
conversion, I just haven't had a chance to test it in the new /dev location. 
Maybe I'll do that later today. If/when we decide to move, this new entry in 
root_dev_names will also have to change to reflect the new location.

All of these changes are in CVS - only the linux-2.4 branch. I will update 
linux-2.5 later today. I will also need to update the patches directory, 
which will take a while longer. Tim - if you feel like testing this out, let 
me know how it goes.

-Kevin

_______________________________________________
Evms-devel mailing list
Evms-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/evms-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic