Operating System - HP-UX
1833652 Members
3703 Online
110062 Solutions
New Discussion

How do I verify if a disk device contains data

 
SOLVED
Go to solution
Stephanie Nicholls
Frequent Advisor

How do I verify if a disk device contains data

Ive found two 'spare' disks on my system that I want to use. How do I verify that they are actually blank, or if they contain data what that data is?

The disks are currently not in any volume group and a pvdisplay gives me a message:
"pvdisplay: Couldn't find the volume group to which physical volume "/dev/dsk/c10t1d3" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c10t1d3"."

However we do use raw devices for oracle so I want to confirm the DBA's havent used them at some stage.

Being a little paranoid as Ive been told all the disks were allocated.

Any thoughts ?

Thanks

Steph
4 REPLIES 4
Michael Tully
Honored Contributor

Re: How do I verify if a disk device contains data

Hi,

You can tell if a disk has previously been used by issuing:

# pvcreate /dev/rdsk/c10t1d3

If it returns this message
pvcreate: The physical volume already belongs to a volume group

Then the disk either is or was part of a group. Can any of these disks be seen from a different server? If they are, run the same commands on the other system. Also run this, I find that if it doesn't appear here then it should be safe to proceed. Check the other server in case here as well.

# strings /etc/lvmtab (and look for your disk)

If it doesn't appear you can re-use the disk by issuing:

# pvcreate -f /dev/dsk/c10t1d3

Michael
Anyone for a Mutiny ?
A. Clay Stephenson
Acclaimed Contributor

Re: How do I verify if a disk device contains data

They could be being used as device swap. Do a swapinfo -t to determine that.

Get the DBA's to generate a listing of all database files in use. That's an easy SQL script for them.
As a general rule, raw disks are typically not used directly as Oracle files but instead raw LVOL's are used.


If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor
Solution

Re: How do I verify if a disk device contains data

HI Steph

Also you can do a strings /etc/lvmtab | grep in case you want to make sure .
cd /etc/lvmconf
grep * will also give you some clue.
if the same is being by oracle as raw devices then you cans till doa strings /dev/vgXX/rlvol* if you are sure that these are a part of a lvol this command will give u a ascii data even i case the same is not readable otherwise.


Manoj Srivastava
Stephanie Nicholls
Frequent Advisor

Re: How do I verify if a disk device contains data

The disks are definately not in a volume group however strings /dev/rdsk/ did the trick and there is oracle data on them - Thank Manoj :)

I'll be referring them back to the DBA's to see if they still need them, or whether they used them as a dumping ground at some stage.

Cheers

Steph