Operating System - HP-UX
1827801 Members
2276 Online
109969 Solutions
New Discussion

pvcreate problem on hpux 11i

 
SOLVED
Go to solution
sharif naser_1
Frequent Advisor

pvcreate problem on hpux 11i

hello experts,

i'm trying to pvcreate a disk but coul not ,it gives me the following error ( it is brand new san lun):-

#pvcreate /dev/rdsk/c9t0d3
pvcreate: Couldn't open physical volume "/dev/rdsk/c9t0d3":
Invalid argument.

any help is highly appreciated.

regards,
S.N.

22 REPLIES 22
Sridhar Bhaskarla
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi,

This doesn't look like a good disk.

Do an 'ioscan -f' and then ioscan -fnC disk and see if this disk shows up there. Check with your Storage administrators if it is not listed or listed with NO_HW status.

YOu could do 'diskinfo /dev/rdsk/c9t0d3' but that doesn't always guarantee the result.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
melvyn burnard
Honored Contributor

Re: pvcreate problem on hpux 11i

can you read or write to it?
try doing
dd if=/stand/vmunix of=/dev/rdsk/c9t0d3 bs=1024k

If that works, then try reading from it doing:
dd if=/dev/rdsk/c9t0d3 of=/dev/null bs=1024k

If it does not work, you either have a bad/faulty LUN, or there is some configuration issue on your SAN environment.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Ravi_8
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi,

#ioscan -fnC disk

check whether the disk is claimed or not.
if claimed
#diskinfo /dev/rdsk/cxtxdx ( as you see in ioscan o/p)
if disk is ok
#pvcreate -f /dev/rdsk/cxtxdx
if fails
#dd if=/dev/rdsk/cxtxdx of=/dev/null bs=1024K

look for any I/O error
never give up
Stefan Farrelly
Honored Contributor

Re: pvcreate problem on hpux 11i

Did you try pvcreate -f on it, normally we have to for new luns.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Lorenzo Facello
Valued Contributor

Re: pvcreate problem on hpux 11i

Hi,
check with:
ioscan -fnCdisk
you should see the dev file CLAIMED

maybe you have to install special file:
insf -e

then
pvcreate -f (force) /dev/rdsk/cxtxdx
Hope this helps
Fabio Ettore
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi guys,

I would NOT use -f option on pvcreate!
Without -f option you see if disk belongs to a volume group. If pvcreate has not problem then it works without -f option too.
The -f option has just to be used when deleting and formatting a LVM disk (and you know what you are doing...).

S.N.,
what about

# diskinfo /dev/rdsk/c9t0d3

Best regards,
Ettore
WISH? IMPROVEMENT!
Jakes Louw
Trusted Contributor

Re: pvcreate problem on hpux 11i

AFAIK, at 11i pvcreate will not overwrite a disk that is already in a VG: it seems to check LVMTAB for the presence of that disk anyway.

However: if you are running MC/SG and you share disk resources, this will be a VERY bad command to execute.....
Trying is the first step to failure - Homer Simpson
sharif naser_1
Frequent Advisor

Re: pvcreate problem on hpux 11i

Hi guys,

you all overwhelmed me with kindness, it seems that i have bad lvmtab. how can i have neat & clean lvmtab. is it through vgscan or i have to do something more.



thanks alot guys


Regards,
Sharif
Fabio Ettore
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi Jakes,

I don't understand if you refer about with or without -f option. Anyway -f option (it stands for force) on pvcreate forces command to overwrite disk without checks in /etc/lvmtab. Without -f option pvcreate involves as you said, that is checks in /etc/lvmtab.
This behaviour of pvcreate doesn't depend from HP-UX versions.

Best regards,
Ettore
WISH? IMPROVEMENT!
Jakes Louw
Trusted Contributor

Re: pvcreate problem on hpux 11i

Ettore

Please look at the following (disk was originally part of a VG, but VG was dropped using VGEXPORT, as can be seen from first execution of pvcreate):

wblvh085:/) pvcreate /dev/rdsk/c11t4d2
pvcreate: The physical volume already belongs to a volume group
wblvh085:/) pvcreate -f /dev/rdsk/c11t4d2
Physical volume "/dev/rdsk/c11t4d2" has been successfully created.
wblvh085:/) vgcreate /dev/vg_crap /dev/dsk/c11t4d2
Increased the number of physical extents per physical volume to 2157. Volume group "/dev/vg_crap" has been successfully created. Volume Group configuration for /dev/vg_crap has been saved in /etc/lvmconf/vg_cr ap.conf
wblvh085:/) pvcreate -f /dev/rdsk/c11t4d2
pvcreate: The physical volume "/dev/dsk/c11t4d2" is already recorded in the "/et c/lvmtab" file.


So what say you now?
Trying is the first step to failure - Homer Simpson
nancy rippey
Trusted Contributor

Re: pvcreate problem on hpux 11i

mv /etc/lvmtab somewhere to save it.
recreate the lvmtab 'vgscan -a

nrip
Fabio Ettore
Honored Contributor

Re: pvcreate problem on hpux 11i

Jakes

what do you want that I say?
I have thought that pvcreate -f always overwrites disk, every times. Instead if disk is into /etc/lvmtab then pvcreate -f doesn't work.
Anyway man page of pvcreate about -f option indicates that:

