Operating System - HP-UX
1837474 Members
3542 Online
110117 Solutions
New Discussion

recover pv without vgexport

 
Rashid Hamid
Regular Advisor

recover pv without vgexport

Hi all

I try to find out solution to recover a pv without using vgexport. Example, I have a hard disk from another server, I want to add in a new server as new vg without using vgexport and vgimport. Is it possible?

Thanks

I'm Parit Madirono/Parit Betak Boyz
5 REPLIES 5
Joseph Loo
Honored Contributor

Re: recover pv without vgexport

hi,

u may like to refer to this doc:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

regards.
what you do not see does not mean you should not believe
Shaikh Imran
Honored Contributor

Re: recover pv without vgexport

Hi,

what do u want to do ???
u don't want to use lvm at all or don't want to use vgexport or vgimport.

The other way which i m aware of, is
use vgcfgbackup on one server and use the same configuration file on the other server and restore it with vgcfgrestore on that disk.

Hope this helps.




I'll sleep when i am dead.
Shameer.V.A
Respected Contributor

Re: recover pv without vgexport

Hi Rashid,
You can use the following method to use hdd of another server.
1. create a directory for new vg in /dev for eg, mkdir /dev/newvg
2. check for free minor no. # ll /dev/* |grep group
3. create a new group file. eg. #mknod /dev/newvg/group c 64 0x040000
4. vgimport /dev/newvg /dev/dsk/cxtydz
5. vgchange -a y newvg

It's not must doing vgexport on the server from where you removed the disk, if you are removing temperorily.

Hope this will do...

Shameer
.... See invisible, feel intangible and achieve impossible as everything is possible ....
Devender Khatana
Honored Contributor

Re: recover pv without vgexport

Hi,

What you are trying to achive is quite possible unless you do not want to preserve the data on the disk from the old server. If this is the case you can create new PV on the disk using -f option to override the existing structure. All earlier data in this process will nodoubt will be lost.

#pvcreate -f /dev/rdsk/cxtydz

(Where /dev/dsk/cxtydz is the path of the disk in new server)

Once this is done you can create new VG on the disk.

#mkdir /dev/newvgname
#mknod group c 64 0x0?0000

(Where ? is the unique minor number confirm by listing existing group files by "ll /dev/*/group)

#vgcreate /dev/newvgname /dev/dsk/cxtydz

(Optional parameters can also be specified)

#lvcreate -L ???? /dev/newvgname

#newfs -F vxfs /dev/newvgname/rlvol1

HTH,
Devender
Impossible itself mentions "I m possible"
Raj D.
Honored Contributor

Re: recover pv without vgexport

Hi Rashid ,

You can go as follows:

In new server:
1. create the vgdir
# mkdir /dev/vgname
# ls -l /dev//*/group ( # And choose a unique one)
# cd /dev/vgname
# mknod group c 64 0x0y0000 #(use the minor no, that not used )
# vgimport /dev/vgname /dev/dsk/cXtYdZ

# vgchange -a y vgname


Now you can try to mount the filesystems, as per your convenience;
# vgdisplay -v /dev/vgname
# mkdir newmnt
# mount -F vxfs /dev/vgname/lvol1 /newmnt

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "