* [linux-lvm] Inconsistent naming...? @ 2011-07-11 1:31 Linda A. Walsh 2011-07-11 2:16 ` Alasdair G Kergon 2011-07-11 2:58 ` [linux-lvm] Inconsistent naming...? Alasdair G Kergon 0 siblings, 2 replies; 13+ messages in thread From: Linda A. Walsh @ 2011-07-11 1:31 UTC (permalink / raw) To: LVM general discussion and development I created a snapshot volume "with the name corresponding the volume name-date-time: ll /dev/Home+Space/ total 0 lrwxrwxrwx 1 8 Jul 10 18:16 Home-2011.07.07-00.00.00 -> ../dm-12 lrwxrwxrwx 1 7 Jul 10 18:16 Home-2011.07.10-09.42.07 -> ../dm-5 Ok and they look that way in 'lvs', but when I mount them, 'df'' (or mount) shows: /dev/mapper/Home+Space-Home--2011.07.07--00.00.00 ^^ ^^ 897M 160K 897M 1% /home/snapdir/@GMT-2011.07.07-00.00.00 /dev/mapper/Home+Space-Home--2011.07.10--09.42.07 1.0T 468G 557G 46% /home/snapdir/@GMT-2011.07.10-09.42.07 Notice the device name. notice how the single dashes are now displayed as two dashes?!?! What up with that? Seems like a bug somewhere... -- though it doesn't **seem** to affect how it work....but it is disturbing...I thought my volume names had mutated somehow... ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-11 1:31 [linux-lvm] Inconsistent naming...? Linda A. Walsh @ 2011-07-11 2:16 ` Alasdair G Kergon 2011-07-11 2:27 ` Linda A. Walsh 2011-07-18 5:52 ` Luca Berra 2011-07-11 2:58 ` [linux-lvm] Inconsistent naming...? Alasdair G Kergon 1 sibling, 2 replies; 13+ messages in thread From: Alasdair G Kergon @ 2011-07-11 2:16 UTC (permalink / raw) To: Linda A. Walsh; +Cc: LVM general discussion and development The canonical name to use is /dev/<vgname>/<lvname>. That's been inherited from the original LVM1 code and has never changed. That's the only form of the name to use to maintain compatibility. Other forms - dm-N and /dev/mapper/X-Y are internal and the format of those is not guaranteed: indeed there'll probably be some further changes soon to workaround some other completely arbitrary udev restrictions we don't cope with yet. Different versions of df and mount haven't always retained this preferred form for their output. Alasdair ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-11 2:16 ` Alasdair G Kergon @ 2011-07-11 2:27 ` Linda A. Walsh 2011-07-18 5:52 ` Luca Berra 1 sibling, 0 replies; 13+ messages in thread From: Linda A. Walsh @ 2011-07-11 2:27 UTC (permalink / raw) To: LVM general discussion and development Alasdair G Kergon wrote: > The canonical name to use is /dev/<vgname>/<lvname>. > That's been inherited from the original LVM1 code and has never changed. > That's the only form of the name to use to maintain compatibility. > --- Those are the format's i've used (and am using), ... just that the output from mount (or in /proc/mount) messed up... ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-11 2:16 ` Alasdair G Kergon 2011-07-11 2:27 ` Linda A. Walsh @ 2011-07-18 5:52 ` Luca Berra [not found] ` <4E2538E1.9040806@tlinx.org> 1 sibling, 1 reply; 13+ messages in thread From: Luca Berra @ 2011-07-18 5:52 UTC (permalink / raw) To: linux-lvm On Mon, Jul 11, 2011 at 03:16:31AM +0100, Alasdair G Kergon wrote: >The canonical name to use is /dev/<vgname>/<lvname>. >That's been inherited from the original LVM1 code and has never changed. >That's the only form of the name to use to maintain compatibility. > >Other forms - dm-N and /dev/mapper/X-Y are internal and the format of >those is not guaranteed: indeed there'll probably be some further >changes soon to workaround some other completely arbitrary udev >restrictions we don't cope with yet. > >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 .... L. -- Luca Berra -- bluca@comedia.it ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <4E2538E1.9040806@tlinx.org>]
* Re: [linux-lvm] mount's (&udev's) dirty little naming problem -- (was Inconsistent naming...?) [not found] ` <4E2538E1.9040806@tlinx.org> @ 2011-07-19 15:39 ` Luca Berra 0 siblings, 0 replies; 13+ messages in thread From: Luca Berra @ 2011-07-19 15:39 UTC (permalink / raw) To: linux-lvm On Tue, Jul 19, 2011 at 12:57:21AM -0700, Linda A. Walsh wrote: > (sorry for the length of this, in advance, but I've tried to give > this some though...(maybe not enough/maybe too much!) ;-) ) > > Luca Berra wrote: > > On Mon, Jul 11, 2011 at 03:16:31AM +0100, Alasdair G Kergon wrote: > >> The canonical name to use is /dev/<vgname>/<lvname>. ... > >> > >> [~Other forms - dm-N and /dev/mapper/X-Y are 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 .... > > --- > > 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 1 L. -- Luca Berra -- bluca@comedia.it ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-11 1:31 [linux-lvm] Inconsistent naming...? Linda A. Walsh 2011-07-11 2:16 ` Alasdair G Kergon @ 2011-07-11 2:58 ` Alasdair G Kergon 2011-07-13 10:47 ` Linda A. Walsh 1 sibling, 1 reply; 13+ messages in thread From: Alasdair G Kergon @ 2011-07-11 2:58 UTC (permalink / raw) To: Linda A. Walsh; +Cc: LVM general discussion and development On Sun, Jul 10, 2011 at 06:31:27PM -0700, Linda A. Walsh wrote: > Notice the device name. notice how the single dashes are now displayed > as two dashes?!?! Roughly: a dash is the separator we chose, and we double it to escape a real dash. But we still need to extend our escaping mechanism to handle characters that udev states it doesn't support in primary device names but which the old /dev did used to support (and so we still do). Alasdair ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-11 2:58 ` [linux-lvm] Inconsistent naming...? Alasdair G Kergon @ 2011-07-13 10:47 ` Linda A. Walsh 2011-07-13 15:39 ` Stuart D. Gathman 2011-07-18 2:38 ` [linux-lvm] Inconsistent naming needs to be fixed (was Re: Inconsistent naming...?) Linda A. Walsh 0 siblings, 2 replies; 13+ messages in thread From: Linda A. Walsh @ 2011-07-13 10:47 UTC (permalink / raw) To: LVM general discussion and development Alasdair G Kergon wrote: > On Sun, Jul 10, 2011 at 06:31:27PM -0700, Linda A. Walsh wrote: > >> Notice the device name. notice how the single dashes are now displayed >> as two dashes?!?! >> > > Roughly: a dash is the separator we chose, and we double it to escape a > real dash. But we still need to extend our escaping mechanism to handle > characters that udev states it doesn't support in primary device names > but which the old /dev did used to support (and so we still do). > ---- Roughly, if I give a script the mount point of a logical device, how can I find out the name of the LV it is on? Before I stumbled upon this quote-hack, I could look the mount point in /proc/mounts and get the dev name. But since the devname in /proc/mounts is corrupt -- that's not possible. So what is the recommended way to do something that should be very simple, but is not because of a specialized 'quoting' scheme (sigh)...just tired...I should be in bed, but was trying to do a snap and fix the scripts...but ug... Maybe tomorrow...I'll think of someting else, or you have something to recommend, since it sounds like you want to change the mangling even more so the device name won't match what what is in /proc/mounts... (How can that not be a bug? Does proc/mounts double quote every '-'? with another?_ Thanks... linda ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-13 10:47 ` Linda A. Walsh @ 2011-07-13 15:39 ` Stuart D. Gathman 2011-07-13 16:11 ` Alasdair G Kergon 2011-07-18 2:38 ` [linux-lvm] Inconsistent naming needs to be fixed (was Re: Inconsistent naming...?) Linda A. Walsh 1 sibling, 1 reply; 13+ messages in thread From: Stuart D. Gathman @ 2011-07-13 15:39 UTC (permalink / raw) To: LVM general discussion and development On Wed, 13 Jul 2011, Linda A. Walsh wrote: > Roughly, if I give a script the mount point of a logical device, how can I > find > out the name of the LV it is on? > > Before I stumbled upon this quote-hack, I could look the mount point in > /proc/mounts and get the dev name. I apologize for not being more helpful and actually posting such a script (would be happy to do so when I find the link to the quoting spec), but I would write a python script (or even a C program in the unlikely event it becomes a bottleneck) to quote/unquote lv names. Use that in your shell scripts to get the dev name. -- Stuart D. Gathman <stuart@bmsi.com> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-13 15:39 ` Stuart D. Gathman @ 2011-07-13 16:11 ` Alasdair G Kergon 2011-07-13 17:34 ` Males, Jess 0 siblings, 1 reply; 13+ messages in thread From: Alasdair G Kergon @ 2011-07-13 16:11 UTC (permalink / raw) To: Stuart D. Gathman; +Cc: LVM general discussion and development On Wed, Jul 13, 2011 at 11:39:48AM -0400, Stuart D. Gathman wrote: > I apologize for not being more helpful and actually posting such a script > (would be happy to do so when I find the link to the quoting spec), > but I would write a python script (or even a C program in the unlikely event > it becomes a bottleneck) to quote/unquote lv names. Use that > in your shell scripts to get the dev name. Oh - you've just reminded me: dmsetup splitname Alasdair ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-13 16:11 ` Alasdair G Kergon @ 2011-07-13 17:34 ` Males, Jess 2011-07-13 18:47 ` Alasdair G Kergon 0 siblings, 1 reply; 13+ messages in thread From: Males, Jess @ 2011-07-13 17:34 UTC (permalink / raw) To: LVM general discussion and development > >Oh - you've just reminded me: > dmsetup splitname > >Alasdair > That works, but it's not exactly convenient. [root@system ~]# dmsetup splitname /dev/mapper/tempvg-lvspare1 VG LV LVLayer /dev/mapper/tempvg lvspare1 If /dev/tempvg/lvspare1 is the optimal naming scheme, cut or awk is needed to recreate the name from that output. How about a 'dmsetup canonical' that takes <device> and provides /dev/<vg>/<lv>? -- Jess ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-13 17:34 ` Males, Jess @ 2011-07-13 18:47 ` Alasdair G Kergon 2011-07-14 4:05 ` Linda A. Walsh 0 siblings, 1 reply; 13+ messages in thread From: Alasdair G Kergon @ 2011-07-13 18:47 UTC (permalink / raw) To: Males, Jess; +Cc: LVM general discussion and development On Wed, Jul 13, 2011 at 01:34:15PM -0400, Males, Jess wrote: > That works, but it's not exactly convenient. > [root@system ~]# dmsetup splitname /dev/mapper/tempvg-lvspare1 It's not expecting the /dev/mapper prefix there. It's used here: 11-dm-lvm.rules:IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" Obviously we can patch it to understand the '/dev/mapper' prefix and other things. Alasdair ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [linux-lvm] Inconsistent naming...? 2011-07-13 18:47 ` Alasdair G Kergon @ 2011-07-14 4:05 ` Linda A. Walsh 0 siblings, 0 replies; 13+ messages in thread From: Linda A. Walsh @ 2011-07-14 4:05 UTC (permalink / raw) To: Males, Jess, LVM general discussion and development Alasdair G Kergon wrote: > On Wed, Jul 13, 2011 at 01:34:15PM -0400, Males, Jess wrote: > >> That works, but it's not exactly convenient. >> [root@system ~]# dmsetup splitname /dev/mapper/tempvg-lvspare1 >> > > It's not expecting the /dev/mapper prefix there. > > It's used here: > 11-dm-lvm.rules:IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" > > Obviously we can patch it to understand the '/dev/mapper' prefix and other > things. > > Alasdair > The problem is NOT what lsm puts out or what I see in /dev, it's only in the output of 'mount' and 'fstab'... and being able to map what devs are mounted on what mount points. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [linux-lvm] Inconsistent naming needs to be fixed (was Re: Inconsistent naming...?) 2011-07-13 10:47 ` Linda A. Walsh 2011-07-13 15:39 ` Stuart D. Gathman @ 2011-07-18 2:38 ` Linda A. Walsh 1 sibling, 0 replies; 13+ messages in thread From: Linda A. Walsh @ 2011-07-18 2:38 UTC (permalink / raw) To: LVM general discussion and development Linda A. Walsh wrote: > Alasdair G Kergon wrote: >> On Sun, Jul 10, 2011 at 06:31:27PM -0700, Linda A. Walsh wrote: >>> Notice the device name. notice how the single dashes are now >>> displayed as two dashes?!?! >> Roughly: a dash is the separator we chose, and we double it to escape a >> real dash. But we still need to extend our escaping mechanism to handle >> characters that udev states it doesn't support in primary device names >> but which the old /dev did used to support (and so we still do). > > Roughly, if I give a script the mount point of a logical device, how > can I find out the name of the LV it is on? Ok, I think I bass-ackwards way of hacking around this -- but my solution is unique to my usage and conventions. In my 'application' (meaning 'usage'), I start with a mount-point of a volume I want to take a snapshot of. I want to map that mount point back to the original dev. It's not straightforward when the device in /proc/mounts, isn't the real device NOR is it the name I used! I.e. real dev = /dev/dm-[0-x], name i used /dev/VG/LV. What /proc/mounts shows: /mapper/dev/<mangled VG>-<mangled LV>. So who's responsible for that mess of code so we can get /proc to either, show the value I used (when I mount by LABEL I see the 'real' devices in mounts -- not /dev/disk-by-label/<label>. It isn't consistent but it's worse, as it choose a name that's gone through some 'translation'... Am I being more clear about why this create problems (besides being confusing and just looking bad (because my computer has to come up with it's own name for a dev -- neither the one I used nor the real name? Now, I can kludge around this, by knowing some different pieces of information unique to my app/situation, but in the general case, it would be unpredictable, and that's bad, as I'd like to release these scripts if I can get them working to my satisfaction. Can the situation with /proc/mounts be fixed? ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-07-19 15:39 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-07-11 1:31 [linux-lvm] Inconsistent naming...? Linda A. Walsh 2011-07-11 2:16 ` Alasdair G Kergon 2011-07-11 2:27 ` Linda A. Walsh 2011-07-18 5:52 ` Luca Berra [not found] ` <4E2538E1.9040806@tlinx.org> 2011-07-19 15:39 ` [linux-lvm] mount's (&udev's) dirty little naming problem -- (was Inconsistent naming...?) Luca Berra 2011-07-11 2:58 ` [linux-lvm] Inconsistent naming...? Alasdair G Kergon 2011-07-13 10:47 ` Linda A. Walsh 2011-07-13 15:39 ` Stuart D. Gathman 2011-07-13 16:11 ` Alasdair G Kergon 2011-07-13 17:34 ` Males, Jess 2011-07-13 18:47 ` Alasdair G Kergon 2011-07-14 4:05 ` Linda A. Walsh 2011-07-18 2:38 ` [linux-lvm] Inconsistent naming needs to be fixed (was Re: Inconsistent naming...?) Linda A. Walsh
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).