............
command does a minimal verification, so care should be taken to assure that the disk is not already in use prior to invoking the command.
.............

Instead of 'command does a minimal verification', it could be 'command checks /etc/lvmtab'.
Maybe I wouldn't have wronged thoughts about it.

I am in this world, I am not perfect!

Ettore
WISH? IMPROVEMENT!
Steven E. Protter
Exalted Contributor

Re: pvcreate problem on hpux 11i

I had exactly this problem earlier in the week.

insf -e
pvcreate

fixes it.

It also lets you recognize new LUNS on non HP disk arrays without booting the box.

Lorenzo Facello deserves a rabbit, I'm just backing him up.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jakes Louw
Trusted Contributor

Re: pvcreate problem on hpux 11i

Ettore

No problems, mate: nobody can know everything. Must be lots that you know that I don't......

But at least it's nice to know LVM is looking after us a little when we make mistakes....;->
Trying is the first step to failure - Homer Simpson
sharif naser_1
Frequent Advisor

Re: pvcreate problem on hpux 11i

experts,

original lvmtab entries are :-
# strings /etc/lvmtab.orig
/dev/vg00
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0
/dev/vg01
/dev/dsk/c4t0d1
/dev/vg02
/dev/dsk/c4t0d2
/dev/vg1
/dev/dsk/c9t0d0
/dev/vg2
/dev/dsk/c9t0d1
/dev/vg3

well, vg01,vg02 & vg3 need to be taken out,
vg01 & vg02 were accessible but vg3 was not.

i moved the lvmtab & did vgscan after i vgexport vg01,vg02 & vg3.
now the output of vgscan is

# vgscan
Creating "/etc/lvmtab".
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg00
".
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg1"
.
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg2"
.
Couldn't stat physical volume "/dev/dsk/c3t2d0":
Invalid argument
Physical Volume "/dev/dsk/c9t0d2" is not part of a Volume Group.

i want lvmtab file to have a neat data how could i do the houskeeping of lvmtab & get rid of this annoying output.

regards,
Fabio Ettore
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi again Sharif,

just for a summary of situation:

- why have you exported volume groups?
Output of vgscan is normal because vgexport takes out disks form /etc/lvmtab.

- vgimport again all volume groups and please answer the following questions by posting output:

# diskinfo /dev/rdsk/c9t0d3
# dd if=/dev/rdsk/c9t0d3 /dev/null bs=1024K

Best regards,
Ettore
WISH? IMPROVEMENT!
G. Vrijhoeven
Honored Contributor

Re: pvcreate problem on hpux 11i

Hi,

You can create a script:

#!/usr/bin/ksh
SIZE=`ll | awk '{ print $5}'`
if [ $SIZE -gt ]
then
backup command
fi

and create a second script that checks that this script is running or start is with cron if it is not running.

Gideon
sharif naser_1
Frequent Advisor

Re: pvcreate problem on hpux 11i

Hi Ettore,

well, i have exported the volume groups becuase there not in use any more ,those group were on local disks & after that we upgraded to san so they are temporary used to shift the data to san disks.

- should i do vgimport or just copy the original lvmtab back again.

- diskinfo output :-
diskinfo -v /dev/rdsk/c9t0d3
diskinfo: can't open /dev/rdsk/c9t0d3: Invalid argument

dd output:

# dd if=/dev/rdsk/c9t0d3 /dev/null bs=1024K
dd: bad arg /dev/null

Regards
Fabio Ettore
Honored Contributor

Re: pvcreate problem on hpux 11i

I apologize, I wronged about dd command:

dd if=/dev/rdsk/c9t0d3 of=/dev/null bs=1024k

About /etc/lvmtab: the last vgscan command recreated /etc/lvmtab according to disks that system finds with relative volume groups. Your vgexport took out disks. Then you do a vgimport now.

Anyway /dev/dsk/c9t0d3 seems to not be existent! Because all commands don't recognize it (I am enough sure to tell you that dd command fail too).
A silly question: are you sure that LUN is called /dev/dsk/c9t0d3?
WISH? IMPROVEMENT!
Srinivas Thokala_1
Frequent Advisor

Re: pvcreate problem on hpux 11i

Use # strings /etc/lvmtab
and make sure the particular disk is not already part of any VG before using pvcreate.

If not use #pvcreate -f /dev/rdsk/cxdxtx

SRao
Srinivas Thokala
Sridhar Bhaskarla
Honored Contributor
Solution

Re: pvcreate problem on hpux 11i

Sharif,

If you didn't need those volume groups, then what you did was correct - vgexporting the volume groups.

Is your lvmtab looking clean now?. For ex., are you getting any more errors when you do a 'vgdisplay -v' or 'lvlnboot -v' ?.

You can do an 'ioscan -fnC disk' and look at the output. Those are all the disks you have on the system. You would probably see NO_HW status for the path corresponding to the device file c9t0d3. c9- indicates that it was most probably a SAN disk. You might have lost it during your SAN maintenance.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
sharif naser_1
Frequent Advisor

Re: pvcreate problem on hpux 11i

sri,

The disk is not in any volume group, that why it is inaccessible, it is there under /dev/dsk.

how come it is there. it should not.

i think i will remove it.

anyway thanks alot Sridhar for help.

regards,