How to check disk size in VxVM

How to check disk size in VxVM
Getting your Trinity Audio player ready...

How to check disk size in VxVM

In this article, we are going to discuss how to check disk size in VxVM.There are many popular free volume manager available like LVM SVM as widely used also. VxVM has been a problem solver for many highly used operating systems in the enterprise section.

VXVM is a paid online storage management tool suits especially SAN-based systems running over Linux Solaris HP-UX AIX and even on windows servers as well.

VxVM delivers the capability of doing most of the things online which eliminate business interruption like snapshot creations, online resizing of file systems as per business need or online reclamation of the file system, and reclaiming storage OnDemand and many more like defragmentation, dirty log management, file system checking, etc.

VxVM delivers high I/O performance. With the increase of internet usage, disk space requirement increased drastically over the last two decades have introduced major use of SAN technology and with that said increased demand for tools to manage storage efficiently with ease without less or minimal business disruptions.

More about VxVM

Here VxVM pitch itself and became the first choice for managing storage online while other tools like LVM also keep revolving and trying to cope up with enterprise demand to use it as replacement of VxVM which is paid as all business intend to keep their infrastructure cost as much as they can.

Each volume manager is tightly coupled with the operating system so as VxVM as well. They work as an interface between the operating system and data file systems used in the operating system either for the Operating system or application related file systems.

So there are tools available in all the operating systems to check disk size. Let us see few examples of how we can check disk size.

How to check disk size in Solaris

1.One of the very basic and must-use tools in all versions of Solaris is the format command.

# echo | format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@1c,600000/scsi@2/sd@0,0
1. c0t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@1c,600000/scsi@2/sd@1,0
2. c0t3d0 <HITACHI-HUS10733ASUN72G-PA05 cyl 14087 alt 2 hd 
24 sec 424>
/pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 

You can easily find answers on how to check disk size in Solaris and remember if any disk is assigned and to be used in VxVM on the Solaris server you must need to make it accessible to the Operating system first before taking the disk into VxVM control.

That being said you have to scan the disk using devfsadm or cfgadm and you have
to level the disk before taking it under veritas control and use it under VxVM.

2.Another really cool command iostat you can use to see the disk space with much other important information about the disk.

# iostat -IEn

c0t1d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: MAP3367N SUN36G Revision: 0401 
Serial No: 0410N09684 Size: 36.42GB <36420075008 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 5 Predictive Failure Analysis: 0
c0t3d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: HITACHI Product: HUS10733ASUN72G Revision: PA05 
Serial No: 0610RW6GYA Size: 73.41GB <73407865856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c0t0d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: MAP3367N SUN36G Revision: 0401 
Serial No: 0347N05RAP Size: 36.42GB <36420075008 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 6 Predictive Failure Analysis: 0

iostat output is also helpful to find out disk size and it is also helpful if you want to replace any disk. From here you can find how much hard and soft errors you have on disk including size and a serial number of the disk which will be really valuable information.

If you want to understand the full process of how to expand the file system in Solaris under VxVM. Please refer to the VxVM & VxFS Tutorials link at the end of the post.

How to check disk size in Linux

Let us see what are the options available in Linux.

1. fdisk command

# fdisk -l | grep Disk
Disk /dev/sda doesn't contain a valid partition table
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes

2. blockdev command

# blockdev --getsz /dev/sda
6291456
Below are the options available with blockdev command.
--getsz (get size in 512-byte sectors)
--setro (set read-only)
--setrw (set read-write)
--getro (get read-only)
--getss (get sectorsize)
--getbsz (get blocksize)
--setbsz BLOCKSIZE (set blocksize)
--getsize (get 32-bit sector count)
--getsize64 (get size in bytes)
--setra READAHEAD (set readahead)
--getra (get readahead)
--flushbufs (flush buffers)
--rereadpt (reread partition table)
--rmpart PARTNO (disable partition)
--rmparts (disable all partitions)

3. multipath command

If your system has multipath installed you can use to get disk size. If not you can install it. This is basically used for multipath management of SAN. 

# multipath -ll
mpathc (3600508b1001cebd1411d789df4e772eb) dm-2 HP,LOGICAL VOLUME
size=22T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 3:1:0:0 sdb 8:16 active ready running
mpathl (360060e8012cf91005040cf910000100d) dm-9 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:9 sdi 8:128 active ready running
`- 1:0:0:9 sdp 8:240 active ready running
mpathk (360060e8012cf91005040cf910000100c) dm-8 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:8 sdh 8:112 active ready running
`- 1:0:0:8 sdo 8:224 active ready running
mpathj (360060e8012cf91005040cf910000100b) dm-7 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:7 sdg 8:96 active ready running
`- 1:0:0:7 sdn 8:208 active ready running
mpathi (360060e8012cf91005040cf910000100a) dm-6 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:6 sdf 8:80 active ready running
`- 1:0:0:6 sdm 8:192 active ready running
mpathh (360060e8012cf91005040cf9100001008) dm-4 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:4 sdd 8:48 active ready running
`- 1:0:0:4 sdk 8:160 active ready running
mpathg (360060e8012cf91005040cf9100001009) dm-5 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:5 sde 8:64 active ready running
`- 1:0:0:5 sdl 8:176 active ready running
mpathf (360060e8012cf91005040cf9100001006) dm-3 HITACHI,OPEN-V
size=4.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 0:0:0:2 sdc 8:32 active ready running
`- 1:0:0:2 sdj 8:144 active ready running

OK, so we have seen a few examples of each Solaris and Linux. Disks spaces have been in bytes and kilobytes where ever it is in all the operating systems to it have been always matter of discussion on how to find the disk space in a human-readable format.

In that respect, all the operating system keeps utility in form of commands like du and df in all UNIX or Linux distros to see how much disk is used and how much space available in mounted
file systems.

So let us see what is the best option available for how to check disk size in VxVM.There is a utility like vxprint to see the disk space used in VxVM and vxdiskadm tool which is specially designed for disk management only but all they not give you exact information about what exactly you are looking for.

There is one best command-line utility that can answer your query 100% and this is available by default in all VxVM installations which is the vxlist command in VxVM.

Let us review the vxlist command output below.

$ vxlist disk
TY   DEVICE DISK                      DISKGROUP SIZE    FREE    STATUS
disk hitachi_vspg1k0_0c7c HITACHIDC7C fs_sms-dg 149.96g 384.00k imported
disk hitachi_vspg1k0_021d HITACHID21D fs_sms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_021e HITACHID21E fs_pms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_021f HITACHID21F fs_pms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_0216 HITACHID216 fs_pms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_0217 HITACHID217 fs_pms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_0218 HITACHID218 fs_pms-dg 99.95g  1.62m   imported
disk hitachi_vspg1k0_0220 HITACHID220 fs_pms-dg 99.95g  1.62m   imported

Just to mention here is that the disk must be in an initialized state for the command to report its state in vxlist command. You can see it tells about the size of the disk.

This is all about how to check disk size in VxVM in this tutorial. I hope you will find it useful. If you agree please share as much as you can in your reach and please do subscribe channel for many similar tutorials on UNIX Linux VxVM VxFS and many more.

 
VxVM & Veritas File System Related Tutorials

How to Check DG Size in VxVM
How to Unencapsulate rootdisk in VxVM
How to Remove Veritas File System
How to Create Veritas File System
How to Increase File System in VxVM
How to Extend Veritas File System in Solaris
How to Check Disk Size in VxVM
How to change DG name in VxVM