Veritas Volume Manager on RHEL7 - Create Volume & Filesystem

This post will help you with Veritas Volume Manager on RHEL7 to Create Volume & Filesystem.

If you are interested in learning, Request you to go through the below recommended tutorial.

In the previous post, we have seen how to install the veritas volume manager on linux. In this post, we will discuss about the below topics of Veritas Volume Manager(VxVM) which is installed on RHEL7.

Topics Involved:
1. How to identify the correct Disks using vxdisk
2. How to initialize the Disks using vxdisksetup
3. How to create a Diskgroup and add the new disks
4. How to create a volume on the disk group
5. How to create a Filesystem on the volume.
6. How to mount the file system using mount command

Prerequisites are,
1. Storage Foundation Basic 6.2 (Linux) tool – Downloaded from Symantec.com which includes Veritas Volume Manager(VxVM) packages.

Veritas Volume Manager on RHEL7 – Create Volume & Filesystem

1. Identify the correct Disks using vxdisk

Ensure the disk is detected and not mounted using fdisk and df -h command. Execute the below command to list the available disk under Veritas Volume Manager.

[root@node1 /]# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       –            –            online invalid
sdb          auto:none       –            –            online invalid
sdc          auto:none       –            –            online invalid
[root@node1 /]#

If you see the status as “Online invalid“, which indicates these disks are yet to be added into Veritas Volume Manager. But be careful, Even the mounted disks also will show as invalid under

Veritas volume manager, because these disks are not initialized by Veritas Volume Manager(VxVM). Lets see how to initialize the disks.

Some time you may get an device column output in “Enclosure based names”, for example.

DEVICE       TYPE            DISK         GROUP        STATUS
aluadisk0_0  auto:cdsdisk    mytestdg2    mytestdg     online
aluadisk0_1  auto:cdsdisk    mytestdg1    mytestdg     online
sda          auto:LVM        –            –            online invalid

so just change the naming conversion format to “Operating System Based names” which will help us to identify the correct disk.

To change the “Enclosure based names” to “Operating System Based names”

vxddladm set namingscheme=osn

To revert back to “Enclosure based names”

vxddladm set namingscheme=ebn

2. Initialize Disks using vxdisksetup

Once you have identified the correct disks, goahead to initialize the disks using vxdisksetup command. For example, lets take sdb and sdc disks.

[root@node1 /]# vxdisksetup -i sdb
[root@node1 /]# vxdisksetup -i sdc
Verify the disks are got initialized or not using vxdisk command.
[root@node1 /]# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       –            –            online invalid
sdb          auto:cdsdisk    –            –            online
sdc          auto:cdsdisk    –            –            online
[root@node1 /]#

Disks status which shows as “Online” are initialized and it belongs to VxVM.

3. Create Diskgroup and add the new disks

Diskgroups are same like Volumegroups in LVM. So create a example disk group “testdg” and add the identified disks to the “testdg” diskgroup.

[root@node1 /]# vxdg init testdg disk1=sdb disk2=sdc
[root@node1 /]# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       –            –            online invalid
sdb          auto:cdsdisk    disk1        testdg       online
sdc          auto:cdsdisk    disk2        testdg       online
[root@node1 /]#

Check the disk group properties.

[root@node1 /]# vxdg list testdg
Group:     testdg
dgid:      1234567890.12.node1.learnitguide.net
import-id: 1024.40
flags:     cds
version:   170
alignment: 8192 (bytes)
ssb:            on
autotagging:    on
detach-policy: global
dg-fail-policy: obsolete
copies:    nconfig=default nlog=default
config:    seqno=0.1030 permlen=51360 free=51356 templen=2 loglen=4096
config disk sdb copy 1 len=51360 state=clean online
config disk sdc copy 1 len=51360 state=clean online
log disk sdb copy 1 len=4096
log disk sdc copy 1 len=4096
[root@node1 /]#

lets assume that I have new disk “sdd” and same needed to be add to the exisitng diskgroup “testdg”. So How to add a new disk into exisiting Diskgroup.

Initialize and add the disk as below.

[root@node1 /]# vxdisksetup -i sdd
[root@node1 /]# vxdg -g testdg adddisk disk3=sdd

4. Create volume on the disk group

Lets create a Volume of 100MB within the diskgroup.

[root@node1 /]# vxassist -g testdg make vol1 100m

List the volume details using vxlist command

[root@node1 /]# vxlist volume
TY   VOLUME   DISKGROUP        SIZE STATUS    LAYOUT   LINKAGE
vol  vol1     testdg       100.00m healthy   concat   –

Note: If you get an error when you use “vxlist” command as below.

VxVM DCLI vxlist ERROR V-50-49971-158 Authentication or communication could not be established with the server.

Start the below script.

/opt/VRTSsfmh/etc/vxdcli.sh
or
/opt/VRTSsfmh/etc/vxdcli.sh start

5. Create Filesystem on the volume

[root@node1 /]# mkfs -t vxfs /dev/vx/rdsk/testdg/vol1
version 9 layout
204800 sectors, 102400 blocks of size 1024, log size 1024 blocks
rcq size 1024 blocks
largefiles supported

Where “/dev/vx/rdsk/testdg/vol1” is the device file for volume vol1.

6. Mount the file system using mount command

[root@node1 /]# mount -t vxfs /dev/vx/dsk/testdg/vol1 /mnt/

Verify the mounted file system using mount and df command. Refer the link to know how to resize the Vertias Volumes Online.

Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

veritas volume manager, linux veritas volume manager, veritas volume manager rhel7, veritas volume manager for beginners, veritas volume manager commands