VXVM Creating Volume and File System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Lessons Learnt

Creating Volume
and file system VXVM
Prepared By
F. Mohaideen Abdul Kader

Document Type: Lessons Learnt


WIPRO LIMITED

Creating Volume and file system


VxVM allows a system administrator to configure various volume layouts for the volume thus
allowing high redundancy and high performance. Let us see how we can create a basic volume and a
file system with Veritas Volume Manager.
I have added six, 1 GB disks (other than two, 16 GB disks for root mirroring) to my vmware virtual
machine for future tutorials.
To check all the disks scanned under the Operating System:
# vxdisk eo alldgs list
DEVICE
TYPE
DISK
disk_8
auto:none disk_9
auto:none disk_10 auto:none disk_11 auto:none disk_12 auto:none disk_13 auto:none disk_14 auto:none disk_15 auto:none -

GROUP
STATUS
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid

OS_NATIVE_NAME ATTR
c1t0d0s2
c1t1d0s2
c1t5d0s2
c1t2d0s2
c1t6d0s2
c1t3d0s2
c1t8d0s2
c1t4d0s2
-

OS native Vs Enclosure based naming Scheme


We can have disks naming scheme in 2 ways OS native and Enclosure based. For my convenience I
will be using OS native disk scheming. But you can have it your way. To change the scheme use
vxdiskadm command and select option 20. You can use enclosure based naming scheme if you
prefer that. You would see the difference in the DEVICE column in the output of vxdisk -eoalldgs
list as shown above and below in the vxdisk command output.
To check the current naming scheme
# vxddladm get namingscheme
NAMING_SCHEME
PERSISTENCE LOWERCASE USE_AVID
============================================================
OS Native
No
Yes
Yes
To change the naming scheme through command line
# vxddladm set namingscheme=ebn
# vxddladm get namingscheme
NAMING_SCHEME
PERSISTENCE LOWERCASE USE_AVID
============================================================
Enclosure Based Yes
Yes
Yes

# vxdisk eo alldgs list


DEVICE
TYPE
DISK
c1t0d0s2 auto:none c1t1d0s2 auto:none c1t2d0s2 auto:none c1t3d0s2 auto:none c1t4d0s2 auto:none c1t5d0s2 auto:none c1t6d0s2 auto:none c1t8d0s2 auto:none -

GROUP
-

STATUS
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid
online invalid

OS_NATIVE_NAME ATTR
c1t0d0s2
c1t1d0s2
c1t2d0s2
c1t3d0s2
c1t4d0s2
c1t5d0s2
c1t6d0s2
c1t8d0s2
-

I would exclude the root disk (c1t0d0) and a disk supposed to be mirrored (c1t1d0) with it later on.
# df -h /
Filesystem
size used avail capacity Mounted on
/dev/dsk/c1t0d0s0
15G 5.9G 8.6G 41% /
Now first initialize the disk we want to use for the disk group creation. If you have seen output of
vxdisk list, you would see all the disks with STATUS of online invalid. This indicates that the disk is
not under VxVM control. To take it under VxVM control we would initialize it.
# vxdisksetup -i c1t2d0
vxdiks list would now show you the status as online implying that the disk is now under VxVM
control.
# vxdisk list
DEVICE
TYPE
DISK
c1t0d0s2 auto:none
c1t1d0s2 auto:none
c1t2d0s2 auto:cdsdisk c1t3d0s2 auto:none
c1t4d0s2 auto:none
c1t5d0s2 auto:none
c1t6d0s2 auto:none
c1t8d0s2 auto:none
-

GROUP
-

STATUS
online invalid
online invalid
online
online invalid
online invalid
online invalid
online invalid
online invalid

Initialization Vs Encapsulation
Now before going forward let us see whats the difference between encapsulation and initialization.
Initialization When a disk is initialized a private and public region is created on the disk (placed
under VxVM control) and VM disk header information is written to the private region. All the data
already present on the disk is erased.
Encapsulation Disk is taken under VxVM control when it is initialized but the data is preserved in
this method.

