Вы находитесь на странице: 1из 9

A) Displaying & Monitoring :------------------------------------------#vxdctl license - List licensed features of VxVM #vxdisk [-g diskgroup] list [diskname] - Lists

disks under control of VxVM.Example:# vxdisk -g mydg list #vxdisk list <diskname> - Display detailed information about a single disk, including mutlipathing information, size, type, Vx version,and more. #vxdisk list - List all disks used by Veritas (VX). #vxprint - Display report style information about the current status of all Vx componants,including disks, subdisks, plexes, and volumes. #vxprint <componant> - Display report style information about the current status of ONLY the componant you request. So for instance, "vxprint vol01" shows information about all subcomponants of vol01. This works for plexes, disk groups, etc. #vxprint -hrt - Display detailed information about all Vx componanats, including stwdith, ncolumns, offsets, layout type, read-policy, and more. This is best for true picture of your configuration. #vxprint -hrt [-g diskgroup] [object ...] - Prints single-line information about objects in VxVM. eg # vxprint -g mydg myvol1 myvol2 #vxprint -st [-g diskgroup] [subdisk ...] - Displays information about subdisks eg # vxprint -st -g mydg #vxprint -pt [-g diskgroup] [plex ...] - Displays information about plexes eg : # vxprint -pt -g mydg #vxdg list - Display listing and state information of all Disk Groups. #vxdg -s list - Lists information about shared disk groups.Example: # vxdg -s list #vxdg list <diskgroup name> - Display detailed information about a diskgroup, including flags, version,logs status, etc. #vxinfo - Display volume status and volume type. By default, only displays "rootdg",to display a diffrent Disk Group, use "vxinfo -g <dgname>". #vxinfo [-g diskgroup] [volume ...] - Displays information about the accessibility and usability of volumes.See the Veritas Volume Manager Troubleshooting Guide Example:# vxinfo -g mydg myvol1 myvol2 #vxassist maxgrow <volume> - This command will output the maximum size the volume specified can increased by, specified in sectors. ========================================================================= ============================== B) Disks Tasks & Commands:--------------------------------------------

#vxdiskadm - Administers disks in VxVM using a menu-based interface


#vxdiskadd <devname> - vxdiskadd <devname> Adds a disk to Vx by Initializing and Encapsolating it. Specified by its device name (ex: c0t1d0s2).This command, can also be used to add a disk to a specified disk group. Just follow the prompts. No reboots needed for changing DG's.

NOTE: You'll need to reboot to finalize the disk addition! #vxedit rename <oldname> <newname> - Rename a Vx disk. Ex: "vxedit rename disk01 disk05" #vxedit [-g diskgroup] rename olddisk newdisk - Renames a disk under control of VxVM.Example: # vxedit -g mydg rename mydg03 mydg02 #vxedit set reserve=on <diskname> - Sets the "reserve" flag to a Vx disk. This is used to keep specific disks from being accidentally, or generally used. #vxedit [-g diskgroup] set reserve=on|off diskname -

Sets aside/does not set

aside a disk from use in a disk group.


eg) # vxedit -g mydg set nohotuse=on mydg03 , # vxedit -g mydg set nohotuse=off mydg03 #vxdisk offline <diskname> - Used to "offline" a disk. The disk should be removed from its diskgroup before being offlined. #vxdisk rm <devname> - Used to remove disks from Vx control completely.Ex: "vxdisk rm c0t1d0s2" Make sure to removed the disk from its diskgroup, and offline the disk before removing it. #vxdg -g diskgroup rmdisk diskname - Removes a disk from its disk group. eg ) # vxdg -g mydg rmdisk c0t2d0 #vxedit set spare=on <diskname> - Sets the "spare" flag to a Vx disk. This is used to make the specified disk a hot spare, which is then added to the "hot spare pool". #vxedit set spare=off <diskname> - Same as above but removes the disk from the "hot spare pool".- Adds a disk to Vx by Initializing and Encapsolating it. Specified by its device name (ex: c0t1d0s2).This command, can also be used to add a disk to a specified disk group. Just follow the prompts. No reboots needed for changing DG's. NOTE: You'll need to reboot to finalize the disk addition! # vxedit [-g diskgroup] set spare=on|off diskname -

