Operating System - HP-UX
1834492 Members
3389 Online
110067 Solutions
New Discussion

Re: Find Option & LVM Option

 
SOLVED
Go to solution
Dinesh_15
Frequent Advisor

Find Option & LVM Option

Hi All

1) What is PV Key in case of LVM? What is the importance of the same? How to find the same.

2) What is the meaning of -xdev and -depth in case of cpio command

Rgds
Dinu
8 REPLIES 8
bhavin asokan
Honored Contributor

Re: Find Option & LVM Option

Sridhar Bhaskarla
Honored Contributor

Re: Find Option & LVM Option

Hi Dinesh,

1. 'PV Key' is useful if you lose a disk in a VG> It is not quite used in day-to-day operations as we often replace the disk and run 'vgcfgrestore'. If there is no choice, then you can reduce the mirrors on the disk using the 'pvkey' instead of the disk device. To find the pvkey, use 'lvdisplay -v -k /dev/vgxx/lvxx' option. Note the PVKEY corresponding to the PV where the extents are stale. Reduce the mirrors using 'lvreduce -k -m 0 /dev/vgxx/lvxx ' command.

2. -xdev and -depth are 'find' option which is often used with cpio command. -xdev means, find will not traverse filesystem undeneath the specified directory. For ex., if there is a filesystem called /usr/local and if you specify 'find /usr -xdev', then all the files under /usr except under /usr/local will be displayed. 'depth' causes find to start at the lowest lowel of the root directory specified with find command.
You may be disappointed if you fail, but you are doomed if you don't try
Dinesh_15
Frequent Advisor

Re: Find Option & LVM Option

Hi Bhavin

Thanks for the link..
I still need some more details of PV Key.
Is this the sequence in which the LV distribution happens? or just identification?


What is the meaning of -xdev and -depth in case of cpio command

Rgds
Dinu
bhavin asokan
Honored Contributor

Re: Find Option & LVM Option

hi

the find options -depth & -xdev are used with cpio command.

see the man page of find for -depth defenition

A position-independent term which causes
descent of the directory hierarchy to be done
so that all entries in a directory are acted
on before the directory itself. This can be
useful when find is used with cpio(1) to
transfer files that are contained in
directories without write permission.

it preserves the dirextory structure..


for -xdev see the following link

http://www.matilda.com/hacmp/find_tricks.html

regds,



Dinesh_15
Frequent Advisor

Re: Find Option & LVM Option

Hi Shridhar

Thanks..
Then the pvkey tricks are used in case of following..If wrong please correct

1) Not able to reduce the morror on dead disk using the disk notation.like
lvreduce -m1 /dev/vg00/lvol7 /dev/dsk/

2) Not able to run the vgcfgrestore command for the replaced disk after removing the dead disk.

Then about find options used for cpio

/* xdev means, find will not traverse filesystem undeneath the specified directory. For ex., if there is a filesystem called /usr/local and if you specify 'find /usr -xdev', then all the files under /usr except under /usr/local will be displayed. */

In the above example 'find /usr -xdev' if there is more than one directoy i.e. something like /usr/local, /usr/test, /usr/123, /usr/test2.. Does this mean that these dirctories also not included in the find option..
Are the files under /usr is backed up?

'depth' causes find to start at the lowest lowel of the root directory specified with find command.
Can you pleas explain the depth also like above eg for xdev

With Rgds
Dinu

bhavin asokan
Honored Contributor
Solution

Re: Find Option & LVM Option

hi,

the PV key of a disk indicates its order in the VG .the first PV has the key 0,the second has the key 1, etc.this does not necessarily have to be the order of appearance in lvmtab although it is usually like that,at least when a vg is created.


sometimes you will see error messages (usually when using fibre channel connections to connect to disk array) like

PV(X) is POWERFAILED in syslog.in this case X is the PV key.you can easily find the disk by lvdisplay command.

regds,

Sridhar Bhaskarla
Honored Contributor

Re: Find Option & LVM Option

Hi Dinesh,

You are quite right about PV Key now.

Regarding -xdev option, in your case any directory that holds a mount point will not be traversed. But the mount point itself will be reported. For ex., if /usr/local and /usr/123 are filesystems, then find will report about only those two directories and nothing underneath them. Rest of the directories will be reported with their contents.

About -depth option, the lowest level will be printed first. You can test it for yourself. 'test' is a subdirectory under the current directory

$find test
test
test/dir1
test/dir1/subdir
test/dir1/subdir/file
test/dir2
$find test -depth
test/dir1/subdir/file
test/dir1/subdir
test/dir1
test/dir2
test

-Sri


You may be disappointed if you fail, but you are doomed if you don't try
Dinesh_15
Frequent Advisor

Re: Find Option & LVM Option

Hi Shridhar & Bhavin

Thanks..

Let me to close the thread..

Rgds
Dinu