Operating System - HP-UX
1831276 Members
2680 Online
110022 Solutions
New Discussion

Re: More volume group problems

 
SOLVED
Go to solution
Melissa Murphy
Advisor

More volume group problems

Well, here I go again. <:)

I was told that my existing volume group had to be mounted elsewhere, etc. so I thought it would be easiest to just remove what I had done and restarted. Well, I did the following:

# vgimport /dev/vgraid /dev/rdsk/c4t0d1
# vgexport vgraid
# cd /etc/lvmconf
# rm vgraid.conf

I should have used sam. *sigh*

I guess I also should have removed my logical volume as well.

Well, now this is what I get (I'm kind of just trying stuff):

# pvremove /dev/rdsk/c4t0d1
pvremove: The physical volume "/dev/rdsk/c4t0d1" belongs to an exported volume group.
pvremove: Couldn't remove physical volume "/dev/rdsk/c4t0d1".
# vgcreate /dev/vgraid /dev/dsk/c4t0d1
Increased the number of physical extents per physical volume to 17346.
vgcreate: Volume group "/dev/vgraid" could not be created:
The path does not specify a valid physical volume.
# vgreduce /dev/vgraid /dev/dsk/c4t0d1
vgreduce: Volume group "/dev/vgraid" does not exist in the "/etc/lvmtab" file.

I probably did things all out of order, but I wasn't getting anywhere, anyways. I read somewhere that I can rebuild the lvmtab, so I tried that. I did 'mv /etc/lvmtab /etc/lvmtab.old' then did a vgscan

I really shouldn't fix what isn't broken. Any pointers? How can I create a volume group now?

Thank you,
Melissa Murphy
10 REPLIES 10
Melissa Murphy
Advisor

Re: More volume group problems

Another question ...


I'm still pretty stuck and see this error:
# vpdisplay -v /dev/dsk/c4t0d1
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/dsk/c4t0d1" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c4t0d1".

What does it mean that it "belongs"?

Thanks,
Melissa
James R. Ferguson
Acclaimed Contributor

Re: More volume group problems

Hi Melissa:

OK. This is a follow-on to today's earlier post. As I indicated there, if you look do:

# strings /etc/lvmtab

...then you will see the volume groups and associated device files. /etc/lvmtab is that which is rebuilt when you did the 'vgscan'.

It's not totally clear what you are attempting to do, nor in total, what you have done.

First, do you have data on your /dev/vgraid volume group that you care about either on this system or another?

...JRF...
Melissa Murphy
Advisor

Re: More volume group problems

Mr. Ferguson,

No, there is no data on the vgraid volume group (if it's still there ...) These are pretty clean systems with nothing of importance on them.

Well, I tried to get rid of the volume group, actually. I was going to redo it mounted to another place, since I wasn't sure how to remount it to somewhere else. I think what happened is I didn't delete the logical volume first and now I'm a little hosed. I can't remove the physical volume, because a volume group is associated with this. Again, I'm not sure where this is. I tried to go through the steps we discussed in the previous thread, but I still can't create a new volume group. I have a /dev/vgraid and a /dev/vgraid/group with 0x010000, but when I try vgcreate /dev/vgraid /dev/dsk/c4t0d1, I get that the path does not specify a valid physical volume. So how do you think I messed up my physical volume?

Sorry to be a pain - I know I don't know that much here, but I'd really like to get this figured out. :)

Thanks,
Melissa
James R. Ferguson
Acclaimed Contributor

Re: More volume group problems

Hi Melissa:

Please, you are not being a "pain". We're here because we *want* to be here!

First, your 'vgdisplay' syntax is wrong. In your case, try:

# vgdisplay -v /dev/vgraid

...JRF...
Joel Shank
Valued Contributor
Solution

Re: More volume group problems

Hi Melissa

I don't think your vgexport worked properly if you still have /dev/vgraid and /dev/vgraid/group. vgexport deletes these. I'd try doing a vgexport /dev/vgraid -v to see if that will clear everything out.

If this works, then all you have to do is recreate the volume group:
1) mkdir /dev/vgraid
2) mknod /dev/vgraid/group -c 64 0x010000
3) pvcreate -f /dev/rdsk/c?t?d?
4) vgcreate ...

If the vgexport doesn't work, we'll have to look at the messages it produces to see if we can figure it out.

-OR-

You can try to force the pvcreate and try to recreate the volume group from where you are now. Try:
pvcreate -f /dev/rdsk/c?t?d?

Then your vgcreate.

Good Luck -- jls
Melissa Murphy
Advisor

Re: More volume group problems

Ahh, of course. :)

Alright, here's the output of the vgdisplay:

# vgdisplay -v /dev/vgraid
vgdisplay: Volume group "/dev/vgraid" does not exist in the "/etc/lvmtab" file.
vgdisplay: Cannot display volume group "/dev/vgraid".

And that of vgexport:

# vgexport -v /dev/vgraid
Beginning the export process on Volume Group "/dev/vgraid".
vgexport: Volume group "/dev/vgraid" does not exist in the "/etc/lvmtab" file.
vgexport: Couldn't export volume group "/dev/vgraid".

I was pretty sure I did a vgexport early on and it was okay ... but maybe now I'm not so sure.

So, whatdya think?

Thanks,
Melissa
Joel Shank
Valued Contributor

Re: More volume group problems

Melissa

I think you should force the pvcreate (use the -f option), but be sure you specify the correct physical volume.

After the device is pvcreated, you should be able to do a vgcreate using it.

Let us know how this works -- jls
Melissa Murphy
Advisor

Re: More volume group problems

Ahhh, wait a second! I did the pvcreate -f and that worked out. Then I created my vgraid and my logical volume and everything looks all right!

Wonderful! Thanks a bunch! :)
You'll hear from me soon -- the next time I go poking around. :)

Later,
Melissa
James R. Ferguson
Acclaimed Contributor

Re: More volume group problems

Hi Melissa:

So, if you want to build a volume group from scratch, using one physical disk, /dev/dsk/c4t0d1 and you want the volume group called /dev/vgraid then:

# pvcreate -f /dev/dsk/c4t0d1
# mkdir /dev/vgraid
# mknod /dev/vgraid/group c 64 0xNN0000 # where NN is the unique minor number (in hex)
# vgcreate /dev/vgraid /dev/dsk/c4t0d1
# lvcreate -L -n lvol1 /dev/vgraid

Remember to choose a unique minor number for 'mknod' by looking at what is already used with:

# ls -l /dev/*/group

Take a look at the man pages for each command and/or the HP-UX System Administration Tasks manual I cited in our earlier dialog for more details.

Regards!

...JRF...
Bill McNAMARA_1
Honored Contributor

Re: More volume group problems

Should have mentioned that earlier..

A vgexport leave the disk header on the disk that identify the disk is an lvm managed.

The long shot of this:
To reuse a disk already used by lvm, you must pvcreate -f /dev/rdsk/c?t?d?

Stick around with the forums anyway, you'll have fun!

Later,
Bill
It works for me (tm)