mount's (&udev's) dirty little naming problem
Quoted 19 lines · Luca Berra
Quoted 18 lines · Linda A. Walsh
(sorry for the length of this, in advance, but I've tried to give
this some though...(maybe not enough/maybe too much!) ;-) )Quoted 13 lines · Luca Berra
Quoted 9 lines · Alasdair G Kergon
The canonical name to use is /dev/<vgname>/<lvname>. ...
[~Other forms - dm-N and
/dev/mapper/X-Yare internal and ... there'll probably be some further changes to workaround other
arbitrary udev restrictions...~]Different versions of df and mount haven't always retained this preferred form for their output.
note that on a freshly installed rhel 6.1 i have this in fstab
/dev/mapper/vg_candela--lv_root/ ext4 ....
Quoted 7 lines
Quoted 3 lines
---
Why are there two dashes between the VG&LG?
woops, typo, sorry for that it is :
/dev/mapper/vg_candela-lv_root/ ext4 defaults 1 1L.
------
That's consistent with current behavior -- the problem is
in the current name mangling (i,e. mounts by "/dev/VG/LV" get
xlated into "/dev/mapper/<mangled-VG>-<mangled-LV>", where
at least one manglement is xlating "-" into "--". But I've already been told that future manglements may be added due to limitations in udev.
For non LV devs, it would be like having '/dev/sdc2' xlated
into '(hd2,<rand>)' (where <rand> = some not always consistent integer) which, of course would be silly! ( ;-) ), or xlating LABEL="MyDisk-Label" => '/dev'disk/by-label/MYDISK--LABEL' (with 'My-Label' being 'canonicalized', for some definition of thereof, into some other value), vs. now, it's given the real devname (/dev/sdc<x>) (which is FINE with me...; it's the real HW name that the kernel uses, whereas 'label=xxx was a syntax I was encouraged to use as part of the suse boot system, as 'everything works with labels' (well, lets not speak about lilo, or booting from an HD w/o a ram disk, as we'll just drop support for those options...*cough*)....
As noted, the current behavior isn't giving/using either
the 'real devname' /dev/dm-[x], NOR the user name, but a mangled name making it the worst of all worlds, as there is no easy way to find out the LV and VG of the device mounted on a given mount point.
To get around this == and tell me if I'm wrong, I have to use
lvm, to output a list of all VG,LV groups.
Then using a [perl] script (I suppose BASH's Associative arrays might work too, but familiarity points toward perl at this point), I can build up an Assoc array to map devno's -> VG,LV, then use the devno of the mountpoint as an index into that.
That level of complexity is so completely LAME just to find out
the name I used to mount a FS on some mount point!....
If there is an easier way, please, hit me with a clue stick!
-l