Operating System - HP-UX
1834908 Members
2598 Online
110071 Solutions
New Discussion

Regarding unused disks in the volume group

 
SOLVED
Go to solution
srinu_1
Frequent Advisor

Regarding unused disks in the volume group

Hi all,

I have server with 4 disks.I would like to find which disks are not in the volume group(or not used).(I want to use this disks space for some other purpose).


Thanks in advance...

Thanks
Srinu.
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: Regarding unused disks in the volume group

Shalom Srinu

ioscan -fnCdisk

identifies all disks in the system. Be to watch for the CD-DVD-ROM

strings /etc/lvmtab

Will tell you which ones are assigned to volume groups.

vgdisplay -v vg01

Will display in detail a volume group.

pvdisplay -v /dev/dsk/c1t0d0

Choose an actual disk from above.

If the pvdisplay shows nothing on the disk you are then free to vgreduce it out of a volume group and do with it as you please.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mustafa Gulercan
Respected Contributor

Re: Regarding unused disks in the volume group

hi;
use vgdisplay -v
at the bottom of the output you can see the device name of disks.
and use #ioscan -funCdisks to see the disks
also may use #diskinfo /dev/rdsk/xxxxx

to see available area just use #bdf


regards;
mustafa
Jaime Bolanos Rojas.
Honored Contributor

Re: Regarding unused disks in the volume group

Srinu


To know the total disks that you have on the system:

ioscan -fnkC disk

to know which of those disks are being used in a volume group:

strings /etc/lvmtab

Regards,

Jaime.

Work hard when the need comes out.
James R. Ferguson
Acclaimed Contributor
Solution

Re: Regarding unused disks in the volume group

Hi Srinu:

Be careful. While 'stings '/etc/lvmtab' or simply 'vgdisplay -v' will expose all *LVM* disks *currently* in use by a server, it will not show you *raw* disks nor disks that have valid information but have been 'vgexport'ed, nor disks owned by another node of a cluster, nor non-LVM disks!

Regards!

...JRF...
srinu_1
Frequent Advisor

Re: Regarding unused disks in the volume group


Hi please find the o/p below

shivaji#ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
disk 0 0/0/1/0.1.0 sdisk CLAIMED DEVICE HP DVD-ROM 6x/32x
/dev/dsk/c0t1d0 /dev/rdsk/c0t1d0
disk 1 0/0/2/0.6.0 sdisk CLAIMED DEVICE HP 36.4GST336706LC
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
disk 2 0/0/2/1.6.0 sdisk CLAIMED DEVICE SEAGATE ST39102LC
/dev/dsk/c2t6d0 /dev/rdsk/c2t6d0
disk 3 1/12/0/0.5.0 sdisk CLAIMED DEVICE SEAGATE ST39175LC
/dev/dsk/c3t5d0 /dev/rdsk/c3t5d0
disk 4 1/12/0/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST39236LC
/dev/dsk/c3t6d0 /dev/rdsk/c3t6d0



shivaji#strings /etc/lvmtab
/dev/vg00
/dev/dsk/c1t6d0
/dev/vg01
/dev/dsk/c3t5d0
/dev/dsk/c3t6d0


As per the above output one disk is not in the volume group.But I want to check any data on this unused disk.is it possible?.

Regards,
srinu.
Jaime Bolanos Rojas.
Honored Contributor

Re: Regarding unused disks in the volume group

Srinu,

If you are talking about raw data being used by a database, the best way to figure that one out is by calling the Database Adm and asking him if he is using that disk for any purpose.

Regards,

jaime.
Work hard when the need comes out.
Mridul Shrivastava
Honored Contributor

Re: Regarding unused disks in the volume group

TRY PVDISPLAY on the disk which is not part of any vgs. It is difficult to find whether it contains any data or not.

Even if you don't have details about the LE to PE mapping it would be difficult to recover data as well.

If you are sure no data is on the disk then do pvcreate on the disk and use it.
Time has a wonderful way of weeding out the trivial
Doug O'Leary
Honored Contributor

Re: Regarding unused disks in the volume group

Assuming nonclustered systems and SAN environment set up corrctly:

for hw in $(ioscan -funC disk | grep ^disk | awk '{print $3}')
do
pv=$(ioscan -funC disk -H ${hw} | grep dsk | awk '{print $1}')
pvdisplay ${pv} > /dev/null 2>&1
[[ $? -ne 0 ]] && echo ${pv}
done

This will show you the cdrom/dvdrom as well, so check the output to verify the disks you're looking at are actually disks.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
srinu_1
Frequent Advisor

Re: Regarding unused disks in the volume group

Thanks for help.

Regards.
srinu.