VXVM Creating Volume and File System
VXVM Creating Volume and File System
Creating Volume
and file system VXVM
Prepared By
F. Mohaideen Abdul Kader
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
-
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
c1t2d0s2
c1t3d0s2
auto
auto
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.