Common Configuration Commands
Loading Disks
After you run the LUN scanning command, the Solaris system identifies the LUNs mapped by the host.
VxVM does not manage the LUNs directly. Instead, disks are loaded first before being managed by VxVM. The command syntax is as follows:
vxdisk scandisks
Displaying Managed Disks
Run the vxdisk list command to display disks managed by VxVM. The following is an example:
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:none - - online invalid
aluadisk0_1 auto - - error
bash-3.2#
- A LUN mapped to a host is in the error or nolabel state on VxVM.
- If the LUN is labeled on the host, the LUN turns to the online invalid state.
- The LUN changes to the online state after it is initialized on VxVM.
Initializing Disks
You need to initialize a disk by running the vxdisksetup -i diskname command. The disk turns to the online state after the disk is successfully initialized. For example:
bash-3.2# vxdisksetup -i aluadisk0_0
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:cdsdisk - - online
aluadisk0_1 auto - - error
bash-3.2#
Creating a Disk Group
After initializing a disk, you can create a disk group by running the following command:
bash-3.2# vxdg init dg1 aluadisk0_0
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:cdsdisk aluadisk0_0 dg1 online
aluadisk0_1 auto:none - - online invalid
bash-3.2#
Creating a Volume
You can run the vxassist -g DG name make volume name capacity command to create a volume in a created DG. The following is an example:
bash-3.2# vxassist -g dg1 make vol1 1g
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
v vol1 fsgen ENABLED 2097152 - ACTIVE - -
pl vol1-01 vol1 ENABLED 2097152 - ACTIVE - -
sd aluadisk0_0-01 vol1-01 ENABLED 2097152 0 - - -
bash-3.2#
Creating a File System
A created volume cannot be used unless it is mounted to a file system. The syntax of the file system creation command is the same here as that in LVM. The difference is the device name. The following is an example:
bash-3.2# mkfs -F vxfs /dev/vx/rdsk/dg1/vol1
Mounting a Volume
You can mount a created volume to a directory. The command syntax is as follows:
mount -F vxfs /dev/vx/dsk/diskgroup/volumename directory
Disabling a Volume
This command makes a volume unavailable to a user and changes the volume status from ENABLED or DETACHED to DISABLED. The command syntax is as follows:
vxvol -g diskgroup stop volumename
The following is an example:
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
v vol1 fsgen ENABLED 2097152 - ACTIVE - -
pl vol1-01 vol1 ENABLED 2097152 - ACTIVE - -
sd aluadisk0_0-01 vol1-01 ENABLED 2097152 0 - - -
bash-3.2# vxvol -g dg1 stop vol1
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
v vol1 fsgen DISABLED 2097152 - CLEAN - -
pl vol1-01 vol1 DISABLED 2097152 - CLEAN - -
sd aluadisk0_0-01 vol1-01 ENABLED 2097152 0 - - -
bash-3.2#
Enabling a Volume
This command makes a volume available to a user and changes the volume status from DISABLED to ENABLED or DETACHED.
The command syntax is as follows:
vxvol -g DG name start volume name
The following is an example:
bash-3.2# vxvol -g dg1 start vol1
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
v vol1 fsgen ENABLED 2097152 - ACTIVE - -
pl vol1-01 vol1 ENABLED 2097152 - ACTIVE - -
sd aluadisk0_0-01 vol1-01 ENABLED 2097152 0 - - -
bash-3.2#
Deleting a Volume
The command syntax is described as follows:
vxedit -g DG -rf rm volume name
The following is an example:
bash-3.2# vxedit -g dg1 -rf rm vol1
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
bash-3.2#
Exporting a DG
DGs must be imported or exported in cluster, data backup, and data restoration application scenarios. Before exporting a DG, you must stop all volumes on the DG. Run the vxdg deport DG name command to export the DG. The following is an example:
bash-3.2# vxvol -g dg1 stop vol1
bash-3.2# vxdg deport dg1
bash-3.2# vxprint
bash-3.2#
Importing a DG
The command syntax is as follows:
vxdg import DG name
The following is an example:
bash-3.2# vxdg import dg1
bash-3.2# vxprint
Disk group: dg1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg dg1 dg1 - - - - - -
dm aluadisk0_0 aluadisk0_0 - 10415488 - - - -
v vol1 fsgen ENABLED 2097152 - ACTIVE - -
pl vol1-01 vol1 ENABLED 2097152 - ACTIVE - -
sd aluadisk0_0-01 vol1-01 ENABLED 2097152 0 - - -
bash-3.2#
Adding a Disk to a DG
You can add disks to a DG when its capacity is insufficient. The command syntax is as follows:
vxdg -g DG name adddisk disk type
The following is an example:
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:cdsdisk aluadisk0_0 dg1 online
aluadisk0_1 auto:cdsdisk - - online
bash-3.2# vxdg -g dg1 adddisk aluadisk0_1
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:cdsdisk aluadisk0_0 dg1 online
aluadisk0_1 auto:cdsdisk aluadisk0_1 dg1 online
bash-3.2#
Removing a Disk from a DG
The command syntax is as follows:
vxdg -g DG name rmdisk disk name
The following is an example:
bash-3.2# vxdg -g dg1 rmdisk aluadisk0_1
bash-3.2# vxdisk list
DEVICE TYPE DISK GROUP STATUS
aluadisk0_0 auto:cdsdisk aluadisk0_0 dg1 online
aluadisk0_1 auto:cdsdisk - - online
bash-3.2#