Operating System - HP-UX
1834554 Members
3913 Online
110069 Solutions
New Discussion

Exported VG but didntmake map file. How can I get info back

 
Saurabh Rawat
Advisor

Exported VG but didntmake map file. How can I get info back

HI all,

I was in the process of removing FS to scracth and ffree the disk. I had unmounted FS and then I simply deactivated vg and then exported it without creating the map file. now I have disks id but I cant do pvremove since disks doesnt belongs to any VG. how can I remove PV on the disks or import it back because I HAVE TO FREE THOSE DISK.

Thanks!!!
Insanity is often the logic of mind overtasked!!!
9 REPLIES 9
john123
Trusted Contributor

Re: Exported VG but didntmake map file. How can I get info back

Once u have exported the VG no need to do a pvremove, all the LVM information would have deleted from the system,

If u just want to make sure everything is deleted from the disks do a pvcreate -f on the disks..

John
Johnson Punniyalingam
Honored Contributor

Re: Exported VG but didntmake map file. How can I get info back

>>now I have disks id but I cant do pvremove since disks doesnt belongs to any VG. how can I remove PV on the disks or import it back because I HAVE TO FREE <<

what HPUX version are you using ..?

pvremove -f


man pvremove,

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Pete Randall
Outstanding Contributor

Re: Exported VG but didntmake map file. How can I get info back

First, a map file is only required if your lvols do not follow conventional naming. If they were named lvol1, lvol2, etc, as they would have been by default, then you don't need a map.

All you need to do is run "vgimport /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c0t3d0". You will need to know the physical volume path.


Pete

Pete
Tim Nelson
Honored Contributor

Re: Exported VG but didntmake map file. How can I get info back

Unless I read your post incorrectly.

Once you vgexported the vg the disks assigned to that vg are now available for use.

Not sure why you want to do a pvremove ?

To use these disk on a new vg simply pvcreate /dev/rdsk/cxtxdx ( if it complains that it is used by another VG, ensure that it is not, and then use the -f option.

You can then use your normal procedure to create a new VG.
mkdir /dev/vgxx
mknox /dev/vgxx/group c 64 0xyy0000
vgcreate /dev/vgxx /dev/dsk/cxtxdx
lvcreate -L SIZE_MB -n NAME /dev/vgxx
newfs -o options /dev/vgxx/rNAME
edit /etc/fstab
mount /new/filesystem/mountpoint
Johnson Punniyalingam
Honored Contributor

Re: Exported VG but didntmake map file. How can I get info back

Generic steps:-
to remove file system and VG

fuser â cu

bdf

umount
Verify it was unmounted
bdf

Remove the data
rm â r
Make a copy of ftsab

cp â p /etc/fstab /etc/fstab..

Vi /etc/fstab and remove the mountpoint entry

Remove the logical volume

lvremove

Choose Y when it asks if youâ re sure.

Verify the logical volume is gone

vgdisplay â v

If all logical volumes are gone from the volume group, remove the volume group

vgreduce

vgremove

rmsf /dev/

strings /etc/lvmtab â Make sure disks and volume group are gone

(by peform all the above steps "Logical_volume as well volume group has been remove) and no need perform the pvremove

considering vgreduce command will release the allocated PV_ from assigned volume Group ,

than you can perform pvcreate -f /dev/rdsk/cxtxdx "f" force make sure to specify the current disk name,


Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Ganesan R
Honored Contributor

Re: Exported VG but didntmake map file. How can I get info back

Hi,

Once you exported the vg, it means those disks are free and not part of the exported system.

But you should understand that the data and LVM information's are still there on the disks without any modifications.

So you can import those disks on any other server and access the data. If you want those data not to be accessed by anyone simply run pvcreate -f . You can even run dd to destroy the LVM headers.
Best wishes,

Ganesh.
Saurabh Rawat
Advisor

Re: Exported VG but didntmake map file. How can I get info back

Thanks all fro your answers and I know pvcreate -f will do everything but I am not the only user to use those disks so other person might wonder why should he chose forcefull option and they are not named as usua convention (i mean lvol1.2 etc) they have diff so I cannot import back anyways the last answer seems to be helpful much to dd the disk to remove lvm headers. Anyways thanks for your quick help all.
Insanity is often the logic of mind overtasked!!!
Emil Velez
Honored Contributor

Re: Exported VG but didntmake map file. How can I get info back

if you really want to clobber the headers you can use vxdisksetup to put a vxvm header on the disk.
Armin Kunaschik
Esteemed Contributor

Re: Exported VG but didntmake map file. How can I get info back

It's alway a good idea to remove any VG information from shared (SAN) disks. Keep on doing so!
You don't really need to pvremove, but only remove the disks cleanly from the volume group e.g.:
vgreduce every disk but the last
vgremove
after that you need to remove /dev/ and your done.

Doing so will leave "clean" disks. pvreate will not complain, you won't have to use pvcreate -f.

My 2 cents,
Armin
And now for something completely different...