Operating System - HP-UX
1834650 Members
1829 Online
110069 Solutions
New Discussion

Re: 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
Torsten.
Acclaimed Contributor

Re: where LV names are stored?

>> I accidently rm some LVs' names under /dev/vgxx


Just create the special files for lvol and rlvol again, that's all.

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?

Torsten,
using mknod? I never do that before.

regards
Stephen
Torsten.
Acclaimed Contributor

Re: where LV names are stored?

Example:

mknod /dev/vg08/lvol1 b 64 0x080001
mknod /dev/vg08/rlvol1 c 64 0x080001

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!   
Mel Burslan
Honored Contributor

Re: where LV names are stored?

In my first answer, I was referring to you scenario of "accidentally deleted /dev/vgXX/lvWHATEVER" files/device drivers, when I said when you export the vg. VGRA only contains a pointer, not the name. Name is picked up (for the map file taht is) from the /dev/vgXX directory I believe. In the absence of these device files, with or without a map, you will get lvolX as your volume names. Points are not really important, as long as you get what I was trying to convey. In retrospect, I should have expressed my point more clearly.
________________________________
UNIX because I majored in cryptology...
stephen peng
Valued Contributor

Re: where LV names are stored?

Guys,
don't want to open a new threads, what is the meaning of the following messages:
[RX6600_4][root][/dev/vghq]#newfs /dev/vghq/rpeng
newfs: /etc/default/fs is used for determining the file system type
version 6 layout
49152 sectors, 49152 blocks of size 1024, log size 1024 blocks
largefiles supported
[RX6600_4][root][/dev/vghq]#mount /dev/vghq/peng /peng
/dev/vghq/peng: unrecognized file system
[RX6600_4][root][/dev/vghq]#fsadm /dev/vghq/rpeng
fsadm: /etc/default/fs is used for determining the file system type
mismatch : command version 41 - kernel version 35

regards
Stephen
Mel Burslan
Honored Contributor

Re: where LV names are stored?

QUOTE

[RX6600_4][root][/dev/vghq]#mount /dev/vghq/peng /peng
/dev/vghq/peng: unrecognized file system
[RX6600_4][root][/dev/vghq]#fsadm /dev/vghq/rpeng
fsadm: /etc/default/fs is used for determining the file system type
mismatch : command version 41 - kernel version 35

END QUOTE

fsadm command should not be run against the device files but should be pointed to mountpoints for filesystems.

in your case above, the command should look like:

fsadm /peng

But my concern is prior to that where you created the newfs and it doesn't mount.

can you try something like this:

newfs -F vxfs -o largefiles /dev/vghq/rpeng
mount -o largefiles /dev/vghq/peng /peng


did it succeed ?

Also, by any chance, did you copy the fsadm from another server or update VxVM without rebooting your machine recently ?
________________________________
UNIX because I majored in cryptology...
Ismail Azad
Esteemed Contributor

Re: where LV names are stored?

Hi stephen,

> [RX6600_4][root][/dev/vghq]#newfs /dev/vghq/rpeng

Confusing but common error relating to the filesystem type. Just type...

newfs -F vxfs /dev/vghg/rpeng

I guess this should work.... Well the error simply states that what is present in /etc/default/fs is the default filesystem type and if you cat this file you should see an obvious vxfs. However, not specifying the -F option looks like the error to me.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
stephen peng
Valued Contributor

Re: where LV names are stored?

Guys,
I think I should open a new thread about this issue:
http://h30499.www3.hp.com/t5/LVM-and-VxVM/quot-unrecognized-file-system-quot-after-newfs/m-p/5278388#M49238


regards
Stephen