Adds/removes a disk

from the pool of hot-relocation spares. eg ) # vxedit -g mydg set spare=on mydg04 , # vxedit -g mydg set spare=off mydg04 vxdiskunsetup devicename - Removes a disk from control of VxVM. eg ) # vxdiskunsetup c0t3d0
# ========================================================================= ============================== C) Disk Groups & Commands:-------------------------------------------#vxdg init <diskgroup> <diskname>=<devname> - Creates a new disk group, and assigns the naming scheme to the first disk added to the group. ex: "vxdg init newdg newdg01=c0t10d0s2". NOTE: This is kinda tricky because the disk that you're adding can't be a member of ANY DG, but must be initialized. It's easier to use "vxdiskadd", and add the disk to a newdg by specifying a new DG name for the DG field. #vxdg deport <diskgroup> - Disabled a diskgroup, but doesn't remove it. Often used as an

organized pool of disk to realocate, and to moved DG's from one system to another.

[-n newname] deport diskgroup - Deports a disk group and optionally renames it. Example: # vxdg -n newdg deport mydg
# vxdg #vxdg import <diskgroup> - Reverse of above. Enables local access to the specified disk group. #vxdg

[-n newname] import diskgroup - Imports a disk group and optionally renames it. Example: # vxdg -n newdg import mydg

#vxdg -n <newdgname> <olddgname> - Change a Disk Groups name. #vxdg list <dgname> - Use this to check the version numbers of Disk Groups. Shows other details about the DG too. #vxdg [-o expand] listmove sourcedg targetdg object ... etc -

Lists the

objects potentially affected by moving a disk group. Example: # vxdg -o expand listmove mydg newdg myvol1
# vxdg [-o expand] move sourcedg targetdg object ..etc -

Moves objects

between disk groups. Example: # vxdg -o expand move mydg newdg myvol1
# vxdg mydg

join sourcedg targetdg - Joins two disk groups. Example: # vxdg join newdg - Starts all volumes in an imported disk group. Example:

# vxrecover -g diskgroup -sb # vxrecover -g mydg -sb

#vxdg destroy <dgname> - Removes the specified DG, and frees all its disks back to general use by Vx. #vxsplitlines -g diskgroup - Reports conflicting configuration information . Example : vxsplitlines -g mydg ========================================================================= ============================== D) Subdisks & Commands:-------------------------------------------#vxmake sd <subdiskname> <disk>,<offset>,<length> - Creates a subdisk with the specified name, and by the offset and length specified. ex: "vxmake sd disk02-01 disk02,0,8000" NOTE: If you are going to add this subdisk to a plex, its good to check the other subdisks in that plex to see what their lengths and offsets are, use the command: "vxprint -st" # vxmake [-g diskgroup] sd subdisk diskname,offset,length -

Creates a

subdisk. Example: # vxmake -g mydg sd mydg02-01 mydg02,0,8000


#vxsd assoc <plexname> <subdiskname>,....etc - Associates the specified subdisks to the specified plex.

Example:"vxsd assoc vol01-03 disk01-01,disk02-01" NOTE: Striped volumes are diffrent, you need to specify the column# so use the following: # vxsd [-g diskgroup] assoc plex subdisk...etc -

Associates subdisks with an

existing plex. Example: # vxsd -g mydg assoc home-1 mydg02-01 mydg02-00 mydg02-01 # vxsd [-g diskgroup] assoc plex subdisk1:0 ... subdiskM:N-1 - Adds subdisks to the ends of the columns in a striped or RAID-5 volume. Example: # vxsd -g mydg assoc vol01-01 mydg10-01:0 mydg11-01:1 mydg1201:2

