cancel
Showing results for 
Search instead for 
Did you mean: 

where LV names are stored?

 
SOLVED
Go to solution
stephen peng
Valued Contributor

where LV names are stored?

Guys,
I've been notified that LV names are not stored on disks(PVs), so where are they? they should not be at VGRA. If I mistakenly rm some LVs' device file, how can vgexport -m get those LVs' name of specific VGs?

regards
Stephen
17 REPLIES 17
Mel Burslan
Honored Contributor

Re: where LV names are stored?

if you export and re-import a vg, lv names are created as default names, i.e., lvol1 through lvolN as, however many logical volumes you had.

After that it is up to you if you want to rename those newly created lvol driver files under /dev/vgXX/lvolXX files back to the way they were before, by just using mv command. I was told this, as the way to do it. Never done it myself. Hence, I can not advise you to do it or discourage for that matter.
________________________________
UNIX because I majored in cryptology...
stephen peng
Valued Contributor

Re: where LV names are stored?

Burslan,
I don't think your "default name" saying was true when I use vgexport -m and vgimport -m and I did recover some accidently-lv-deleted VGs using this method. I just want to know how vgexport -m get LVs' name and whether there was another way to recover such VGs I mentioned before, not application halting needed.

regards
Stephen
James R. Ferguson
Acclaimed Contributor

Re: where LV names are stored?

Hi:

When you do a 'vgimport' with a mapfile, it is the association of the device minor number and the name in the mapfile that makes the logical volume name (as seen in the device file created).

In the absence of a mapfile, the default, standard is 'lvolN' where N is the minor number.

If you lost a mapfile, or wanted to change the names of your logical volumes you could build a custom mapfile that looks like this:

1 mylvone
2 mylvtwo
3 lvol3

Regards!

...JRF...
stephen peng
Valued Contributor

Re: where LV names are stored?

James,
So how vgexport -m creates the map file? from where it get those LVs' names?

regards
Stephen
Torsten.
Acclaimed Contributor

Re: where LV names are stored?

Good question, but I think the names are only in /etc/vgxx/... - the minor number (lvol number) gives the relation.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor
Solution

Re: where LV names are stored?

HI (again):

> So how vgexport -m creates the map file? from where it get those LVs' names?

My understanding is that the names are derived from the '/dev/vgXX' directory's files during the 'vgexport'. During a 'vgimport', you have the ability to specify a mapfile with your *own* nomenclature or let 'vgimport' use default names (as in the absence of any mapfile).

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: where LV names are stored?

I'm sure if you unmount the lvol, rename lvol and rlvol to whatever, adjust fstab and mount again, you have a new name for your lvol.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
stephen peng
Valued Contributor

Re: where LV names are stored?

James & Torsten,
Sorry, I must forget something, and I agree with your words after I did a test right before.
So, if, I accidently rm some LVs' names under /dev/vgxx on a standalone server, all I can do is vgexport and vgimpot vgxx, then mv the new-created default-name lvs to what name I need them to be.

regards
Stephen
stephen peng
Valued Contributor

Re: where LV names are stored?

Burslan,
What you said was right, I owe you points, just give me a reply.


regards
Stephen