Now create the disk group mydg by specifying the disk we just initialized. You can give any name to
disk you prefer instead of disk01.
# vxdg init mydg disk01=c1t2d0
bash-3.2# vxdg list
NAME
STATE
ID
mydg
enabled,cds
1381663220.16.geeklab
bash-3.2# vxdisk eo alldgs list
DEVICE
TYPE
DISK
GROUP
STATUS
c1t0d0s2 auto:none online invalid
c1t1d0s2 auto:none online invalid
c1t2d0s2 auto:cdsdisk disk01
mydg
online
c1t3d0s2 auto:none online invalid
c1t4d0s2 auto:none online invalid
c1t5d0s2 auto:none online invalid
c1t6d0s2 auto:none online invalid
c1t8d0s2 auto:none online invalid

OS_NATIVE_NAME ATTR
c1t0d0s2
c1t1d0s2
c1t2d0s2
c1t3d0s2
c1t4d0s2
c1t5d0s2
c1t6d0s2
c1t8d0s2
-

Now create a simple concatenated volume myvol of around 500 MB size in the mydg.
# vxassist -g mydg make myvol 500m
Create a vxfs file system on this volume and also create a directory to mount this volume.
# mkfs -F vxfs /dev/vx/rdsk/mydg/myvol
To make the mount to persists after reboot you can add an entry to /etc/vfstab. Also it is a preferred
way to check the entry in vfstab by mounting it with just mount /mount-point or mountall
command.
# cat /etc/vfstab |grep data
/dev/vx/dsk/mydg/myvol /dev/vx/rdsk/mydg/myvol /data vxfs 0
# mount /data ( or mountall)
bash-3.2# df -h |grep data
/dev/vx/dsk/mydg/myvol 500M 2.2M 467M

yes

1% /data

Adding a new disk to the existing disk group


We can also add disks after we create the disk group. Before adding a new disk initialize it.
# vxdisksetup -i c1t3d0
# vxdg -g mydg adddisk disk02=c1t3d0

To check the layout of the volume we just create:


# vxprint -g mydg -htr
.............
dg mydg
default default 28000 1381663220.16.geeklab
dm disk01
dm disk02

c1t2d0s2
c1t3d0s2

auto
auto

65536 2027168 65536 2027168 -

v myvol
ENABLED ACTIVE 1024000 SELECT fsgen
pl myvol-01 myvol
ENABLED ACTIVE 1024000 CONCAT RW
sd disk01-01 myvol-01 disk01 0
1024000 0
c1t2d0 ENA
As you can see in the output above, a plex with one subdisk is created which comprises the volume
myvol. You can also see the layout as concat in the 6th column.
To check the disk property of a disk in the mydg :
# vxdisk -p list c1t2d0
DISK
: c1t2d0s2
DISKID
: 1381663112.11.geeklab
VID
: VMware,
UDID
:
VMware%2C%5FVMware%20Virtual%20S%5FDISKS%5F6000C2952A4E5B4ACE2B2AE07A473A35
SCSI_VERSION : 2
REVISION
: 1.0
PID
: VMware Virtual S
PHYS_CTLR_NAME : /pci@0,0/pci15ad,1976@10
MEDIA_TYPE : hdd
LUN_SNO_ORDER : 0
LUN_SERIAL_NO : 6000C2952A4E5B4ACE2B2AE07A473A35
LIBNAME
: scsi3_jbod
DMP_DEVICE : c1t2d0
CAB_SERIAL_NO : DISKS
ATYPE
: Disk
ARRAY_PORT_PWWN:
ANAME
: Disk
TRANSPORT : SCSI
Remove volume , diks and diskgroups
Before removing the volume umount the mount point /data and remove the entry from vfstab.
# umount /data
After removing the volume you can remove the disks in the diskgroup. But the last disk can not be
removed. For that we have to remove the entire disk group mydg. After removing the DG we can use
these disks in any other DG.

# vxassist -g mydg remove volume myvol


# vxdg -g mydg rmdisk disk02
# vxdg -g mydg rmdisk disk01
VxVM vxdg ERROR V-5-1-10127 disassociating disk-media disk01:
Cannot remove last disk in disk group
# vxdg destroy mydg

You might also like