# vxsd [-g diskgroup] mv oldsubdisk newsubdisk ... - Replaces a subdisk. Example: # vxsd -g mydg mv mydg01-01 mydg02-01 # vxsd [-g diskgroup] -s size split subdisk sd1 sd2 - Splits a subdisk in two. Example: # vxsd -g mydg -s 1000m split mydg03-02 mydg03-02 mydg03-03 # vxsd [-g diskgroup] join sd1 sd2 ... subdisk - Joins two or more subdisks. Example: # vxsd -g mydg join mydg03-02 mydg03-03 mydg03-02 #vxassist [-g diskgroup] move volume !olddisk newdisk - Relocates subdisks in a volume between disks. Example: # vxassist -g mydg move myvol !mydg02 mydg05
#vxsd -l <col#/offset> assoc <plexname> <subdiskname>,...etc - Same as above, but used for associating subdisks to a striped plex. Use the command : "vxprint -st" to see what other subdisk in the plex look like, and then set the new subdisks column number and offset (found in the seventh column of output) to the appropriate value. #vxsd aslog <plex> <subdiskname> - Adds a log subdisk to the specified plex. Ex: "vxsd aslog vol01-02 disk03-01" # vxunreloc [-g diskgroup] original_disk - Relocates subdisks to their original disks. Example: # vxunreloc -g mydg mydg01 #vxsd dis <subdiskname> - Disassociates the specified subdisk from its current plex. # vxsd [-g diskgroup] dis subdisk -g mydg dis mydg02-01 mydg rm mydg02-01

- Dissociates a subdisk from a plex. Example: # vxsd

# vxedit [-g diskgroup] rm subdisk - Removes a subdisk. Example: # vxedit -g # vxsd [-g diskgroup] -o rm dis subdisk - Dissociates and removes a subdisk from a

plex. Example: # vxsd -g mydg -o rm dis mydg02-01


========================================================================= ============================== D) Plexs & Commands:-----------------------------------#vxmake plex <plexname> sd=<subdiskname>,<subdiskname>,....etc - Creates a new plex by the name specified and assigns the specified subdisks to it. # vxmake [-g diskgroup] plex plex sd=subdisk1[,subdisk2,...] -

Creates a

concatenated plex. Example: # vxmake -g mydg plex vol01-02 sd=mydg02-01,mydg02-02


#vxmake [-g diskgroup] plex plex layout=stripe|raid5 stwidth=W ncolumn=N sd=subdisk1[,subdisk2,...] - Creates a striped or RAID-5 plex. Example: # vxmake -g mydg plex pl-01 layout=stripe stwidth=32 ncolumn=2 sd=mydg01-01,mydg02-01 #vxmake plex <plexname> layout=<layout> stwidth=<stwidth> ncolumn=<ncolumn> sd=... - Like above command, but specifies layout type as defined by <layout>, which is used for creation of striped and RAID5 plexes. The layout is constrained by the defined number of columns, and stripe width. Subdisks specified are added to the created plex. #vxplex att <volname> <plexname> - Associates specified plex with specified volume. (Adds a mirror) NOTE: Attachment will take a while. Watch it with Vxtask, or via vxprint

[-g diskgroup] att volume plex - Attaches a plex to an existing volume. Example: # vxplex -g mydg att vol01 vol01-02
# vxplex #vxplex dis <plexname> - Disassociate specified plex from its connected volume. #vxplex det <plexname> - Detaches specified plex from its connected volume, but maintians association with it's volume. The plex is no longer used for I/O untill it is (re)attached. #vxplex [-g vol01-02

diskgroup] det plex - Detaches a plex. Example: # vxplex -g mydg det

#vxmend off <plexname> - Offlines a plex for repair to it's disks. #vxmend [-g diskgroup] off plex vxmend -g mydg off vol02-02 #vxmend [-g diskgroup] on mydg on vol02-02

- Takes a plex offline for maintenance. Example: #

plex - Re-enables a plex for use. Example: # vxmend -g

#vxmend fix clean <plexname> - Used to clean plexes that are in the "unclean" state. Used with unstartable volumes. #vxplex mv <originalplex> <newplex> - Moves the data content from the origonal plex onto a new plex. NOTE: The old plex must be active (ENABLED). The new plex should be the same length, or larger than the old plex. The new plex must not be associated with another volume.(duh) # vxplex [-g diskgroup] mv oldplex newplex -

Replaces a plex. Example: #

vxplex -g mydg mv vol02-02 vol02-03 #vxplex cp <volume> <newplex> - Copies the data from the specified volume to a new plex. NOTE: The new plex cannot be associated with any other volume. The new plex, further, will NOT be attached to the specified volume. (Also, see notes from above) # vxplex [-g diskgroup] cp volume newplex Example: # vxplex -g mydg cp vol02 vol03-01

Copies a volume onto a plex.

#vxmend [-g diskgroup] fix clean plex - Sets the state of a plex in an unstartable volume to CLEAN. Example:# vxmend -g mydg fix clean vol02-02 #vxedit -r rm <plexname> - Remove the plex. # vxplex

[-g diskgroup] -o rm dis plex - Dissociates and removes a plex from a volume.Example: # vxplex -g mydg -o rm dis vol03-01

========================================================================= ============================== D) Volumes & Commands :-----------------------------------------# vxassist [-g diskgroup] maxsize layout=layout [attributes] - Displays

the maximum size of volume that can be created. Example: # vxassist -g mydg maxsize layout=raid5 nlog=2
#vxassist make <volumename> <length> - Creates a new volume with the name specified and is made to the length specified. Ex: "vxassist make newvol 10m" NOTE: This command will pull disk space from the generally avalible Vx disk space. #vxassist make <volname> <length> layout=<layouttype> <disk> <disk> .... etc - Like the above command, but with layout specified. The most common layouts are: striped and raid5. ex: "vxassist make newvol 100m layout=raid5 disk01 disk02 disk03" NOTE: See the vxassist(1M) man page for more information. #vxassist -b [-g diskgroup] make volume length [layout=layout] [attributes] - Creates a volume.

Example: # vxassist -b -g mydg make myvol 20g layout=concat mydg01


mydg02

# vxassist -b [-g diskgroup] make volume length layout=mirror [nmirror=N][attributes] - Creates a mirrored volume. Example: # vxassist -b -g mydg make mymvol 20g layout=mirror nmirror=2
# vxassist -b [-g diskgroup] make volume length layout=layout exclusive=on [attributes] - Creates a volume that may be opened exclusively by a single node in a cluster. Example: # vxassist -b -g mysdg make mysmvol 20g layout=mirror exclusive=on

# vxassist -b [-g diskgroup] make volume length layout={stripe|raid5} [stripeunit=W] [ncol=N] [attributes] - Creates a striped or RAID-5 volume. Example: # vxassist -b -g mydg make mysvol 20g layout=stripe

stripeunit=32 ncol=4

# vxassist -b [-g diskgroup] make volume length layout=mirror mirror=ctlr [attributes] - Creates a volume with mirrored data plexes on separate controllers. Example: # vxassist -b -g mydg make mymcvol 20g layout=mirror
mirror=ctlr

# vxmake -b [-g diskgroup] -Uusage_type vol volume [len=length] plex=plex,... - Creates a volume from existing plexes. Example: # vxmake -g mydg -Uraid5 vol r5vol plex=raidplex,raidlog1,raidlog2
#vxmake vol <volname> len=<length> plex=<plexname>,...etc - Creates a new volume of specified length (usually in sectors), and attachs the specified plexes to that volume. Useful for creating volumes to house copied or moved plexes. NOTE: See the vxmake(1M) man page for more information. #vxvol start <volname> - Starts a volume # vxvol [-g diskgroup] start volume Example: # vxvol -g mydg start r5vol

Initializes and starts a volume for use.

#vxvol init <state> <volname> [plexname] - Manually sets the state of a volume. NOTE: Not for the squimish.

# vxvol [-g diskgroup] init zero volume - Initializes and zeros out a volume for use. Example: # vxvol -g mydg init zero myvol
#vxvol stop <volname> - Stops a volume. Alternately you can use command as such: "vxvol stopall" in order to stop all volumes. #vxassist maxsize [layout=raid5] - Returns the maximum size avalible via Vx to create a new volume. By adding "layout=raid5" to the command the calulations take into account losse due to raid5. Output is in sectors and Megs. #vxassist maxgrow <volname> - Returns the maximum ammount of Vx space that can be added to the specified volume. #vxassist mirror <volname> - Creates a mirror for the specified volume. NOTE: Think of this as "handsfree plex creation".This is fast, but the disks you want used may not be used... often best to do manually. #vxassist [-g diskgroup] mirror volume [attributes] -

Adds a mirror to a

volume. Example: # vxassist -g mydg mirror myvol mydg10 # vxassist [-g diskgroup] remove mirror volume [attributes] - Removes a mirror from a volume. Example: # vxassist -g mydg remove mirror myvol !mydg11
#vxassist addlog <volname> - Adds a Dirty Region Log (DRL) for the specified volume.

