LVM and VxVM

Deactivating volume group before importing?

 
SOLVED
Go to solution
Kevin O'Donovan
Regular Advisor

Deactivating volume group before importing?

Hi,

a little bit complicated, I have a second disk in a box which I'm trying to recover a couple of logical volumes from. No backups, bad me!!

I've created the /dev/vg01/group file using mknod, but when I run 'vgimport -v /dev/vg01 /dev/dsk/c0t5d0' I get the message "Volume group /dev/vg01 is still active".

If I do a vgchange -a n /dev/vg01 it tells me that vg01 isn't in the lvmtab file. It never was, this disk is from another system. Running vgscan doesn't solve that one, anyone any ideas?

thanks in advance,
Kevin.
9 REPLIES 9
Stefan Farrelly
Honored Contributor
Solution

Re: Deactivating volume group before importing?

Sounds like your trying to use a group file which is the same value as an existing group.
Check by doing;

cd /dev
ll */group

and ensure theyre all unique, eg;
0x000000
0x010000
0x020000
etc.

If so remake your group file and you should be able to vimport fine.
Im from Palmerston North, New Zealand, but somehow ended up in London...
A. Clay Stephenson
Acclaimed Contributor

Re: Deactivating volume group before importing?

Check that the minor device number of the group device file is unique.

e.g. 64 0x010000 may already be defined on your system.

I would also do a 'strings /etc/lvmtab' and look for any vg01 entries.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Deactivating volume group before importing?

Hi Kevin:

I am going to assume that the minor number you used is unique, since you didn't mention any error from 'mknod'. Are you sure that your choice of physical disk is correct?

Do 'strings /etc/lvmtab' to make sure that the number you choose isn't already in use.

Regards!

...JRF...
PIYUSH D. PATEL
Honored Contributor

Re: Deactivating volume group before importing?

Hi,

Check by

# ll /dev/vg*/group

and see whether group files are present.

Remember that you should be in the / directory while giving the commands.

You can create another volume group vg02 and then check out. ( Please check out whether no files are there for vg02 earlier )

#mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0x02000

Then do a vgimport and try.

I think vgscan -a should work for you.

Piyush
Kevin O'Donovan
Regular Advisor

Re: Deactivating volume group before importing?

Hi,

all pretty close to the answer, typo when creating the group, I had 01000 instead of 010000 (i.e. one zero too few) so I've recreated the group file and its behaving a bit better now.

thanks!!
Kevin.
MANOJ SRIVASTAVA
Honored Contributor

Re: Deactivating volume group before importing?

Kevin


there are 2 things to check .

1. ls -lR /dev/vg* | grep group shouldnt show two entries.
2. strings /etc/lvmtab | grep c0t5d0 shoudnt show any entry for this disk .

You can try this too :

cd /dev/vg01
mkdir lvol

vgexport /dev/vg01

and then retry to do the vgimport.


Manoj Srivastava
Terry Gibbar
Advisor

Re: Deactivating volume group before importing?

It sounds to me like you need to perform a "pvcreate -f /dev/rdsk/c0t5d0".
Inside Pitch, Gone.
fahmi_2
Occasional Contributor

Re: Deactivating volume group before importing?

My problem is not really dealing with the same problem, in fact i deleted a snapshot without impresenting it so the result is:

with 'strings /etc/lvmtab'
I have as a result the volume group associated to the this snap so when I try lvremove , the system tells me that a volume group is still exixting.

How shall i do ?
Devender Khatana
Honored Contributor

Re: Deactivating volume group before importing?

Hi,

Hope it is has got emported using vgimport command and file systems got mounted after running fsck on them. Important here would be that if the disk was part of a VG which invloved multiple disks then only those LV's can be recovered which has LV's fully distributed on this disk itself. The LV's which were distributed across other disks alongwith this one will not get recovered.

In this cae also use vgchage -a y -n q /dev/vg01 ( As you need to bye pass quorum check.)

Fahmi,

Your problem is not clear. See response in your own thread.

Terry,

Doing a pvcreate will remove old data from disk which should not be a case I think when you are recovering data.

HTH,
Devender
Impossible itself mentions "I m possible"