?
Solved

Converting Blocks to Size (in Solaris)

Posted on 2008-10-28
7
Medium Priority
?
2,912 Views
Last Modified: 2013-12-27
Hello,

Given below is the 'metastat' output of a mirrored volume. Having this output, how can I calculate the actual size of the volume in MB or GB?  How can I determine the size of each block? Please let me know.

root@insitedb1# metastat d1
d1: Mirror
    Submirror 0: d11
      State: Okay
    Submirror 1: d31
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 23164002 blocks                              <-----------------------------

d11: Submirror of d1
    State: Okay
    Size: 23164002 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t0d0s1                   0     No    Okay


d31: Submirror of d1
    State: Okay
    Size: 23164002 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t3d0s1                   0     No    Okay

root@insitedb1#
root@insitedb1# prtvtoc /dev/rdsk/c1t0d0s1
* /dev/rdsk/c1t0d0s1 partition map
*
* Dimensions:
*     512 bytes/sector
*     107 sectors/track
*      27 tracks/cylinder
*    2889 sectors/cylinder
*   24622 cylinders
*   24620 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0   9533700   9533699
       1      3    01    9533700  23164002  32697701                     <-------------------
       2      5    00          0  71127180  71127179
       3      7    00   32697702  28890000  61587701
       4      0    00   61587702   9533700  71121401
       6      0    00   71121402      2889  71124290
       7      0    00   71124291      2889  71127179
root@insitedb1#

Thanks,
Ashok

0
Comment
Question by:rdashokraj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 22

Assisted Solution

by:blu
blu earned 300 total points
ID: 22827878
On Solaris, in general when you are dealing with disks, the convention is that one block is 512 bytes. This is pretty much the case in the output from all commands.
0
 
LVL 14

Expert Comment

by:arthurjb
ID: 22828229
If you are running Solaris 8 or below and the disks are mounted you can do;

df -lk

If Solaris 9 and above;

df -lh

If they are not mounted, you can mount them on temporary mount points, its more accurate than doing the conversions manually...
0
 

Author Comment

by:rdashokraj
ID: 22828382
Hi Blu,

So the disk size of d1 volume is approx 11 GB. Please correct me if am wrong. Here's my calculation:

23164002 * 512                  <-- Converting to Bytes
11859969024
11859969024/1024             <--- Converting to KB  
11582001
11582001/1024                   <---- Converting to MB
11310
11310/1024                         <--------- Converting to GB
11
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:rdashokraj
ID: 22828394
Hi arthurjb,

The volume I specified (d1) is not shown in 'df' output since it is configured as swap device. I would like know exactly what is the size of swap device configured. Thats the reason, i want to convert the blocks into MB/GB.

root@insitedb1# swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d1      85,1      16 23163984 23157184
0
 
LVL 14

Assisted Solution

by:arthurjb
arthurjb earned 300 total points
ID: 22828476
Well, another cheat is to run
format
select c1t0d0
then type partition
then type print

You should get a display like this;
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm   12540 - 13055        5.01GB    (516/0/0)    10501632
  1        usr    wm   12024 - 12539        5.01GB    (516/0/0)    10501632
  2     backup    wm       0 - 14086      136.71GB    (14087/0/0) 286698624
  3       swap    wu       0 -  7534       73.12GB    (7535/0/0)  153352320
  4        var    wm   11508 - 12023        5.01GB    (516/0/0)    10501632
  5       home    wm   13056 - 14086       10.01GB    (1031/0/0)   20982912
  6 unassigned    wm    7535 -  9520       19.27GB    (1986/0/0)   40419072
  7 unassigned    wm    9521 - 11507       19.28GB    (1987/0/0)   40439424

c1t0d0s1 is the second line (1) and the size is the fifth column

Since the metadisk is a mirror the size of c1t0d0s1 is the size of d1 ...
0
 
LVL 3

Accepted Solution

by:
Saranyakkali earned 400 total points
ID: 22829392
Hi Ashok,

23164002 Block to 11.045456886 GB

Your calcuation is correct...

23164002 * 512                  <-- Converting to Bytes
11859969024
11859969024/1024             <--- Converting to KB  
11582001
11582001/1024                   <---- Converting to MB
11310
11310/1024                         <--------- Converting to GB
11

Best tool...
http://www.unitconversion.org/data-storage/gigabytes-to-blocks-conversion.html 

Please let me know if you need any more help..

Thanks
0
 

Author Closing Comment

by:rdashokraj
ID: 31511003
Thanks a lot for your inputs
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month8 days, 18 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question