veritas user guide

Upload: pervez-khan

Post on 06-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Veritas User Guide

    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 -gmydg list

    #vxdisk list - Display detailed information about a single disk, includingmutlipathing 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,includingdisks, subdisks, plexes, and volumes.

    #vxprint - Display report style information about the current status of ONLY thecomponant you request. So for instance, "vxprint vol01" shows information about allsubcomponants 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 fortrue 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 -gmydg

    #vxprint -pt [-g diskgroup] [plex ...] - Displays information about plexes eg : # vxprint -pt -gmydg

    #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 - 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 adiffrent Disk Group, use "vxinfo -g ".

    #vxinfo [-g diskgroup] [volume ...] - Displays information about the accessibility and usability ofvolumes.See the Veritas Volume Manager Troubleshooting Guide

    Example:# vxinfo -g mydg myvol1 myvol2

    #vxassist maxgrow - This command will output the maximum size the volumespecified can increased by, specified in sectors.

    =======================================================================================================B) Disks Tasks & Commands:---------------------------------------------

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

    #vxdiskadd - vxdiskadd Adds a disk to Vx by Initializing andEncapsolating it. Specified by its device name (ex: c0t1d0s2).This command, can also be usedto add a disk to a specified disk group. Just follow the prompts. No reboots needed for changingDG's.

  • 8/2/2019 Veritas User Guide

    2/9

    NOTE: You'll need to reboot to finalize the disk addition!

    #vxedit rename - Rename a Vx disk. Ex: "vxedit rename disk01disk05"

    #vxedit [-g diskgroup] rename olddisk newdisk - Renames a disk under control ofVxVM.Example: # vxedit -g mydg rename mydg03 mydg02

    #vxedit set reserve=on - Sets the "reserve" flag to a Vx disk. This is used to keepspecific 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 - Used to "offline" a disk. The disk should be removed from itsdiskgroup before being offlined.

    #vxdisk rm - Used to remove disks from Vx control completely.Ex: "vxdisk rmc0t1d0s2" Make sure to removed the disk from its diskgroup, and offlinethe 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 - Sets the "spare" flag to a Vx disk. This is used to make thespecified disk a hot spare, which is then added to the "hot spare pool".

    #vxedit set spare=off - Same as above but removes the disk from the "hot sparepool".- 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 followthe 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 setspare=off mydg04

    # vxdiskunsetup devicename - Removes a disk from control of VxVM. eg ) #

    vxdiskunsetup c0t3d0

    =======================================================================================================

    C) Disk Groups & Commands:---------------------------------------------#vxdg init = - Creates a new disk group, and assigns thenaming 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 anew DG name for the DG field.

    #vxdg deport - Disabled a diskgroup, but doesn't remove it. Often used as an

  • 8/2/2019 Veritas User Guide

    3/9

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

    # vxdg [-n newname] deport diskgroup - Deports a disk group and optionally renames

    it. Example: # vxdg -n newdg deport mydg

    #vxdg import - Reverse of above. Enables local access to the specified diskgroup.

    #vxdg [-n newname] import diskgroup - Imports a disk group and optionally renames

    it. Example: # vxdg -n newdg import mydg

    #vxdg -n - Change a Disk Groups name.

    #vxdg list - Use this to check the version numbers of Disk Groups. Shows otherdetails about the DG too.

    #vxdg [-o expand] listmove sourcedg targetdg object ... etc - Lists theobjects 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 join sourcedg targetdg - Joins two disk groups. Example: # vxdg join newdgmydg

    # vxrecover -g diskgroup -sb - Starts all volumes in an imported disk group. Example:# vxrecover -g mydg -sb

    #vxdg destroy - Removes the specified DG, and frees all its disks back to generaluse by Vx.

    #vxsplitlines -g diskgroup - Reports conflicting configuration information . Example : vxsplitlines-g mydg

    =======================================================================================================D) Subdisks & Commands:---------------------------------------------#vxmake sd ,, - Creates a subdisk with the specifiedname, 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 ,....etc - Associates the specified subdisks to thespecified plex.

  • 8/2/2019 Veritas User Guide

    4/9

    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 mydg12-01: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 assoc ,...etc - Same as above, but usedfor associating subdisks to a striped plex.Use the command : "vxprint -st" to see what other subdisk in the plex look like, and then set thenew subdisks column number and offset (found in the seventh column of output) to theappropriate value.

    #vxsd aslog -Adds a log subdisk to the specified plex. Ex: "vxsd aslogvol01-02 disk03-01"

    # vxunreloc [-g diskgroup] original_disk - Relocates subdisks to their original disks.

    Example: # vxunreloc -g mydg mydg01

    #vxsd dis - Disassociates the specified subdisk from its current plex.

    # vxsd [-g diskgroup] dis subdisk - Dissociates a subdisk from a plex. Example: # vxsd-g mydg dis mydg02-01

    # vxedit [-g diskgroup] rm subdisk - Removes a subdisk. Example: # vxedit -gmydg rm mydg02-01

    # vxsd [-g diskgroup] -o rm dis subdisk - Dissociates and removes a subdisk from a

  • 8/2/2019 Veritas User Guide

    5/9

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

    =======================================================================================================D) Plexs & Commands:-------------------------------------#vxmake plex sd=,,....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 aconcatenated 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=2sd=mydg01-01,mydg02-01

    #vxmake plex layout= stwidth= ncolumn= sd=...- Like above command, but specifies layout type as defined by , which is used forcreation of striped and RAID5 plexes. The layout is constrained by the defined number ofcolumns, and stripe width. Subdisks specified areadded to the created plex.

    #vxplex att - Associates specified plex with specified volume. (Adds amirror)NOTE:Attachment will take a while. Watch it with Vxtask, or via vxprint

    # vxplex [-g diskgroup] att volume plex - Attaches a plex to an existing volume.

    Example: # vxplex -g mydg att vol01 vol01-02

    #vxplex dis - Disassociate specified plex from its connected volume.

    #vxplex det - Detaches specified plex from its connected volume, but maintiansassociation with it's volume. The plex is no longer used for I/O untill it is (re)attached.

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

    #vxmend off - Offlines a plex for repair to it's disks.

    #vxmend [-g diskgroup] off plex - Takes a plex offline for maintenance. Example: #vxmend -g mydg off vol02-02

    #vxmend [-g diskgroup] on plex - Re-enables a plex for use. Example: # vxmend -gmydg on vol02-02

    #vxmend fix clean - Used to clean plexes that are in the "unclean" state. Usedwith unstartable volumes.

    #vxplex mv - Moves the data content from the origonal plex onto anew plex.NOTE: The old plex must be active (ENABLED). The new plex should be the same length, orlarger 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: #

  • 8/2/2019 Veritas User Guide

    6/9

    vxplex -g mydg mv vol02-02 vol02-03

    #vxplex cp - 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, willNOT be attached to the specified volume. (Also, see notes from above)

    # vxplex [-g diskgroup] cp volume newplex - Copies a volume onto a plex.Example: # vxplex -g mydg cp vol02 vol03-01

    #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 - 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 - Creates a new volume with the name specified andis 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 layout= .... etc - Like theabove 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 mydg01mydg02

    # 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 20glayout=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

  • 8/2/2019 Veritas User Guide

    7/9

    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=mirrormirror=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 r5volplex=raidplex,raidlog1,raidlog2

    #vxmake vol len= plex=,...etc - Creates a new volume ofspecified length (usually in sectors), and attachs the specified plexes to that volume. Useful forcreating volumes to house copied or moved plexes.NOTE: See the vxmake(1M) man page for more information.#vxvol start - Starts a volume

    # vxvol [-g diskgroup] start volume - Initializes and starts a volume for use.

    Example: # vxvol -g mydg start r5vol

    #vxvol init [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 - Stops a volume. Alternately you can use command as such: "vxvolstopall" 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 toraid5. Output is in sectors and Megs.

    #vxassist maxgrow - Returns the maximum ammount of Vx space that can beadded to the specified volume.

    #vxassist mirror - 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 bestto do manually.

    #vxassist [-g diskgroup] mirror volume [attributes] - Adds a mirror to avolume.

    Example: # vxassist -g mydg mirror myvol mydg10

    # vxassist [-g diskgroup] remove mirror volume [attributes] - Removes amirror from a volume.

    Example: # vxassist -g mydg remove mirror myvol !mydg11

    #vxassist addlog -Adds a Dirty Region Log (DRL) for the specified volume.

  • 8/2/2019 Veritas User Guide

    8/9

    #vxassist remove log - Reverse of above.

    #vxassit growto/growby/shrinkto/shrinkby - Resizes the volumespecified. Use one of the following: growto, growby, shrinkto, and shrinkby in order to descidewhat specifies. By default length is specified in sectors. This does not resize thefilesystem 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= -An alternate to above command. Sets the absolute lenthsof the specified volume to the length specified, by default, in sectors. This does not resize thefilesystem inside the volume.NOTE: There is also a resize(1M) command, used for resizing both volume AND filesytem. Seethe man page for that one.

    #xedit rm - Removes the specified volume. (poof!)NOTE: If the volume specified is in the ENABLED state, you will need to use the command"vxedit -f ". Also, using the "r" with "f" will remove all plexes and subdisks with thevolume. 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 | head -30 | grep ncgIgnore the errors. Output will look this this:# fstyp -v /dev/vx/rdsk/datadg/vol01 | head -30 | grep ncgncg 17152 size 70254592 blocks 65863396# Broken PipeUnknown_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 inquirycommand(/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 assumedto be the same physical disk or LUN responding on two

  • 8/2/2019 Veritas User Guide

    9/9

    different paths.

    UNIX operating system creates data structuressometimes called nodes or device handles, in its device tree. For example, the Solarisoperating system creates nodes in both the /dev/rdsk and /dev/dsk paths for eachdevice it detects. If a device is accessible on two or more paths, operating systems treateach path as a separate device, and create nodes corresponding to each path.

    During its discovery process, VxVMs vxconfigd daemon creates similar structurescalled metanodes in the /dev/vx/rdmp and /dev/vx/dmp trees for each storage deviceit detects.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------To calculate the size of a volume, use vxprint, and look for the"len". The volume length is insectors. 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 wishto add:

    ex: # vxassist -g rootdg maxgrow vol01 disk01 disk02 disk03

    2) Next, actually grow the volume (NOT THE FS) via thecommand (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_123vxedit -g xxxdg set user=oracle data_vol_123