Operating System - HP-UX
1833723 Members
3685 Online
110063 Solutions
New Discussion

Re: Figure out unused disk on the Server.

 
SOLVED
Go to solution
Gulam Mohiuddin
Regular Advisor

Figure out unused disk on the Server.

We would like to find out if any physical disk is not used on the server.

We are using LVM/Logical Volume filesystem on the server, but recently we removed and added lots of disk on this server. This was done by different persons. There may be a chance that one of disk is not configure and left unused.

Sever: N4000 HP-UX 11.0
Thanks,

Gulam.

Everyday Learning.
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: Figure out unused disk on the Server.

Do a "ioscan -fnC disk", take that listing and do a pvdisplay -v on every /dev/dsk/c#t#d#. Also, look at /etc/fstab and make sure you do not have any HFS filesystems using a "raw" disk. Also, are you running any database that use RAW Logical Volumes or RAW Disks? If so, check with your DBA's to see what drives are in use! Also, use "vgdisplay -v |more" to view every VG and mark down what disks are part of what VG.

live free or die
harry
Live Free or Die
Uday_S_Ankolekar
Honored Contributor

Re: Figure out unused disk on the Server.

Hi,

ioscan -fnC disk will give you the list of all the disks claimed /unclaimed.

Then you can use pvdisplay to check whether these disks are being used or not.

Goodluck,
-USA..
Good Luck..
Marcin Wicinski
Trusted Contributor

Re: Figure out unused disk on the Server.

Hi,

Use ioscan -fnkCdisk to find out what disks you have installed. Then compare the result with
# strings /etc/lvmtab

/etc/lvmtab contains LVM configuration: volume groups and configured phisical volumes.

Later,
Marcin Wicinski
Marco Paganini
Respected Contributor
Solution

Re: Figure out unused disk on the Server.

A simple (and rather crude) script that will tell you all the physical volumes not belogin g to any VG:

for pv in /dev/dsk/c*
do
if pvdisplay $pv >/dev/null 2>&1
then
echo "$pv: in use"
else
echo "$pv: not in use"
fi
done

This script will always tell you that your CDROM is not being used. :) That's a side effect of its simplicity. Also, check with pvdisplay -v every volume it tells you is not being used.

Make sure you have no raw devices being used outside LVM on those devices before you use them.

Regards,
Paga
Keeping alive, until I die.
Deshpande Prashant
Honored Contributor

Re: Figure out unused disk on the Server.

HI
The command "#ioscan -fnC disk" will give you the all the disks on server.
Use pvdisplay to check whether these disks are being used or not.

If the disks are on EMC frame with multiple path, use the emc utility "#inq" to find out all EMC disks and alternate paths.

Thaks.
Prashant.

Take it as it comes.
Frank Slootweg
Honored Contributor

Re: Figure out unused disk on the Server.

Besides the reponses already given:

If you are sure you are *not* using raw devices (see Harry's response) then SAM -> Disks and File Systems -> Disk Devices will show any unused disk(s).
Roger Baptiste
Honored Contributor

Re: Figure out unused disk on the Server.



Do vgdisplay -v |grep "/dev/dsk" >/tmp/used_disks


ioscan -nfCdisk >/tmp/total_disks

Now, check what is missing between the total_disks and used_disks. That should possibly be the unused disks.

But, one IMP note-- there could be pv links which are not configured in the LV''s. Pv links are two or more paths connected to the same disk. So, you need to make absolutely sure the "unused disks" are not really being usd. To do this: run
pvdisplay
If it doesn''t return anything, than you can be sure that is not used.

(Btw, did you look up your oracle restore thread?)
HTH
raj
Take it easy.
John Bolene
Honored Contributor

Re: Figure out unused disk on the Server.

Sam is your best friend at times, but it does make you a bit stupid to command line commands.

Use the Sam disk screen and look for unused drives.

You can also use this screen to find dead drives, they will show up as having 0 bytes.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Tim Nelson
Honored Contributor

Re: Figure out unused disk on the Server.

Attached is a disk mapper script I wrote awhile back.. Please exuse some of the lame scripting ( no time to clean it up ). It does all the things mentioned and outputs what every disk is assigned to and states that it is AVAILABLE if it is not used. This script was written for most HP9000 UNIX servers running HPUX 10.x or 11.x ( some fields are dependant on the ioscan formats ). Some disk models are not completely identified but can be added to the case statement. Give it a shot..
Sanjay_6
Honored Contributor

Re: Figure out unused disk on the Server.

Hi Gulam,

A way to check the unused disk is to try and add a new VG in sam. It lists all the disk which are not used by any VG. The other way is to take a ioscan output and then do a vgdisplay for all the VG's and then locate the unused disk.

Hope this helps.

Regds