#vxassist remove log <volname> - Reverse of above. #vxassit growto/growby/shrinkto/shrinkby <volname> <length> - Resizes the volume specified. Use one of the following: growto, growby, shrinkto, and shrinkby in order to descide what <length> specifies. By default length is specified in sectors. This does not resize the filesystem inside the volume. NOTE: Don't shrink volumes to be less that its contained filesystem! (duh) #vxassist [-g diskgroup] {growto|growby} volume length -

Grows a volume

to a specified size or by a specified amount. Example: # vxassist -g mydg growby myvol 10g
# vxassist [-g diskgroup] {shrinkto|shrinkby} volume length -

Shrinks a

volume to a specified size or by a specified amount. Example: # vxassist -g mydg shrinkto myvol 20g
# vxresize -b -F vxfs [-g diskgroup] volume length diskname ... -

Resizes

a volume and the underlying Veritas File System. Example: # vxassist -b -F vxfs -g mydg myvol 20g mydg10 mydg11
#xvol set len=<length> <volname> - An alternate to above command. Sets the absolute lenths of the specified volume to the length specified, by default, in sectors. This does not resize the filesystem inside the volume. NOTE: There is also a resize(1M) command, used for resizing both volume AND filesytem. See the man page for that one. #xedit rm <volname> - Removes the specified volume. (poof!) NOTE: If the volume specified is in the ENABLED state, you will need to use the command "vxedit -f <volname>". Also, using the "r" with "f" will remove all plexes and subdisks with the volume. If you didn't guess, "r" is Recursive, and "f" is Force. ========================================================================= ============================================== E) Miscelneous Stuff :-----------------------------------To calculate the size of a filesystem inside a volume, use the command: #fstyp -v <volume-device-path> | head -30 | grep ncg Ignore the errors. Output will look this this: # fstyp -v /dev/vx/rdsk/datadg/vol01 | head -30 | grep ncg ncg 17152 size 70254592 blocks 65863396 # Broken Pipe Unknown_fstyp (no matches) The size found after the label "size" is presented in kilobytes. You can convert to sectors by multiplying by 2. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------The vxconfigd daemon identifies multiple paths to a device by issuing a SCSI inquiry command(/etc/vx/diag.d/vxdmpinq) to each operating system device. # /etc/vx/diag.d/vxdmpinq /dev/vx/rdmp/HDS9970V0_4s2 If we got two output with same serial number for the SCSI inquiry commands ,they are assumed to be the same physical disk or LUN responding on two

different paths. UNIX operating system creates data structures sometimes called nodes or device handles, in its device tree. For example, the Solaris operating system creates nodes in both the /dev/rdsk and /dev/dsk paths for each device it detects. If a device is accessible on two or more paths, operating systems treat each path as a separate device, and create nodes corresponding to each path. During its discovery process, VxVMs vxconfigd daemon creates similar structures called metanodes in the /dev/vx/rdmp and /dev/vx/dmp trees for each storage device it detects. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------To calculate the size of a volume, use vxprint, and look for the"len". The volume length is in sectors. Convert to kilobytes by dividing by 2. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Volume Growth Procudure: 1) You can use vxassist to estimate the max size of a given volume based on the disks you wish to add: ex: # vxassist -g rootdg maxgrow vol01 disk01 disk02 disk03 2) Next, actually grow the volume (NOT THE FS) via the command (assuming maxgrow outputed 10639360 as the maxsize): ex:# vxassist -g rootdg growto vol01 10639360 disk01 disk02 disk03 3) Now VxVM grinds away, monitor with vxtask. 4) Now Grow the Filesystem, for UFS use: # /usr/lib/fs/ufs/mkfs -F ufs -M /export /dev/vx/rdsk/rootdg/vol01 10639360 for VXFS ufs: # /usr/lib/fs/vxfs/fsadm -b 10639360 -r /dev/vx/rdsk/rootdg/vol01 /mnt --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Changing User/Group of a Raw Volume: (ex:) vxedit -g xxxdg set group=dba data_vol_123 vxedit -g xxxdg set user=oracle data_vol_123

Вам также может понравиться