- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- To fing harddisk size in GB
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 07:34 PM
тАО03-10-2008 07:34 PM
To fing harddisk size in GB
Please tell me the command to find the hardisk space in GB(GIGA BYTE)in hpux
Logesh.S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 07:46 PM
тАО03-10-2008 07:46 PM
Re: To fing harddisk size in GB
# diskinfo /dev/rdsk/c8t0d2
SCSI describe of /dev/rdsk/c8t0d2:
vendor: HP
product id: A6218A
type: direct access
size: 37748736 Kbytes
bytes per sector: 512
From here you can get the size in GB by dividing the size by 1,048,576.
37,748,736 KB / 1,048,576 = 36 GB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 07:53 PM
тАО03-10-2008 07:53 PM
Re: To fing harddisk size in GB
-or-
Patrick's works just as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 07:55 PM
тАО03-10-2008 07:55 PM
Re: To fing harddisk size in GB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 08:09 PM
тАО03-10-2008 08:09 PM
Re: To fing harddisk size in GB
("df -k") to GB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2008 08:15 PM
тАО03-10-2008 08:15 PM
Re: To fing harddisk size in GB
The df -k command shows the harddisk capacity in kb not in GB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2008 01:44 AM
тАО03-11-2008 01:44 AM
Re: To fing harddisk size in GB
To get the disk size in GB use the command:
diskinfo /dev/rdsk/c2t0d0s2 |grep size: > /tmp/sad;A=$(cat /tmp/sad |grep size: | awk '/ / {print $2}');Z=1024;(( B = A / Z ));(( C = B / Z ));echo "$C GB"
-where /dev/rdsk/c2t0d0s2 is the device file of the disk. You can use it as a script.
Regards,
Davis Paul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2008 04:19 AM
тАО03-11-2008 04:19 AM
Re: To fing harddisk size in GB
Where you looking for a truncated integer result or a fractional result?
How do you see your 'harddisk'?
df?
pvdisplay?
diskinfo?
What works for you?
Steve>> "man df"? I assume that you can get from KB
("df -k") to GB.
I don't think Logesh can. That's the problem.
Also, df can do the nastly line split making scripts trickier.
>>>>
diskinfo /dev/rdsk/c2t0d0s2 |grep size: > /tmp/sad;A=$(cat /tmp/sad |grep size: | awk '/ / {print $2}');Z=1024;(( B = A / Z ));(( C = B / Z ));echo "$C GB"
10 points for entertainment!
0 points for efficiency
untested (as I have no privs here...)
# let size_in_gb=$(diskinfo -b)/1024/1024
>> cat /tmp/sad |grep size: | awk '/ / {print $2}'
awk is happy to read the file (or pipe) itself
awk is made to grep itself
awk '/size/{ print $2}' /tmp/sad
and why use an intermediate file, or that redundant grep?
A=$(diskinfo /dev/rdsk/c2t0d0s2 |awk '/size/{ print $2}');Z=1024;(( B = A / Z ));(( C = B / Z ));echo "$C GB"
The Z intermediete only obfuscates.
But in the end... Just ask diskinfo for the size alone!
hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2008 12:46 AM
тАО03-12-2008 12:46 AM
Re: To fing harddisk size in GB
please read:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1155229&admit=-682735245+1187939432880+28353475
HTH,
Art