1833758 Members
2380 Online
110063 Solutions
New Discussion

Messed up volume groups!

 
Melissa Murphy
Advisor

Messed up volume groups!

Well, I think I really made a mess of this one! I've been trying to set up volume groups on a RAID system between two HP machines. The first one is all working out and I was able to create volume groups and such. The second machine points to the alternate path and that is where I'm having problems. I actually got to where it would have been alright, but I botched it from there. I did:

# pvcreate /dev/rdsk/c4t0d1
# mkdir /dev/vgraid
# mknod /dev/vgraid/group c 64 0x040100
# vgcreate /dev/vgraid /dev/dsk/c4t0d1
# lvcreate /dev/vgraid -L 68361

That threw back an lvol1 at me. Let me tell you right now that this is pretty much my first experience with anything unix. At that point I wanted to redo it and rename it, and for some reason felt inclined to rm the vgraid directory (but later learned about vgremove, etc). I just kept digging myself deeper tweaking with the nodes, I guess and now it's just a mess.

This is what I get now whenever I try to do anything:

# pvcreate /dev/rdsk/c4t0d1
Physical volume "/dev/rdsk/c4t0d1" has been successfully created.
# mkdir /dev/vgraid
# mknod /dev/vgraid/group c 64 0x040100
# 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:
A volume group is already using this major and minor number.
Please check the minor number of the "group" device file.

#

I'm assuming by not removing my volume group properly that I most likely left some remnant of the group somewhere that I can't find. I've been reading through man pages and the forums here, but I'm having trouble finding how I can clean this up when I don't even know the path of the volume group that is using the minor number. Is there a way to clean this up, or will I end up having to wipe the disk and start fresh?

Please help!

Thanks in advance,
Melissa Murphy
11 REPLIES 11
Bill McNAMARA_1
Honored Contributor

Re: Messed up volume groups!

mknod /dev/vgraid/group c 64 0x040100
is your problem

use 0x040000
once ll /dev/*/group allows you.

Bill
It works for me (tm)
Melissa Murphy
Advisor

Re: Messed up volume groups!

Thanks for the quick reply. I pvremove'd and went through mys teps again with 'mknod /dev/vgraid/group c 64 0x040000' and still get the same error. I don't quite get what you meant when you said when ll /dev/*/group allows me to. This is the output of that -- the vg00 is on local drive.

# ll /dev/*/group
crw-r----- 1 root sys 64 0x000000 Apr 18 09:44 /dev/vg00/group
crw-r----- 1 root sys 64 0x040000 Jun 11 08:54 /dev/vgraid/group

What am I doing wrong now?

Thanks,
Melissa
James R. Ferguson
Acclaimed Contributor

Re: Messed up volume groups!

Hi Melissa:

The volume group must be unique. When you do a 'mknod', for example, to make vg01, you would specify:

# mknod /dev/vg01/group c 64 0xXY0000

...where XY=01 for volume group 01. That is, the first two digits of the group file denote the volume group number.

To unravel what you have done, do this:

# lvremove /dev/vgXX/lvolX #...for all...
# vgreduce /dev/vgXX /dev/dsk/cXtYdZ #...all but the *last* physical disk!
# vgremove /dev/vgXX #...now remove the last...
# rm /dev/vgXX/group

...JRF...
Bill McNAMARA_1
Honored Contributor

Re: Messed up volume groups!

