Operating System - HP-UX
1833883 Members
2376 Online
110063 Solutions
New Discussion

Re: How I will find the HDDs Size?

 
SOLVED
Go to solution
Vipin Singhal
Super Advisor

How I will find the HDDs Size?

Hi,
There should be a considerable amount of disk that is already attached to the server but has not been assigned to any volume group.

This is the output of the command:
# pvdisplay /dev/dsk/c23t4d1
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/dsk/c23t4d1" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c23t4d1".
#

Does it mean, This HDDs is free to use?
May i create the new VG using somany HDDs?
How will i find this HDD size / capacity?

Thanks
Vipin
15 REPLIES 15
Rodney Hills
Honored Contributor
Solution

Re: How I will find the HDDs Size?

Do a "man diskinfo". This command can tell you about a harddrive.

HTH

-- Rod Hills
There be dragons...
Patrick Wallek
Honored Contributor

Re: How I will find the HDDs Size?

The pvdisplay indicates that the hard drive is not in use by LVM. It could potentially be mounted directly or it could be used as raw space.

To find the size of the drive use the 'diskinfo' command.

# diskinfo /dev/rdsk/c23t4d1

As long as you are sure that the device is not in use by something other than LVM, then yes you should be able to create a new VG with this drive.
Rodney Hills
Honored Contributor

Re: How I will find the HDDs Size?

As far as being free for use, that depends if your system is using Veritas Volume manager or some Database systems that do raw disk activity.

Otherwise the disk is probabily available.

-- Rod Hills
There be dragons...
Vipin Singhal
Super Advisor

Re: How I will find the HDDs Size?

Thanks for your response,
Now I am able to find the size of HDDs.

This is the output of the command:
# pvdisplay /dev/dsk/c23t4d1
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/dsk/c23t4d1" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c23t4d1".
#

Does it mean, This HDDs is free to use?
May i create the new VG using somany HDDs?


I am not sure that the device is not in use by something other than LVM,but this command output shows that "couldnt find the volume group"

How can I check that this is unused disk?
A. Clay Stephenson
Acclaimed Contributor

Re: How I will find the HDDs Size?

Pvdisplay will only work for volumes that are part of an LVM volume group. You keep asking the same questions and you still don't seem motivated to learn. I keep trying to tell you that there is no safe way to do what you are trying to do especially if the disk array is visible to multiple servers. Remember, just because a disk is not part of a volume group or does not have a filesystem on it does not mean that it is unused.

You really need to go to a class or at least study some HP-UX before you touch a production box. You are an accident waiting to happen but all of that can be prevented with some training.

Maybe this will convince you. I consider myself to be moderately proficient at HP-UX administration and I couldn't do what you are trying to do without very carefully studying your system --- and knowing the applications running on it. You see, it is quite possible that one (or more) hosts are using an application that sees a disk and/or a LUN as purely a collection of disk blocks. It would appear to be completely unused and yet contain irreplacable data. Such applications are not too common (fortunately) but neither are they unheard of. You also need to know something about databases because they do use raw disks quite commonly.

The Forums are not a substitute for a class or a set of good references. The bad news is that no class or reference is going to be able to icompletely safely address your question because it is so system and application dependent.
If it ain't broke, I can fix that.
Vipin Singhal
Super Advisor

Re: How I will find the HDDs Size?

Stephenson & everybody,
I am not going to do anything without my training,
But I need to create an excel file for my unused HDDs, Details of those HDDs which we can use in future.

Thanks
Vipin
Arunvijai_4
Honored Contributor

Re: How I will find the HDDs Size?

Vipin, You can try this commands as well,

#ioscan -fnC disk and get the list something like this,
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 36.4GST336754LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0


Here, you can see the size as 36.4 GB. You can use diskinfo get more information.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: How I will find the HDDs Size?

Also, you can use "sam" for this purpose. SAM-->Disks and File systems --> Disk devices,

