On 07/15/2014 01:41 PM, Nathan Scott wrote:
----- Original Message -----
[...]
Wont work (or I am confused). dm-N gets reused if it is deleted and
then a new volume is created (with or without a reboot). Here's an
example using snapshots:
Yep, understood - sorry, wasn't clear - I'm not proposing this as a "fix",
and agree your solution is the right thing to do. I was trying to find a
way to make the existing indom (which we still need for hinv.map.lvname)
behave a bit more predictably.
So, even though the numbers recycle (even moreso than I thought, from your
example) - anyone interpreting the old indom could still get a little more
expected behaviour, with the internal and external IDs actually matching.
At the moment, the internal ID is just an internal array index with value
depending on readdir() order ... *shrug* ... maybe its not worth the effort
but it might save some end-user confusion.
an end-user is going to be confused no matter what with the current
hinv.map.lvname indom and values.
And I just noticed, different persistent names can point to the
same dm mapping, e.g. with the snapshot example, two of
the cow volumes point to dm-7 (which makes sense I guess since
they are snapshots of the same basevol, so multiple copies of the
same cow updates to the basevol are not needed) :
[root@ocean ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 14 20:15 control
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-home -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-root -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 rootvg-swap -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-backup -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-backup-real -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 15 13:07 virtvg-snap1-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap2 -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap2-cow -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap3 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jul 15 13:09 virtvg-snap3-cow -> ../dm-7
lrwxrwxrwx. 1 root root 7 Jul 14 20:20 virtvg-test -> ../dm-3
Explains why virtvg-snap1-cow and virtvg-snap3-cow both map to dm-7
but not why virtvg-snap2-cow points to dm-9 ...???
|