After doing the ll /dev/*/group
you are looking for a unique index number for the vg... yours are unique.. you have a zero and a 4. (you could have chosen 1, 2, 3 ..., but not 0)
I assume you are getting the device file for the disk from ioscan -fnkCdisk

Make sure the disk/lun is the one you want:

dd if=/dev/dsk/c4t0d1 of=/dev/null

then you will have to
# pvcreate /dev/rdsk/c4t0d1
(or -f to save typing (force overwrite))
Physical volume "/dev/rdsk/c4t0d1" has been successfully created.
good!!

# mkdir /dev/vgraid
already done

# mknod /dev/vgraid/group c 64 0x040000
already done

# vgcreate /dev/vgraid /dev/dsk/c4t0d1
Should create a volume group

strings /etc/lvmtab to verify

vgdisplay /dev/vgraid

also

Then
create your lvols.

lvcreate -L 1000 vgraid
(lvol size 1000MB in vgraid)
Lvol created message

newfs -F vxfs /dev/vgraid/rlvol1
mkdir /mount
mount /dev/vgraid/lvol1 /mount
bdf

Later,
Bill
It works for me (tm)
Melissa Murphy
Advisor

Re: Messed up volume groups!

Thanks, but I think I've done too much messing around for that to work anymore. :( There is no volume group that I can see to remove. I have nothing to put in the XX spot of vgXX. All I have is a vg00 that was there when I got here and is working. The volume groups that I created previously have been removed, but not the proper way. There's no logical volumes that I can remove properly either. I can't find them anywhere, but I gues there's still traces of them left over. In my /dev directory now there's only a vg00 directory and a vgraid with the group node that I just created, but there are no working volume groups that are associated with vgraid. How would I unravel this now that I can't see the groups?

Melissa
Bill McNAMARA_1
Honored Contributor

Re: Messed up volume groups!

To remove vgs in future,
vgexport vgname

If you don't want your vgraid any more,
vgimport /dev/vgraid /dev/rdsk/c4t0d1
vgexport vgraid
cd /etc/lvmconf/
rm the vgraid.conf
files

sam can do all this for you!
/usr/sbin/sam
Don't jump into the deep end just yet!

Later,
Bill
It works for me (tm)
Melissa Murphy
Advisor

Re: Messed up volume groups!

Bill,

Thanks -- I think I'm starting to get it. Yes, I found the c4t0d1 through ioscan. I'm writing down mostly everything I've been doing and random notes, and I have here that 0x040000 is associated with c4t0d0 and 0x040100 was with c4t0d1 before I changed anything. I'm not really sure what these are (still have a lot to learn), but will I mess anything up by choosing 0x040000 like you suggested?

Also, everything is okay through pvcreate, mkdir and mknod, but when it gets to vgcreate, I still get that another group is using the minor number. If I were to choose a number other than 4 would this work now?

I was having problems with sam doing this. I have a 100GB array with hardware path 10/8.8.0.255.0.0.0 and a 67GB on 10/8.8.0.255.0.0.1 and sam would only see the large one when I wanted it on the smaller. I tried playing with the alternate path and everything, but could only create a volume group on the 100GB disk. That could have been just me not really knowing how to use sam, but I could never make it see the smaller one.

I'll keep at it ... :)

Thanks,
Melissa
MANOJ SRIVASTAVA
Honored Contributor

Re: Messed up volume groups!

Hi Melissa


I was going through what is happenning , just a thought infact if you would have used SAM to create the voulme group inplace of doing it through the command line may be you woul have avoided the total issue since SAM wou;ld not have let you create using the same minor no as used by the disk drives and may be would not have got into this at all. Though creating volume groups through SAM has its own shortcomings.

Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: Messed up volume groups!

Hi Melissa:

A common standard for volume group names is to name them "vgXX" where XX is a 2-digit number. This number is the same one that is applied to 'mknod' as I noted above, and must be unique.

You can name your volume group anything you want, however. To find out what volume group numbers are used, do:

# ls -l /dev/*/group

and look at the first two digits after "0x". Thus, if you see "0x040000" you know that this is volume group "04".

To quickly see what physical disks are associated with what volume groups you can do:

# strings /etc/lvmtab

A very good overview of LVM tasks, and standards, can be found in "HP-UX System Administration Tasks":

http://docs.hp.com/hpux/onlinedocs/B2355-90672/B2355-90672.html

Regards!

...JRF...
Melissa Murphy
Advisor

Re: Messed up volume groups!

Excellent! :)

Well, it's working out now. I used 0x010000 instead of 0x040000 and now it's okay. Why would this be? I understand why it is nice and neat to use 01 because it's the first volume group, but is there an obvious reason as to why 04 wouldn't even work out?

Anyhow, thanks a ton, guys! Getting to learn this sort of stuff is something I'd really like to pursue, and I guess if I have any questions, I know where to come! :)

Thanks again,
Melissa
James R. Ferguson
Acclaimed Contributor

Re: Messed up volume groups!

Hi Melissa (again):

In answer to your last question...any number "would" work as long as the minor number for the group file is *unique*. In your case, you had a left-over group file "0x040000" [minor number = 04].

It's simply good practice [standard], and ***it makes scripting LVM building (and destruction) easier***, if you define your volume groups as "vgNN" where NN = 00, 01, etc. and maintain the same numerical relationship between your volume groups and your group files (as built with 'mknod'. Similare principals apply for logical volume nomenclature.

Regards!

...JRF...