Hardware Number Volume Total â
â Path of Paths Use Group Mbytes Descrip â
â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â
â â 0/0/2/0.0.0.0 1 Unused -- 0 DVD-ROM ^ â
â â 0/1/1/0.0.0 1 LVM vg00 34732 HP 36.4G â
â â 0/1/1/0.1.0 1 Unused -- 34732 HP 36.4G â
â â 0/3/1/1.33.11.19.0.0.0 1 Unused -- 180 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.1 1 Unused -- 898 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.2 1 Unused -- 898 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.3 1 Unused -- 898 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.4 1 Unused -- 898 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.5 1 Unused -- 898 EMC SYMM â â
â â 0/3/1/1.33.11.19.0.0.6 1 Unused -- 898 EMC SYMM v â

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
A. Clay Stephenson
Acclaimed Contributor

Re: How I will find the HDDs Size?

And the most SAM or any other utility can tell you is that a disk and/or LUN MIGHT be unused. You can't trust the output of any of these utilities 100%. Any of these "UNUSED" disks could very easily be raw disk used by an application and SAM wouldn't have a clue.
If it ain't broke, I can fix that.
Devender Khatana
Honored Contributor

Re: How I will find the HDDs Size?

Hi,

SAM will be the best way to do this since you are not so confident on command line. It will display you all unused disk drives with their sizes as well.

But for databse devices again even SAM also report unused. SO the output created shall be a rough approximation and not the actual value.

HTH,
Devender
Impossible itself mentions "I m possible"
Ted Buis
Honored Contributor

Re: How I will find the HDDs Size?

Please note what A. Clay says about the possible "raw" use of a device. Just because it isn't assigned doesn't guarantee that some process doesn't use it. Some script could 'dd' out to it for its own purpose. I always discourage the use of raw devices unless it is necessary, since it makes it harder to avoid mistakes if there is more than one, or a new, administrator. You could reduce your gamble by looking for I/O activity to the device. If there is none over a long period of time, it might be safe to assume that it isn't being used. Then again... who knows.
Mom 6
Mark Ellzey
Valued Contributor

Re: How I will find the HDDs Size?

As A. Clay has pointed out, you must not trust SAM to determine whether a disk/LUN is used or not.

I myself have almost ruined an Informix database which was using raw disk for database storage. Only the "Hmm, I wonder?" question I asked myself before creating a new filesystem on the disk saved me from disaster.

Know your OS. Know your applications. Know what you are doing BEFORE you do it.

Mark
Vipin Singhal
Super Advisor

Re: How I will find the HDDs Size?

Yea, Its Ok,
But then how will i find that some process (raw) doesn't use those Harddisks.
is there any command using this, I will come to know that these are my free disks, and I can use them for creating new volume groups.

One thing more:
when i give this command #strings /etc/lvmtab, it shows that
/dev/vg10
/dev/dsk/c20t1d0
/dev/dsk/c23t1d0
/dev/dsk/c26t1d0
/dev/dsk/c29t1d0

and when I check using #sam in GUI, It shows:
vg10 has 1 PV.

what does it means?

Thanks
Vipin
A. Clay Stephenson
Acclaimed Contributor

Re: How I will find the HDDs Size?

You asked:
But then how will i find that some process (raw) doesn't use those Harddisks.
is there any command using this, I will come to know that these are my free disks, and I can use them for creating new volume groups.

NO, there is no command to positively identify this. Commands like lsof can show you that a raw device is not in use at the moment. I am running out of ways to say this but there is no magic bullet. You must study your system and the applications that run on it.

One method that would probably work to identify the raw volumes in use is to go blindly ahead and include then in a new volume group and build filesystems. Wait a week or so and if nobody screams at you then the raw device was probably unused. Of course, this approach does have some drawbacks.


You asked:
One thing more:
when i give this command #strings /etc/lvmtab, it shows that
/dev/vg10
/dev/dsk/c20t1d0
/dev/dsk/c23t1d0
/dev/dsk/c26t1d0
/dev/dsk/c29t1d0

These are probably alternate links to the same physical disk/LUN. SAM is a poor tool for this as well. Do a "vgdisplay -v /dev/vg10" and that should give you a clear answer.


If it ain't broke, I can fix that.
BKUMAR
Frequent Advisor

Re: How I will find the HDDs Size?

print_manifest

command gives a good picture of used/unused logincal volumes/vg with the unused volumes you can figure out which disks are used for the logical volumes
Unix Administration Most Dedicated and Challenging Career in the World