Sponsored Content
Full Discussion: Size calculation MB to GB
Top Forums Shell Programming and Scripting Size calculation MB to GB Post 302768623 by Daniel Gate on Saturday 9th of February 2013 03:22:34 AM
Old 02-09-2013
Size calculation MB to GB

PHP Code:
pcmpath query device |awk 'BEGIN{print "TYPE\tDEVICE NAME\tSERIAL\tSIZE\tHOSTNAME"}
 /DEVICE/ {
            disk=$5
            printf "%s\t", $7
            printf "%s\t", disk
            getline; printf "%s\t", substr($2, length($2)-3)
            ("bootinfo -s " disk) | getline; printf "%s\t",$0; sum+=$0
            printf "%s\n", hostname
 }      END {print "TOTAL SIZE:", sum}' 
hostname=`uname -n
I have this query working, but it returns SIZE in MB. I want the SIZE output in GB. I tried
HTML Code:
("bootinfo -s " disk)/1024
, but not working.

Please advise.
 

10 More Discussions You Might Find Interesting

1. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

2. Shell Programming and Scripting

Partitioning script for rescue mode (disk size calculation)

Hello! I need to write partitioning script wich would work in rescue mode. It will prepare partitions and unpack linux on it. However I need to calculate whole size of the disk and create: /dev/sda1 --> One big partition (minus (2*size of memory) for swap) /dev/sda2 --> Swap partition... (1 Reply)
Discussion started by: pug123
1 Replies

3. Shell Programming and Scripting

File Size calculation with AWK

Hello Friends, Im calculating file sizes with below AWK script. I do this before some spesific files are transferred. I run the script it works but after several running it stuck with a limit of 2147483647 (2 Gbytes -1 byte) and cant exceed this. Something is wrong and I can't proceed, would... (1 Reply)
Discussion started by: EAGL€
1 Replies

4. Solaris

Directory size larger than file system size?

Hi, We currently have an Oracle database running and it is creating lots of processes in the /proc directory that are 1000M in size. The size of the /proc directory is now reading 26T. How can this be if the root file system is only 13GB? I have seen this before we an Oracle temp file... (6 Replies)
Discussion started by: sparcman
6 Replies

5. Shell Programming and Scripting

calculation

Could someone till me what this calculation really means let foo=`date "+(1%H-106)*60+1%M-100"` bar=foo+1440 (4 Replies)
Discussion started by: freddie999
4 Replies

6. Shell Programming and Scripting

The scripts not able to make the file to size 0, every times it go back to its original size

#!/bin/sh ########################################################################################################## #This script is being used for AOK application for cleaning up the .out files and zip it under logs directory. # IBM # Created #For pdocap201/pdoca202 .out files for AOK #1.... (0 Replies)
Discussion started by: mridul10_crj
0 Replies

7. Shell Programming and Scripting

Script to read file size and send email only if size > 0.

Hi Experts, I have a script like $ORACLE_HOME/bin/sqlplus username/password # << ENDSQL set pagesize 0 trim on feedback off verify off echo off newp none timing off set serveroutput on set heading off spool Schemaerrtmp.txt select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies

8. Shell Programming and Scripting

VG calculation in GB

for i in `lsvg` do echo "VG Name:" $i echo "Total VG Size:" lsvg $i |grep "TOTAL PPs:" |awk '{print $7}' | cut -c2- echo "Free VG Size:" lsvg $i |grep "FREE PPs:" | awk '{print $7}' | cut -c2- done The PP Sizes are in MB. I like to have the sizes in GB. Also, I like to have the... (14 Replies)
Discussion started by: Daniel Gate
14 Replies

9. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

10. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies
iosnoop(1m)							   USER COMMANDS						       iosnoop(1m)

NAME
iosnoop - snoop I/O events as they occur. Uses DTrace. SYNOPSIS
iosnoop [-a|-A|-Deghinostv] [-d device] [-f filename] [-m mount_point] [-n name] [-p PID] DESCRIPTION
iosnoop prints I/O events as they happen, with useful details such as UID, PID, block number, size, filename, etc. This is useful to determine the process responsible for using the disks, as well as details on what activity the process is requesting. Be- haviour such as random or sequential I/O can be observed by reading the block numbers. Since this uses DTrace, only users with root privileges can run this command. OPTIONS
-a print all data -A dump all data, space delimited -D print time delta, us (elapsed) -e print device name -i print device instance -N print major and minor numbers -o print disk delta time, us -s print start time, us -t print completion time, us -v print completion time, string -d device instance name to snoop (eg, dad0) -f filename full pathname of file to snoop -m mount_point mountpoint for filesystem to snoop -n name process name -p PID process ID EXAMPLES
Default output, print I/O activity as it occurs, # iosnoop Print human readable timestamps, # iosnoop -v Print major and minor numbers, # iosnoop -N Snoop events on the root filesystem only, # iosnoop -m / FIELDS
UID User ID PID Process ID PPID Parent Process ID COMM command name for the process ARGS argument listing for the process SIZE size of the operation, bytes BLOCK disk block for the operation (location. relative to this filesystem. more useful with the -N option to print major and minor num- bers) STIME timestamp for the disk request, us TIME timestamp for the disk completion, us DELTA elapsed time from request to completion, us (this is the elapsed time from the disk request (strategy) to the disk completion (iodone)) DTIME time for disk to complete request, us (this is the time for the disk to complete that event since it's last event (time between iodones), or, the time to the strategy if the disk had been idle) STRTIME timestamp for the disk completion, string DEVICE device name INS device instance number D direction, Read or Write MOUNT mount point FILE filename (basename) for I/O operation NOTES
When filtering on PID or process name, be aware that poor disk event times may be due to events that have been filtered away, for example another process that may be seeking the disk heads elsewhere. DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
iosnoop will run forever until Ctrl-C is hit. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
iotop(1M), dtrace(1M) version 1.50 Jul 25, 2005 iosnoop(1m)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy