Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: unable to use LVM with stripes



On Thu, 2 Aug 2012, Jean-Yves Moulin wrote:

Hello everybody,

I'm trying to stripe my logical volume accross 4 disks. But once
created, LVM lost one of his physical volume ("Couldn't find device
with uuid 'XXX-xxxx...'").

Does anybody already tried that ?
...
If anybody can help, thank you very much.

I think I ran into this some time ago when I was playing around and testing LVM on an alpha system and I had several spare disks to play with.

  I believe there is a bug in sys/dev/dm/dm_target_stripe.c.  It has
a fixed size array with 10 elements that it uses to parse the argument string. The first two are the "chunk" size and number of stripes. Each following pair are the device name and offset for each stripe. The problem is that the parsing only parses 9 items instead of 10, and the offset on the 4th stripe is skipped.

The following change will fix that, and with that change, it should work.

--- sys/dev/dm/dm_target_stripe.c 4 Jan 2012 16:05:53 -0000 1.17
+++ sys/dev/dm/dm_target_stripe.c       2 Aug 2012 16:57:44 -0000
@@ -128,7 +128,7 @@ dm_target_stripe_init(dm_dev_t * dmv, vo
         * Parse a string, containing tokens delimited by white space,
         * into an argument vector
         */
-       for (ap = argv; ap < &argv[9] &&
+       for (ap = argv; ap <= &argv[9] &&
            (*ap = strsep(&params, " \t")) != NULL;) {
                if (**ap != '\0')
                        ap++;

One other think is that I don't think there is a check for more than 4 stripes, which will present a problem - it won't parse the device/offset
argument pairs for more devices.

  The argument parsing probably should be changed to parse the first two
items intially, and then parse each two items each time through the loop it does for setting up each stripe. This would allow the arguement array to only need 2 items, and there would be no limit on how many stripes are configured.


--
Michael L. Hitch                        mhitch%montana.edu@localhost
Computer Consultant
Information Technology Center
Montana State University        Bozeman, MT     USA


Home | Main Index | Thread Index | Old Index