Command Reference VX
Command Reference VX
Command Reference VX
Initialize disk
vxdisksetup -i device (CDS disk) vxdisksetup -i device format=sliced (sliced disk) or vxdiskadm option, Add or initialize one or more disks
Uninitialize disk List disks List disk header Evacuate a disk Rename a disk Set a disk as a spare Unrelocate a disk Disk Group Operations
Task
vxdiskunsetup device vxdisk -o alldgs list vxdisk -g diskgroup list diskname|device vxevac -g diskgroup from_disk to_disk vxedit -g diskgroup rename oldname newname vxedit -g diskgroup set spare=on|off diskname vxunreloc -g diskgroup original_diskname
Command
vxdg init diskgroup diskname=device (CDS disk group) vxdg init diskgroup diskname=device cds=off (non-CDS disk group) vxdg -g diskgroup adddisk diskname=device vxdg deport diskgroup vxdg import diskgroup vxdg destroy diskgroup vxdg list vxdg list diskgroup vxdg g diskgroup rmdisk diskname vxdg [-T version] upgrade diskgroup vxdg move sourcedg targetdg object... vxdg split sourcedg targetdg object... vxdg join sourcedg targetdg
VxVM/VxFS Command Reference
Copyright 2005 Symantec Corporation. All rights reserved.
Add disk to disk group Deport disk group Import disk group Destroy disk group List disk groups List specific disk group details Remove disk from disk group Upgrade disk group version Move an object between disk groups Split objects between disk groups Join disk groups
D2
Task
Command
List objects affected by a disk group move operation Display bootdg Display defaultdg Set defaultdg Manually back up the disk group configuration
vxdg listmove sourcedg targetdg object... vxdg bootdg vxdg defaultdg vxdctl defaultdg diskgroup vxconfigbackup diskgroup
Perform precommit analysis vxconfigrestore -p diskgroup of a restore Restore the disk group configuration Subdisk Operations
Task Command
vxmake -g diskgroup sd subdiskname diskname offset length vxedit -g diskgroup rm subdisk_name vxprint -st vxprint -l subdisk_name
D
Associate a subdisk to a plex vxsd assoc plex_name subdisk_name Dissociate a subdisk Plex Operations
Task Command
Create a plex Associate a plex (to a volume) Dissociate a plex Remove a plex List all plexes Detach a plex Attach a plex
vxmake -g diskgroup plex plex_name sd=subdisk_name, vxplex g diskgroup att vol_name plex_name vxplex dis plex_name vxedit g diskgroup rm plex_name vxprint -lp vxplex g diskgroup det plex_name vxplex g diskgroup att vol_name plex_name
Volume Operations
Task Command
Create a volume
vxassist -g diskgroup make vol_name size layout=format diskname or vxmake -g diskgroup -U fsgen vol vol_name len=size plex plex_name
Remove a volume
vxprint -g diskgroup -vt vol_name vxprint -g diskgroup -l vol_name vxedit -g diskgroup set attribute=value vol_name vxvol -g diskgroup set attribute=value vol_name
Resize a volume
vxassist -g diskgroup growto vol_name new_length vxassist -g diskgroup growby vol_name length_change vxassist -g diskgroup shrinkto vol_name new_length vxassist -g diskgroup shrinkby vol_name length_change vxresize -g diskgroup vol_name [+|-]length
vxdisk -g diskgroup resize disk_name length=attribute vxvol -g diskgroup rdpol round vol_name vxvol -g diskgroup rdpol prefer vol_name preferrred_plex_name vxvol -g diskgroup rdpol select vol_name vxvol start vol_name
Start/Stop volumes
Start all volumes vxvol startall Start all volumes in a dg vxvol -g diskgroup startall Stop a volume vxvol stop vol_name Stop all volumes vxvol stopall Recover a volume vxrecover -sn vol_name List unstartable volumes vxinfo [vol_name]
D4
Task
Command
vxassist -g diskgroup mirror vol_name or vxmake -g diskgroup plex plex_name sd=subdisk_name vxplex -g diskgroup att vol_name plex_name
Relayout a volume
To or from a layered vxassist -g diskgroup convert vol_name layout layout=new_layout [attributes...] Add a log to a volume Create and mount a VxFS file system on a volume vxassist g diskgroup addlog vol_name mkfs -F vxfs /dev/vx/rdsk/diskgroup/vol_name mkdir /mount_point mount -F vxfs /dev/vx/dsk/diskgroup/vol_name /mount_point Note: On Linux, use # mount -t. Run a Storage Expert rule Display rule description Display rule attributes Display default attributes rule_name -g diskgroup run rule_name info rule_name list rule_name check
D
Discover new devices vxdisk scandisks new List supported disk arrays vxddladm listsupport Exclude support for an array vxddladm excludearray libname=library vxddladm excludearray vid=vid pid=pid Reinclude support vxddladm includearray libname=library vxddladm includearray vid=vid pid=pid List excluded arrays vxddladm listexclude List supported JBODs vxddladm listjbod Add/remove JBOD support vxddladm addjbod vid=vid pid=pid vxddladm rmjbod vid=vid pid=pid Add a foreign device vxddladm addforeign blockdir=path chardir=path
Task
Command
Manage dynamic multipathing (DMP) List controllers on system vxdmpadm listctlr all Display subpaths vxdmpadm getsubpaths ctlr=ctlr Display DMP nodes vxdmpadm getdmpnode nodename=nodename Enable/disable I/O to vxdmpadm enable ctlr=ctlr controller vxdmpadm disable ctlr=ctlr Display enclosure attributes vxdmpadm listenclosure all Rename an enclosure vxdmpadm setattr enclosure orig_name name=new_name Enable statistics gathering vxdmpadm iostat start Reset statistics counters vxdmpadm iostat reset Display stats for all paths vxdmpadm iostat show all Change the I/O policy vxdmpadm setattr enclosure enc_name iopolicy=policy Set path attributes vxdmpadm setattr path path_name pathtype=type
D6
Create a disk group named datadg and add the six disks:
# vxdg init datadg datadg01=c1t0d0 datadg02=c1t1d0 datadg03=c1t2d0 # vxdg -g datadg adddisk datadg04=c2t0d0 datadg05=c2t1d0 datadg06=c2t2d0
Using a top-down technique, create a 2 GB RAID-5 volume named datavol on the six disks (5 + log). Also, create and mount a UFS file system on the volume:
# vxassist -g datadg make datavol 2g layout=raid5 datadg01 datadg02 datadg03 datadg04 datadg05 datadg06 # newfs /dev/vx/rdsk/datadg/datavol # mkdir /datamnt # mount /dev/vx/dsk/datadg/datavol /datamnt
D
Using a bottom-up technique, create a 1 GB two-way mirrored volume named datavol02 using disks datadg01 and datadg04: 1 GB = 2097152 sectors Subdisks should be cylinder aligned. If disk uses 1520 sectors/cylinder, subdisk size = 2097600 sectors.
# vxmake -g datadg sd sd01 datadg01,0,2097600 # vxmake -g datadg sd sd02 datadg04,0,2097600 # vxmake -g datadg plex plex01 sd=sd01:0/0 # vxmake -g datadg plex plex02 sd=sd02:0/0 # vxmake -g datadg -U fsgen vol datavol02 plex=plex01,plex02
VxVM/VxFS Command Reference
Copyright 2005 Symantec Corporation. All rights reserved.
Change the permissions of the volume so that dba is the owner and dbgroup is the group:
# vxedit set user=dba group=dbgroup mode=0744 datavol02
Destroy the volume and remove the disks from the disk group datadg. Also, remove disks from Volume Manager control:
# vxedit -g datadg -rf rm datavol02 # vxdg -g datadg rmdisk datadg01 datadg02 datadg03 datadg04 datadg05 # vxdg deport datadg # vxdiskunsetup c1t1d0 # vxdiskunsetup c1t2d0 # vxdiskunsetup c1t3d0...
Advanced vxmake Operation: Create a RAID 0+1 volume with a DRL Log:
# vxmake -g acctdg sd sd01 acctdg01,0,194560 # vxmake -g acctdg sd sd02 acctdg02,0,194560 # vxmake -g acctdg sd sd03 acctdg03,0,194560 # vxmake -g acctdg sd sd04 acctdg04,0,194560 # vxmake -g acctdg sd logsd acctdg01,194560,2 # vxmake -g acctdg plex plex1 layout=stripe ncolumn=2 stwidth=64k sd=sd01:0/0,sd02:1/0 # vxmake -g acctdg plex plex2 layout=stripe ncolumn=2 stwidth=64k sd=sd03:0/0,sd04:1/0 # vxmake -g acctdg plex logplex log_sd=logsd # vxmake -g acctdg -U fsgen vol datavol06 plex=plex1,plex2,logplex # vxvol -g acctdg start datavol06
D8
Command
mkfs [fstype] [generic_options] [-o specific_options] special [size] # mkfs -F vxfs /dev/vx/rdsk/datadg/datavol Options -o N -o version=n -o bsize=size -o logsize=size Check VxFS structure without writing to device. Create VxFS with different layout version. Create VxFS with a specific block size. size is the block size in bytes. Create VxFS with a specific logging area size. size is the number of file system blocks to be used for the intent log.
mount [fstype] [generic_options] [-r] [-o specific_options] special mount_point # mount -F vxfs /dev/vx/dsk/datadg/datavol /mydata
umount special|mount_point # umount /mnt umount -a fstyp [-v] special # fstyp /dev/dsk/c0t6d0s0 df [-F vxfs] [generic_options] [-o s] [special|mount] # df -F vxfs /mnt fsck [-F vxfs] [generic_options] [-y|Y] [-n|N] special # fsck -F vxfs /dev/vx/rdsk/datadg/datavol
Command
fsadm [-b newsize] [-r rawdev] mount_point # /usr/lib/fs/vxfs/fsadm -b 1024000 -r /dev/vx/rdsk/datadg/datavol /mnt vxresize [-bsx] [-F vxfs] [-g diskgroup] [-t tasktag] volume new_length [medianame] # vxresize -F vxfs -g datadg datavol 5g Note: The vxresize command automatically resizes the underlying volume. The fsadm command does not.
Task
Upgrade the VxFS layout Display layout version number Convert a file system to VxFS Activate file change log
Command
vxupgrade [-n new_version] [-r rawdev] mount_point # vxupgrade -n 6 /mnt vxupgrade mount_point vxfsconvert [-s size] [-efnNvyY] special # vxfsconvert /dev/vx/rdsk/datadg/datavol fcladm on mount_point
Benchmarking Task
Create different combinations of I/O workloads
Command
vxbench -w workload [options] filename . . . # vxbench -w write -i iosize=8,iocount=131072 /mnt/testfile01 # vxbench -w rand_write -i iosize=8,iocount=131072, maxfilesize=1048576 /mnt/testfile01 vxbench -h Options -i Suboptions nrep=n nthreads=n iosize=n fsync remove iocount=n reserveonly maxfilesiz=n randseed=n rdpct=n Repeat I/O loop n times Specify the number of threads Specify I/O size (in kilobytes) Perform an fsync on the file Remove each file after the test Specify the number of I/Os Only reserve space for the file Max offset for random I/O Seed value for random number generator Read percentage of the job mix
List vxbench command options Workloads read write rand_read rand_write rand_mixed mmap_read mmap_write
-h -P -p -t -m -s -v -k -M -i
Display help Use processes and threads (default) Use processes Use threads Lock I/O buffers in memory Print summary results Print per-thread results Print throughput in kbytes/sec Print throughput in mbytes/sec Specify suboptions
Command
ff [-F vxfs] [generic_options] [-o s] special ncheck [-F vxfs] [generic_options] [-o options] special
D10
Task
Set extent attributes
Command
setext [-e extent_size] [-f flags] [-r reservation] file Options -e -r -f Flags align chgsize contig noextend noreserve trim Specify a fixed extent size. Preallocate, or reserve, space for a file. Set allocation flags. Align extents to the start of allocation units. Add the reservation into the file. Allocate the reservation contiguously. File may not be extended after reservation is used. Space reserved is allocated only until the close of the file, and then is freed. Reservation is reduced to the current file size after the last close.
getext [-f] [-s] file . . . Options -f -s Do not print the filename. Do not print output for files without fixed extent sizes or reservations. Warns if extent information cannot be preserved (default). Causes a copy to fail if extent information cannot be preserved. Does not try to preserve extent information.
Use extent-aware versions of standard commands, such as mv, cp, and cpio
Command
fsadm -D mount_point fsadm -E [-l largesize] mount_point fsadm [-d] [-D] [-e] [-E] [-s] [-v] [-l largesize] [a days] [-t time] [-p passes] [-r rawdev] mount_point # fsadm -edED /mnt1 Options -d -a -e -D -E -v -l -t -p -s -r Reorganize directories. Move aged files to the end of the directory. Default is 14 days. Reorganize extents. Report on directory fragmentation. Report on extent fragmentation. Report reorganization activity in verbose mode. Size of a file that is considered large. Default is 64 blocks. Maximum length of time to run, in seconds. Maximum number of passes to run. Default is five passes. Print a summary of activity at the end of each pass. Pathname of the raw device to read to determine file layout and fragmentation. Used when fsadm cannot determine the raw device.
11
Command
fsck [-F vxfs] [generic_options] [-y|Y] [-n|N] [-o full,nolog] [-o p] special # fsck -F vxfs /dev/vx/rdsk/datadg/datavol Options -m -n|N -V -y|Y -o full -o nolog -o p Checks, but does not repair, a file system before mounting. Assumes a response of no to all prompts by fsck. Echoes the command line, but does not execute. Assumes a response of yes to all prompts by fsck. Perform a full file system check after log replay. Do not perform log replay. Check two file systems in parallel.
Perform a full file system check without the intent log Resize the intent log
# fsck -F vxfs -o full,nolog special # fsck -F vxfs -o full,nolog /dev/vx/rdsk/datadg/datavol # fsadm -F vxfs -o log=size[,logdev=device] mount_point
Alter default logging behavior mount [-F vxfs] [generic_options] [-o specific_options] special mount_point mount -F vxfs -o tmplog /dev/vx/dsk/datadg/datavol /mnt
All structural changes are logged. Default option in which some logging is delayed. Intent logging is almost always delayed. Guarantees that storage is initialized before allocation. Sets a specific I/O size to be used for logging.
Command
mount -F vxfs [generic_options] -o mincache=suboption special mount_point mount -F vxfs -o mincache=closesync /dev/vx/dsk/datadg/datavol /mnt
D12
Task
Alter the way in which VxFS handles I/O requests for files opened with the O_SYNC and O_DSYNC flags
Command
mount -F vxfs [generic_options] -o convosync=suboption special mount_point mount -F vxfs -o convosync=closesync /dev/vx/dsk/datadg/datavol /mnt
Command
vxtunefs [-ps] [-f filename] [-o parameter=value] [{mount_point | block_special}]... # vxtunefs -o write_pref_io=32768 /mnt Options -f filename -p -s Tuning Parameters read_ahead read_pref_io read_nstream write_pref_io write_nstream discovered_direct_iosz hsm_write_prealloc initial_extent_size max_direct_iosz max_diskq max_seqio_extent_size qio_cache_enable Specifies a parameters file other than the default /etc/vx/tunefstab Prints tuning parameters Sets new tuning parameters Enables enhanced read ahead to detect patterns. Preferred read request size. Default is 64K. Desired number of parallel read requests to have outstanding at one time. Default is 1. Preferred write request size. Default is 64K. Desired number of parallel write requests to have outstanding at one time. Default is 1. I/O requests larger than this value are handled as discovered direct I/O. Default is 256K. Improves performance when using HSM applications with VxFS Default initial extent size, in file system blocks. Maximum size of a direct I/O requests. Maximum disk queue generated by a single file. Default is 1M. Maximum size of an extent. Default is 2048 file system blocks. Enables or disables caching on Quick I/O for Databases files. Default is disabled. To enable caching, you set qio_cache_enable=1. Limits dirty pages per file that a file system generates before flushing pages to disk.
13
Task
Set read-ahead size
Command
Use vxtunefs to set the tuning parameters read_pref_io and read_nstream. Read-ahead size = (read_pref_io x read_nstream) Use vxtunefs to set the tuning parameters write_pref_io and write_nstream. Write-behind size = (write_pref_io x write_nstream)
D14
Command
touch /mount_point/quotas touch /mount_point/quotas.grp vxquotaon [-u|-g] mount_point # vxquotaon -u /mnt mount -F vxfs -o quota|usrquota|grpquota special mount_point # mount -F vxfs -o quota /dev/dsk/c0t5d0s2 /mnt
Elements in an ACL Entry entry_type:[uid|gid]:permissions entry_type uid|gid permissions Display ACL entries for a file Copy existing ACL entries from one file to another file getfacl filename # getfacl myfile getfacl file1 | setfacl -f file2 # getfacl myfile | setfacl -f - newfile Entry type: user, group, other, or mask. User or group name or identification number. Read, write, and/or execute indicated by rwx.
15
QuickLog Task
Create a volume or format a disk partition to contain the QuickLog device Build the QuickLog volume layout Enable a QuickLog device
Command
vxassist -g diskgroup make qlog_volume size [vxvm_disk] # vxassist -g datadg make qvol01 32m qlogmk -g diskgroup vxlog[x] qlog_volume # qlogmk -g datadg vxlog1 qvol01 # mount -F vxfs -o qlog= special mount_point # mount -F vxfs -o qlog= /dev/vx/dsk/datadg/datvol /mnt
qlogstat [-dvf] [-l qlogdev] [-i interval] [-c count] Options -d -v -f -l qlogdev -i interval -c count Report statistics for all QuickLog devices only. Report statistics for all QuickLog volumes only. Report statistics for all logged VxFS file systems only. Report statistics for a specified QuickLog device only. Print the change in statistics after every interval seconds Default is 10 seconds. Stop after printing interval statistics count times. Default is 1.
D16
Command
mount -F vxfs -o qio mount_point
qiostat [-i interval] [-c count] [-l] [-r] file... # qiostat -i 5 /database/dbfile Options -c count -i interval -l -r Stop after printing statistics count times. Print updated I/O statistics after every interval seconds. Print the statistics in long format. Also prints the caching statistics when Cached Quick I/O is enabled. Reset statistics instead of printing them.
Enable Cached Quick I/O for all files in a file system Disable Cached Quick I/O for a file
vxtunefs -s -o qio_cache_enable=1 mount_point # vxtunefs -s -o qio_cache_enable=1 /oradata qioadmin -S filename=OFF mount_point # qioadmin -S /oradata/sal/hist.dat=OFF /oradata
17
D18