Quantcast
Channel: Symantec Connect - ブログエントリ
Viewing all articles
Browse latest Browse all 5094

Displaying Volume and Disk Sizes in Human Friendly Format (MB, GB & TB) with Volume Manager (VxVM)

$
0
0

Having used Storage Foundation for some time, I take for granted the interpreting of disk and volume sector sizes into a more human friendly format such as Gigabyte (GB) & Terabyte (TB).

 

Fundamentally disks/LUNs use a sector as the granular unit of transfer, typically this is 512 bytes on Solaris, Linux & AIX and 1024bytes on HP-UX. Whilst that is great for disks, it is not easy on the human eye i.e 1 TB = 2,147,483,648 sectors (assuming 512byte/sector) and it takes a little maths to do the conversion from sectors to GB or TB.

 

Like disks, the Volume Manager Component (VxVM) of Storage Foundation also uses sectors and in the early versions that is what you had work if displaying volume sizes in the CLI. Fortunatley in later releases, we have introduced human friendly formats in the commands to aid ease of use. Below are some examples from a Linux system showing how human friendly formats can be used in displaying volumes and disks with the CLI:

 

Volume Creation

First we need to create a 1TB volume using vxassist utility. vxassist allows size to be specified in a variety of units: m – Megabyte, g – Gigabyte, t – Terabytes. If no unit value is specified, then the value will default to sectors.

 

vxassist [options] [-b] make volume {length|maxsize[=size]} [attribute ...]

 

So let’s create the 1TB volume in disk group datadg:

 

[root@server101 ~]# vxassist -g datadg make testvol1 1t

 

 

Volume Sizes

To display the size of the volume, vxprint can be used, but this will display sectors by default. As you can see the 1TB volume we created earlier is now showing as 2147483648 sectors:

 

[root@server101 ~]# vxprint -g datadg -h testvol1

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0

v  testvol1     fsgen        ENABLED  2147483648 -      ACTIVE   -       -

pl testvol1-01  testvol1     ENABLED  2147483648 -      ACTIVE   -       -

sd d9-01        testvol1-01  ENABLED  2147483648 0      -        -       -

 

To display the size in other human friendly formats, use the underused “–u” unit option and supply:  m for Megabyte, g for Gigabyte, t for terabytes etc:

 

[root@server101 ~]# vxprint -g datadg -h -ug testvol1

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0

v  testvol1     fsgen        ENABLED  1024.00g -        ACTIVE   -       -

pl testvol1-01  testvol1     ENABLED  1024.00g -        ACTIVE   -       -

sd d9-01        testvol1-01  ENABLED  1024.00g 0.00g    -        -       -

 

Disk/Lun sizes

For finding the size of a disk, there are a number of methods. In addition to the various native O/S methods, if the disk was part of a VxVM disk group, then you could determine the size by displaying the private region and public region sizes and adding them together:

 

[root@server101 ~]# vxprint -g datadg -dt -um

DM NAME         DEVICE       TYPE     PRIVLEN  PUBLEN   STATE

dm d9           ibm_shark0_9 auto     32.00m   2999968.85m -

 

In Storage Foundation 6.1 we have made this easier by enhancing the vxdisk command to include a size option (-o size) that displays sizes in "vxdisk list",  even if a disk is not in a Disk Group:

 

[root@server101 ~]# vxdisk -o size list

DEVICE                           SIZE(MB)     GROUP

ibm_shark0_0                     1024         fssdg

ibm_shark0_1                     1024         -

ibm_shark0_2                     1024         -

 

Again this allows use of human friendly format “-u” :

 

[root@server101 ~]# vxdisk -o size -ug list

DEVICE                           SIZE         GROUP

ibm_shark0_0                     1.00g        fssdg

ibm_shark0_1                     1.00g        -

ibm_shark0_2                     1.00g        -

 

In addition to using vxdisk and vxprint commands, the vxlist utility can also be used to provide a summary of the size configuration:

[root@server101 ~]# vxlist disk

TY   DEVICE         DISK   DISKGROUP        SIZE      FREE STATUS

disk ibm_shark0_0   d0     sharedg1      989.87m   489.87m imported

disk ibm_shark0_1   -      -                   -         - uninitialized

disk ibm_shark0_9   d9     datadg          2.86t     1.86t imported

disk sda            -      -                   -         - uninitialized


[root@server101 ~]# vxlist volume

TY   VOLUME     DISKGROUP        SIZE STATUS    LAYOUT   LINKAGE

vol  cfs1       sharedg1      500.00m healthy   concat   -

vol  testvol1   datadg          1.00t healthy   concat   -
 

 

See vxprint, vxdisk& vxlist for further info


Viewing all articles
Browse latest Browse all 5094

Trending Articles