1833829 Members
2330 Online
110063 Solutions
New Discussion

accessing a PV

 
SOLVED
Go to solution
Marc Ahrendt
Super Advisor

accessing a PV

i recently attached an old A3232A disk array (nike) to a newly installed 11.00 system.
i do not need the data on the LUNs but can see that they are PVs.
how can i see the data on these PVs without having any VG data on the system about them?
...i am just curious to see what the data is

FYI:
# pvdisplay -v /dev/dsk/c0t6d0
pvdisplay: Couldn't find the volume group to which physical volume "/dev/dsk/c0t6d0" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c0t6d0".
hola
9 REPLIES 9
DIPAK KUMAR ROY
Frequent Advisor

Re: accessing a PV

Probably this ARRAY was connected to another system and the PVs were part of a VG.

You can run " pvcreate -f /dev/rdsk/cxtxdx" and create new VG on them.

Hope this helps.

Dipak
Praveen Bezawada
Respected Contributor

Re: accessing a PV

HI
The disks that you are using may have been used once and still have references left to the volume group to which they earlier belonged.

pvcreate them with -f option.

...BPK...
Joseph C. Denman
Honored Contributor

Re: accessing a PV

I think the easiest way would be to go ahead and import the vg.

cd /dev
mkdir vgtest
cd vgtest
mknod group c 64 0x0?0000
vgimport -v /dev/vgtest /dev/dsk/c?t?d?
vgchange -a y vgtest
cd /dev/vgtest
ls #look to see lvols are ther
mkdir /test
mount /dev/vgtest/lvol1 /test
cd /test
#take a look around
cd /
umount /test
vgchange -a n vgtest
vgexport /dev/vgtest

This would be fairly quick.


...jcd...
If I had only read the instructions first??
Sridhar Bhaskarla
Honored Contributor

Re: accessing a PV

If you are sure they were part of a volume group before, you can import them if you know how the volume groups were set up. Means, vgimport will fail if there were more than one disk defined in those volume groups. If so, then you need to know the exact disks.

You cannot use pvdisplay command if they are not part of a volume group.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
linuxfan
Honored Contributor

Re: accessing a PV

Hi Marc,


You can do a vgscan (man vgscan) in preview mode to figure out which disks were part of the same volume group, and then you can import the disks.

Also you can run
echo 2000?8c+8x|adb /dev/dsk/cXtYdZ

If it returns information such as LVMREC then that means that disk belonged to some VG before.


-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Marc Ahrendt
Super Advisor

Re: accessing a PV

just some clarification: i do not want to reuse the PV as of yet ...just wanting to know if i can get the data off the PV (just out of interest) without have any prior information about the PV. just pretend i gave u a PV in the mail and nothing else ....could you get the data?
hola
linuxfan
Honored Contributor

Re: accessing a PV

Hi Marc,

Like i said use
vgscan -v -p
(this will run vgscan in preview mode and tell you if there are any single/multiple disks that belong to any VG prior)

Say for eg: you found one disk which belonged a VG before, you could then create a new VG
mkdir /dev/vgtmp
mknod /dev/vgtmp/group c 64 0x??????
where is 0x?????? is a unique minor number, to figure out the next available minor number you could do something like
ls -al /dev/*/group |sort +5

now import the disk into this VG using
vgimport /dev/vgtmp /dev/dsk/cXtYdZ
vgchange -a y /dev/vgtmp

you can then do a vgdisplay on the VG and see how many LVs were defined and if you want mount the filesystems etc

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sridhar Bhaskarla
Honored Contributor
Solution

Re: accessing a PV

You will sure get the data if you know exactly how the volume group was setup. If this disk was only the disk that was part of volume group, then the answer is a "certain yes".
If so, let's call the disk as c0t0d0.

#mkdir /dev/vgtest
#mknod /dev/vgtest/group c 64 0x0a0000
#vgimport vgtest /dev/dsk/c0t0d0
{here is where you will get the error if that volume group had other disks in addition to this)
If the vgimport is successful, you can see the logical volumes named lvol1, lvol2 etc., in /dev/vgtest
You may want to mount them and see the data.
#vgchange -a y vgtest
#mkdir /test1 /test2 /test3
#mount /dev/vgtest/lvol1 /test
#mount /dev/vgtest/lvol2 /test

depending on how the disk was taken out, you may need to a fsck on each of the logical volumes.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marc Ahrendt
Super Advisor

Re: accessing a PV

thx for all the replies so quickly
...thx joe and sridhar for detailed steps

i needed to fsck some of the LVs! thx sridhar for that tip, i overlooked my mount problems by assuming it had soemthing to to with LVM and not the FS
hola