* Relabeling UUID @ 2006-12-12 23:30 Bill Davidsen 2006-12-13 0:29 ` Neil Brown 0 siblings, 1 reply; 6+ messages in thread From: Bill Davidsen @ 2006-12-12 23:30 UTC (permalink / raw) To: Linux Raid List I needed to move an array to other drives, and because of the way the array is used, want to keep the UUID on the new array. It doesn't appear that uuid= works with create (why?), or that stopping the array and then using assemble with uuid= will renumber the array in the superblock. What's the correct way to do this, or is it broken? And why can't I specify uuid= in create? -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Relabeling UUID 2006-12-12 23:30 Relabeling UUID Bill Davidsen @ 2006-12-13 0:29 ` Neil Brown 2006-12-13 5:42 ` Bill Davidsen 0 siblings, 1 reply; 6+ messages in thread From: Neil Brown @ 2006-12-13 0:29 UTC (permalink / raw) To: Bill Davidsen; +Cc: Linux Raid List On Tuesday December 12, davidsen@tmr.com wrote: > I needed to move an array to other drives, and because of the way the > array is used, want to keep the UUID on the new array. It doesn't appear > that uuid= works with create (why?), or that stopping the array and then > using assemble with uuid= will renumber the array in the superblock. --update=uuid > > What's the correct way to do this, or is it broken? And why can't I > specify uuid= in create? Added to my 'todo' list - but no promises. NeilBrown ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Relabeling UUID 2006-12-13 0:29 ` Neil Brown @ 2006-12-13 5:42 ` Bill Davidsen 2006-12-13 10:50 ` Neil Brown 0 siblings, 1 reply; 6+ messages in thread From: Bill Davidsen @ 2006-12-13 5:42 UTC (permalink / raw) To: Neil Brown; +Cc: Linux Raid List Neil Brown wrote: > On Tuesday December 12, davidsen@tmr.com wrote: > >> I needed to move an array to other drives, and because of the way the >> array is used, want to keep the UUID on the new array. It doesn't appear >> that uuid= works with create (why?), or that stopping the array and then >> using assemble with uuid= will renumber the array in the superblock. >> > > --update=uuid > > >> What's the correct way to do this, or is it broken? And why can't I >> specify uuid= in create? >> > > Added to my 'todo' list - but no promises. Before I tell you that doesn't work, could you provide a complete command line you expect to work rather than just one argument? Showing the array designator and the location of the actual new UUID to use? We think we have tried every combination of array name or array components in every order, and other than a fine collection of error messages have not had any luck. We would look at the example but found none. -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Relabeling UUID 2006-12-13 5:42 ` Bill Davidsen @ 2006-12-13 10:50 ` Neil Brown 2006-12-13 14:30 ` David Greaves 2006-12-13 21:37 ` Bill Davidsen 0 siblings, 2 replies; 6+ messages in thread From: Neil Brown @ 2006-12-13 10:50 UTC (permalink / raw) To: Bill Davidsen; +Cc: Linux Raid List On Wednesday December 13, davidsen@tmr.com wrote: > > Before I tell you that doesn't work, could you provide a complete > command line you expect to work rather than just one argument? Showing > the array designator and the location of the actual new UUID to use? We > think we have tried every combination of array name or array components > in every order, and other than a fine collection of error messages have > not had any luck. > > We would look at the example but found none. Hmmm.... yes ..... well..... # mdadm -V mdadm - v2.5.6 - 9 November 2006 # mdadm -Dvb /dev/md1 ARRAY /dev/md1 level=raid5 num-devices=3 UUID=9f148061:9b31aaf3:1727f0dc:460ad0c5 devices=/dev/sdc,/dev/sdd,/dev/sde # mdadm -S /dev/md1 mdadm: stopped /dev/md1 # mdadm -Aamd /dev/md1 --update=uuid --uuid=12345678:9abcdef0:fedcba98:76543210 /dev/sdc /dev/sdd /dev/sde mdadm: Could not update uuid on /dev/sdc. mdadm: Could not update uuid on /dev/sdd. mdadm: Could not update uuid on /dev/sde. mdadm: /dev/md1 has been started with 3 drives. # mdadm -Dvb /dev/md1 ARRAY /dev/md1 level=raid5 num-devices=3 UUID=12345678:9abcdef0:fedcba98:76543210 devices=/dev/sdc,/dev/sdd,/dev/sde Ok, so there is an error message, but it does actually change the uuid. In Assemble.c, if (strcmp(update, "uuid")==0 && ident->bitmap_fd) if (bitmap_update_uuid(ident->bitmap_fd, info.uuid) != 0) fprintf(stderr, Name ": Could not update uuid on %s.\n", devname); should be if (strcmp(update, "uuid")==0 && ident->bitmap_fd >= 0) if (bitmap_update_uuid(ident->bitmap_fd, info.uuid) != 0) fprintf(stderr, Name ": Could not update uuid on %s.\n", devname); That will get rid of the error message. I guess I should add '--update=uuid' to the regression test suite. Note that you need to use something other than the uuid to identify the array. A list of devices is the most obvious choice. Patches to the man page to add useful examples are always welcome. NeilBrown ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Relabeling UUID 2006-12-13 10:50 ` Neil Brown @ 2006-12-13 14:30 ` David Greaves 2006-12-13 21:37 ` Bill Davidsen 1 sibling, 0 replies; 6+ messages in thread From: David Greaves @ 2006-12-13 14:30 UTC (permalink / raw) To: Neil Brown; +Cc: Bill Davidsen, Linux Raid List Neil Brown wrote: > Patches to the man page to add useful examples are always welcome. And if people would like to be more verbose, the wiki is available at http://linux-raid.osdl.org/ It's now kinda useful but definitely not fully migrated from the old RAID FAQ. David ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Relabeling UUID 2006-12-13 10:50 ` Neil Brown 2006-12-13 14:30 ` David Greaves @ 2006-12-13 21:37 ` Bill Davidsen 1 sibling, 0 replies; 6+ messages in thread From: Bill Davidsen @ 2006-12-13 21:37 UTC (permalink / raw) To: Neil Brown; +Cc: Linux Raid List Neil Brown wrote: > On Wednesday December 13, davidsen@tmr.com wrote: > >> Before I tell you that doesn't work, could you provide a complete >> command line you expect to work rather than just one argument? Showing >> the array designator and the location of the actual new UUID to use? We >> think we have tried every combination of array name or array components >> in every order, and other than a fine collection of error messages have >> not had any luck. >> >> We would look at the example but found none. >> > > Hmmm.... yes ..... well..... > > # mdadm -V > mdadm - v2.5.6 - 9 November 2006 > # mdadm -Dvb /dev/md1 > ARRAY /dev/md1 level=raid5 num-devices=3 UUID=9f148061:9b31aaf3:1727f0dc:460ad0c5 > devices=/dev/sdc,/dev/sdd,/dev/sde > # mdadm -S /dev/md1 > mdadm: stopped /dev/md1 > # mdadm -Aamd /dev/md1 --update=uuid --uuid=12345678:9abcdef0:fedcba98:76543210 /dev/sdc /dev/sdd /dev/sde > mdadm: Could not update uuid on /dev/sdc. > mdadm: Could not update uuid on /dev/sdd. > mdadm: Could not update uuid on /dev/sde. > mdadm: /dev/md1 has been started with 3 drives. > # mdadm -Dvb /dev/md1 > ARRAY /dev/md1 level=raid5 num-devices=3 UUID=12345678:9abcdef0:fedcba98:76543210 > devices=/dev/sdc,/dev/sdd,/dev/sde > > Ok, so there is an error message, but it does actually change the > uuid. > I guess that in testing I should have checked to see if it worked, but... I don't feel so dumb for not finding that now. Thanks! > In Assemble.c, > if (strcmp(update, "uuid")==0 && > ident->bitmap_fd) > if (bitmap_update_uuid(ident->bitmap_fd, info.uuid) != 0) > fprintf(stderr, Name ": Could not update uuid on %s.\n", > devname); > > should be > if (strcmp(update, "uuid")==0 && > ident->bitmap_fd >= 0) > if (bitmap_update_uuid(ident->bitmap_fd, info.uuid) != 0) > fprintf(stderr, Name ": Could not update uuid on %s.\n", > devname); > > That will get rid of the error message. > I guess I should add '--update=uuid' to the regression test suite. > Prevents PITA users like me from whining. ;-) > Note that you need to use something other than the uuid to identify > the array. A list of devices is the most obvious choice. > For something few people do that's certainly acceptable. That said, it certainly would be the most convenient solution to allow the uuid= option on the create in the first place. But this is a corner case, so unless I find that I want to code it myself (may) other solutions are fine. > Patches to the man page to add useful examples are always welcome. Hint taken. Thanks again for clarifying this, I assumed the error message meant I had it wrong, and didn't check to see if it actually worked. -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-12-13 21:37 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-12-12 23:30 Relabeling UUID Bill Davidsen 2006-12-13 0:29 ` Neil Brown 2006-12-13 5:42 ` Bill Davidsen 2006-12-13 10:50 ` Neil Brown 2006-12-13 14:30 ` David Greaves 2006-12-13 21:37 ` Bill Davidsen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).