1844420 Members
3665 Online
110233 Solutions
New Discussion

finding unused disk

 
Bernard  Bravo
Advisor

finding unused disk

Hi,

I'm having problem in finding unused physical disk from my EMC disk which is around 200.
I need to identify the disk for me to be able to add it on my volume group which it almost full.

Hope an export can help me on this.

thanks in advance.

bernard
Do good, Look Good, Feel Good
11 REPLIES 11
Sebastian Galeski_1
Trusted Contributor

Re: finding unused disk

Hi
I known that it can be hard, but two commands:
#ioscan -fnCdisk
and output of
#strings /etc/lvmtab
can resolve Your problem.
regards Seba
Alan Casey
Trusted Contributor

Re: finding unused disk

Sam / Disks and filesystems, Disk devices
Will show all disks and the vg's they are in.
you will be able to find the unassigned disk here.
Sridhar Bhaskarla
Honored Contributor

Re: finding unused disk

Hi Bernard,

Run the following commands.

1. *** All the disks on the system ***

ioscan -fnC disk |grep dsk|awk '{print $1} > alldisks.out

2. *** Disks that are currently used ****

vgdisplay -v |grep dsk |awk '{print $3}' > currentdisks.out

3. Now it it easy to find out the disks that are unused. using a combination of sort, uniq or even by a small shell script like this

for i in `cat alldisks.out`
do
grep $i currentdisks.out > /dev/null
if [ $? != 0 ]
then
echo $i >> unused.out
fi
done

This unused.out will contain all the unused disks. Also you need to make sure that this disk is literally unused before adding it. Do a pvdisplay on the disk. Sometimes the alternate links are not configured and they may be mistaken as unused disks. You can use inq command to find this also.


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

Re: finding unused disk

Hi Bernard,

Try something like:

ioscan -fnCdisk | sed -n 's+.*\(/dev/dsk/[^ ]*\).*+\1+p' | sort > /tmp/ioscan.out
strings /etc/lvmtab | grep dsk | sort | comm -3 - /tmp/ioscan.out

This will give you a list of devices in ioscan output but not in /etc/lvmtab and vice versa (in different columns). Obviously the CD will be one of the missing devices if you have one.

Rgds, Robin.
Ravi_8
Honored Contributor

Re: finding unused disk

Hi,
this is a tough question.
# strings /etc/lvmtab
#vgdisplay -v |grep dsk .....

shows the vg's and lv's for the current OS.
if you looked thru SAM, even though other disks had data(disks belonging another OS) shows disk unused. If you had information(written) about the disks will be useful in situations like this.
never give up
Darrell Allen
Honored Contributor

Re: finding unused disk

Hi Bernard,

If you have luns on the EMC allocated to your HP that are not in a volume group then you can see those as unused in SAM (Disks and File Systems -> Disk Devices). ioscan will also show all EMC luns available to the HP.

On my systems (with an EMC Symmetrix), we only allocate EMC luns when needed using SDR. Until that is done, ioscan will not see the "disks" on the HP.

If you don't find unused disks with SAM and / or ioscan, you need to determine if you have luns on the EMC that could be allocated to your HP. If you have EMC's Control Center you can find that info.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Rita C Workman
Honored Contributor

Re: finding unused disk

EMC has a utility called 'inq' any you can run that to see which disks have or have not been allocated.
If you have multiple servers connected to the same EMC, you can include all your server names so you get one big picture.
Check on your server and see if this utility is there..if it is not than check with your EMC SE. Or if you really need
it .. I could email you a copy of mine. Just post your email.
I'll try to check back later to see.

TIP: If you run any raw devices..than the inq utility will not reflect them..so be careful.

Rgrds,
Rit
D. Jackson_1
Honored Contributor

Re: finding unused disk

Try this small script, it reports MB used on each physical volume.
#!/bin/ksh
#
PVLIST=`vgdisplay -v | grep "PV Name" | awk '{print $3}'`
for disk in $PVLIST
do
free=`pvdisplay $disk | grep "Free PE" | awk '{print $3}'`
integer EXPR
((EXPR=${free}*4))
((TOTAL=${TOTAL}+${EXPR}))
print $disk = $EXPR MB Free
done
print Total Free space = $TOTAL MB


HTH
D. Jackson_1
Honored Contributor

Re: finding unused disk

Ooops Sorry ALL - it would help if I read what the actual issue was.. INQ works well.


Good Luck...
Wodisch
Honored Contributor

Re: finding unused disk

Hello Bernard,

be VERY careful here:
even if you find some *unused* LUNs (read: drives), they might be in use by another SYSTEM!!!
I had some very long nights in the past, cleaning up from that having happened at a customer's site :-(
I would NEVER use SAM in a multi-host-on-one-RAID or -SAN environment...
Hence, check all those *candidate* LUNs, wether
- they are in the output of
vgdisplay -v | grep /dsk/
on ALL systems connected to that EMC box
- some other OS (read: Windows, Solaris...) uses them
- they contain "vgexport"ed VGs!
- somebody else has those kept as "reserve" for your or another system
- EMC does itself use those for something like "AutoLUN XP" does for the Hp SureStore XPs

Just my ???0.02,
Wodisc
Darrell Allen
Honored Contributor

Re: finding unused disk

Excellent point, Wodisch! Shame on me for not pointing out that shared disks could be used by another system.

One note about inq. On my HPs, inq doesn't show luns that are not allocated by the EMC to that server. I only know about them by using Control Center.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)