Operating System - HP-UX
1834595 Members
4159 Online
110069 Solutions
New Discussion

Re: Steps to remove a volume-group manually

 
michi79
Frequent Advisor

Steps to remove a volume-group manually

Hi all,

I had a defect external raid. I took it from the system without exporting the volume
group.
Now the raid is ok again, and I want to add
it again to the system from scratch.
If I try to create the vg01 again, I see
this error message

vgcreate /dev/vg01 /dev/dsk/c0t2d0
Increased the number of physical extents per physical volume to 24465.
vgcreate: Volume group "/dev/vg01" 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.

Now my question. Where is the info located
that a volume group uses this major and
minor number ? Can I delete this info

regards
L. Wahl

Ludwig Wahl
6 REPLIES 6
Alex Glennie
Honored Contributor

Re: Steps to remove a volume-group manually

Perform the following steps to resolve your errors:

1. strings /etc/lvmtab

Note: Check /dev/vg*/group and verify that there are no
duplicate major or minor numbers.

2. Display all the groups to verify that there are no duplicate
minor numbers:

ll /dev/*/group

3. Verify that /dev/vg does not contain any duplicate major or
minor numbers:

ll /dev/vg*

4. mkdir /dev/vg9g

5. mknod /dev/vg9g/group c 64 0x020000

6. vgcreate /dev/vg9g /dev/dsk/c2t3d0

Victor BERRIDGE
Honored Contributor

Re: Steps to remove a volume-group manually

Hi,
I would add after Alex, you may once verified that there is no more refs in lvmtab, vgXXgroup etc... still have at vgcreate a message saying your disk is already affected to a volume group, if it is the case you will have to follow Alex's for the check and recreate the vg but I would after the check, if you have changed your dik config (added or changed size or...) remove the old devices.
cd /dev/dsk chose the disks and remove them:
rmsf -a -D /dev/dsk c4t4d0 c4t4d1 c4t4d2 c5t4d0 c5t4d1 c5t4d2
cd ../rdsk
rmsf -a -D /dev/rdsk c4t4d0 c4t4d1 c4t4d2 c5t4d0 c5t4d1 c5t4d2

do an ioscan:
#ioscan
then
#insf -e
check your disks are the as claimed
#ioscan -fnC disk

And this is the important one if the disk have already been used in LVM on the system, and will give you the mentioned above message force the pvcreate:
#pvcreate -f /dev/rdsk/c6t0d2 ...

Then you can mkdir the group, mknod and finally vgcreate this time normally without any trouble

Now with Alex's note you have all the how to

Good luck

Victor
Bill McNAMARA_1
Honored Contributor

Re: Steps to remove a volume-group manually

You might also want to remove any
other static information in
/etc/lvmconf/
on the volume group.
This info is there after the vgcfgbackup
command executes (after every vg change)
and is usefull for rescuing/recovering
volume group structures when a disk fails.

To best move a volume group, umount all
filesystems on it.
Type mount to see which,
Then vgchange -a n vg0X
to disactivate the vg
then vgexport vg0X
I find that vgexport always works even
when vgremove doesn't!

There is a pvremove command recently introduced
to clear the pvras from the disks that'll
still remain there after getting rid of
the vgra using vgremove.. however a dd of
your kernel over the disk device file does the
same!

Later,
Bill
It works for me (tm)
Andreas D. Skjervold
Honored Contributor

Re: Steps to remove a volume-group manually

Hi
A litle late but tried to resolve my own problem that was alike your's. But I wasn't able to succeed.
What solved the case was the following;
-Used a new major number for the group file (previos 0x020000, recreated as 0x220000)

This because the major and minor number are stored in the kernel in memory. So as well a reboot might have resolved the case, but that was out of the question on my system.

Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
Vincenzo Restuccia
Honored Contributor

Re: Steps to remove a volume-group manually

ll /dev/vgxx/*
michi79
Frequent Advisor

Re: Steps to remove a volume-group manually

Thank you all, the problem is solved.

regards
L. Wahl

Ludwig Wahl