Tuesday, June 10, 2014

VxVM Bible - Quick Ref

Section 1. Foundation Suite Concepts
1.01 Identify the physical objects used by VERITAS Volume Manager to store data
            VTOC & partitions
1.02 Describe the process by which a physical disk is brought under Volume Manager control
            Removes partition table entries from VTOC (except slice 2)
            Rewrites VTOC and creates private (disk header, configuration database & kernel logs) & public regions
            Default size of private region is 2048 blocks (sectors) & maximum size is 524288 blocks (sectors)
            With 512b blocks, default size is 1048576b (1MB) & maximum size is 268435456b (256MB)
1.03 Identify the virtual objects created by Volume Manager to manage data storage
            disk groups, VM disks, subdisks, plexes and volumes
1.04 Identify common virtual storage layout types
            concat, striped, mirrored, RAID-5, layered
Section 2. Installing Foundation Suite
2.01 Identify VxVM and VxFS installation prerequisites
            license key requirements:
            customer number from License Key Request form
            order number from License Key Request form
            host id  # hostid
            machine type  # uname -i
            # vxlicense -c  Add license key
            # vxlicense -p  View license key
2.02 Identify guidelines for planning initial setup of VxVM
VxVM 3.5 Packages
VRTSvxvm
VRTSvlic
VRTSvmdoc
            VRTSvmman
2.03 Describe how to set up VxVM by using the vxinstall program
            # /cdrom/cdname/installer
            # vxinstall
Section 3. Managing Storage with Volume Manager
3.01 Describe the three VxVM user interfaces
            cli, vxdiskadm, VMSA
3.02 Explain how to access the VxVM CLI commands
            /etc/vx/bin, /usr/sbin, /usr/lib/vxvm/bin
            vxassist           Creates and manages volumes in a single step
            vxprint             Lists information from the VxVM configuration records
            vxdg                 Operates on disk groups—creates new disk groups and administers existing disk groups
            vxdisk              Administers disks under VxVM control—defines special disk devices, initializes information, etc.
3.03 Explain how to access the vxdiskadm main menu
            # vxdiskadm
3.04 Determine the steps to start the VMSA server and client
            # vmsa &
3.05 Describe how to customize VMSA security
            Users need appropriate privileges and access can be restricted to specific users
3.06 Identify the steps to run VMSA in read-only mode
            Menu bar / Options / Set VMSA to read-only mode
3.07 Describe the two device-naming schemes available in VxVM
            Standard device naming and Enclosure-based naming
3.08 Explain how to add a disk to a VxVM disk group
            Configure a disk for VxVM control:
# vxdisksetup -i devicetag [attributes: config, noconfig, privlen=length, privoffset=offset, publen=length, puboffset=offset]
            Add initialized disks to a disk group:
# vxdg -g diskgroup adddisk diskname=devicetag
3.09 Choose the effective method to view disk information, given various methods
            # vxdisk list                             List disk information
            # vxdisk list diskname             List disk information for specific disk
# vxdisk -o alldgs list              List disk information for all disk groups
# vxdisk -s list                         Summarize for all disks
# prtvtoc /dev/rdsk/…               Displays VTOC configuration ; Tag 14=public region, Tag 15=private region
# vxdg -g diskgroup free         Show free space in diskgroup
3.10 Explain how to remove a disk from a disk group
            # vxevac –g diskgroup  from_disk  to_disk
# vxdg [-g diskgroup]  rmdisk  diskname
            If no diskgroup is specified, default is rootdg; Returns disk to the free disk pool
            # vxdiskunsetup [-C]  devicetag
            -C to clear host locks on device
            Deconfigures a disk by returning it to an uninitialized state
•      To exclude specific disks from VxVM control, create /etc/vx/disks.exclude
•      To exclude all disks on a specific controller, create /etc/vx/cntrls.exclude
•      To exclude all disks in specific enclosure, create /etc/vx/enclr.exclude
3.11 Explain the method, or methods, for moving a disk from one disk group to another
           # vxdg -g diskgroup rmdisk diskname
            # vxdg -g diskgroup adddisk diskname=devicetag
Renaming a disk:
# vxedit -g diskgroup rename old_diskname new_diskname
3.12 Identify the purposes of disk groups
            enable logical grouping, move host to host, high availability
3.13 Explain how to create, deport, import, rename and destroy a disk group
•     Create a disk group using initialized disk:
            # vxdg init diskgroup diskname=devicename
•     Create a spare disk for a disk group:
            # vxedit -g diskgroup set spare=on | off disk_media_name
•     Deport a disk group:
           # vxdg deport diskgroup
•     Deport and rename:
           # vxdg -n new_name deport old_name
•     Deport to a new host:
           # vxdg -h hostname deport diskgroup
•     Import a disk group:
•     # vxdg import diskgroup
•     # vxvol start
•     Rename:
            # vxdg -n new_name deport old_name
            # vxdg import new_name
            # vxvol start
or
# vxdg deport old_name
# vxdg -n new_name import old_name
            # vxvol start
•     Import and temporarily rename:
            # vxdg -t -n temp_new_name import real_name
            # vxvol start
•     Import, clear locks and temporarily rename:
            # vxdg -tC -n temp_new_name import real_name
            # vxvol start
•     Force an import::
            # vxdg -f import diskgroup
•     Move a disk group:
            # vxdg -h hostname deport diskgroup
            # vxdg import diskgroup
            # vxvol start
•     Destroy a disk group:
            # vxdg destroy diskgroup
3.14 View information about a disk group
            # vxdg list diskgroup
3.15 Describe how to upgrade the disk group version
            # vxdg [-T version] upgrade diskgroup    (if no version is specified, default is the latest version)
            Specify version when creating disk group:
            # vxdg -T 50 init diskgroup diskname=devicetag
3.16 Identify the features of volume layouts supported by VxVM
•      Disk spanning—concatenation, striping
•      Data redundancy—mirroring, parity
•      Resilience—layered volume
•      RAID

•      RAID-0—simple concatenation or striping
•      RAID-1—mirroring
•      RAID-5—stripe with parity
•      RAID-0+1—adding a mirror to concat or striped layout; striping + mirroring = mirror-stripe layout; concatting + mirroring = mirror-concat layout; mirroring occurs ABOVE the concat or striping
•      RAID-1+0—adding a mirror BELOW concat or striped layout; mirrors each column of stripe or chunk of concat; called the layered volume

Layout types:
•      Concatenated
•      Striped
•      Mirrored
•      RAID-5
•      Layered volumes—stripe-mirror (Striped Pro) and concatenated-mirror (Concatenated Pro)
3.17 Explain how to create a volume
            # vxassist [-g diskgroup] [-b] make volume_name [m | k | g] [attributes]
            Attributes:
            layout=nostripe
            layout=stripe
            layout=mirror-stripe
            layout=mirror-concat
ncol=n
            nstripe=n or stripes=n
            stripeunit=size (default is 64k)
            layout=raid5,nolog (default is to create log)  (default stripe unit size is 16k)
            layout=mirror
            nmirror=n
            layout=stripe,mirror  (striped volume that is mirrored)
            logtype=drl | drlseq
            nlog=n
            [disk names…]
•      /dev/vx/dsk/diskgroup/volume = block device
•      /dev/vx/rdsk/diskgroup/volume = character (raw) device
•      To determine largest possible size for the volume to be created:
            # vxassist -g diskgroup maxsize attributes…
•         To determine how much a volume can expand:
            # vxassist -g diskgroup maxgrow volume
3.18 Describe how to display volume layout information
            # vxprint -g diskgroup  [options]
            options:
            -vpsd   Select volume, plex, subdisk, or disk
            -h         List hierarchies below selected records
            -r          Display related records
            -t          Print single-line output
            -l          Display long listing
            -a         Display all information
            -A         Select from all active disk groups
            -e pattern   Show matching records
3.19 Remove a volume from VxVM
            # vxassist [-g diskgroup] remove volume vol_name
            or
            # vxedit [-g diskgroup] –rf rm vol_name
3.20 Explain how to add a mirror to, and remove a mirror from, an existing volume
•      Adding a mirror [to specific disk]:
      # vxassist -g diskgroup mirror vol_name [disk_name]
•      Mirroring all volumes:
      # vxmirror –g diskgroup –a
•      Creating | removing mirror volumes by default:
      # vxmirror –d yes | no
•      Adding non-mirror with mirror volume default:
      # vxassist [-g diskgroup] remove volume vol_name
•      Removing a mirror:
      # vxassist [-g diskgroup] remove mirror volume [!]dm_name        
      or
      # vxplex [-g diskgroup] dis plex_name      
      # vxplex [-g diskgroup] –rf rm plex_name
      or
      # vxplex -g diskgroup -o rm dis plex_name           
3.21 Identify the steps to add a log to an existing volume
            # vxassist -g diskgroup  addlog  vol_name  [logtype=drl]  [nlog=n]  [disks_for_log]
•      Removing a log:
            # vxassist -g diskgroup remove log [nlog=n] vol_name
3.22 Explain how to change the volume read policy for a mirrored volume
            3 read policies:
            - round robin
            - preferred
            - select (default)
            # vxvol -g diskgroup rdpol round | prefer | select  vol_name [preferred_plex]
3.23 Describe how to allocate storage for a volume
[adding a file system to a volume]
            # mkfs -F fstype /dev/vx/rdsk/diskgroup/volume
            # mkdir /mount_point
            # mount -F fstype /dev/vx/rdsk/diskgroup/volume /mount_point
            Specifying storage attributes:
            # vxassist [-g diskgroup]  make vol_name  length  [layout=layout]  storage_attributes…
            Layouts:
            layout=nostripe
            layout=stripe
            ncol=n
            nstripe=n or stripes=n
            stripeunit=size (default is 64k)
            layout=raid5,nolog (default is to create log)  (default stripe unit size is 16k)
            layout=mirror
            layout=mirror-stripe  (striped below, mirrored above)
nmirror=n
            layout=stripe,mirror  (striped volume that is mirrored)
            logtype=drl | drlseq
            nlog=n
maxsize
Storage attributes:
            disk_name
            ctlr:controller_name
            enclr:enclosure_name
            target:target_name
            c#tray#  (for trays)
            ! (to exclude)
            mirror=ctlr
            mirror=enclr
            mirror=target
            (mirror=disk default)

            Specifying ordered allocation of storage for volumes:
            Storage is allocated in the following order:
1.    VxVM concatenates the disk
2.    VxVM forms columns
3.    VxVM forms mirrors
            # vxassist [-g diskgroup] [-o ordered]  make vol_name length [layout=layout] storage_attributes…
            -o ordered options:
            col_switch=size1,size2…
            logdisk=disk  (for RAID-5 volumes unless nolog or noraid5log is specified)

            Regular (nonlayered) mirrored volume is mirror-stripe layout (striped first, then mirrored)
Layered volume is stripe-mirror layout
3.24 List the benefits of layered volumes
            Regular mirrored volume:  if 2 drives fail, volume survives 2 out of 6 (1/3) times
            Layered volume:  if 2 drives fail, volume survives 4 out of 6 (2/3) times
            Improved redundancy
            Faster recovery times
Cons:   Requires more VxVM objects
            Fills up disk group configuration database sooner
3.25 Identify the types of mirrored and enhanced mirrored (layered) volume layouts available in VxVM
            Nonlayered (recommended for less than 1GB of space):
•      mirror-concat—top level volume contains more than one plex, and plexes are concatenated
•      mirror-stripe—top level volume contains more than one plex, and plexes are striped

Layered (not recommended for root or swap volumes):
•      concat-mirror—top level volume is concatenated plex, and subdisks are mirrored (Concatenated Pro) (requires at least 2 disks)
•      stripe-mirror—top level volumes is striped plex, and subdisks are mirrored (Striped Pro) (requires at least 4 disks)
3.26 Explain how to create a layered volume
            # vxassist [-g diskgroup]  make vol_name length layout=concat-mirror [attributes…]
            # vxassist [-g diskgroup]  make vol_name length layout=stripe-mirror [attributes…]
3.27 Identify how to control the default behavior of VxVM when creating mirrored volume layouts
            trigger point default = 1GB
            Default mirroring behavior:
            Striped layouts:
•      mirror-stripe—trigger points ignored
•      stripe,mirror—trigger points applied
•      stripe-mirror—mirroring at column or subdisk level and trigger point attributes applied
            Concatenated layouts:
•      mirror—trigger points applied
•      mirror-concat—trigger points ignored
•      concat-mirror—mirroring at subdisk level and trigger point attributes applied
3.28 View information about a layered volume
# vxprint -rth vol_name
            -r  display subvolume configuration for layered volume
            -t  prints single-line output records
            -h hierarchical
3.29 Describe how to resize a volume
            vxresize—automatically resizes both the volume and the file system  (resize everything at once)
            vxassist—resizes the volume but not the file system  (assist me with volume, then the file system)

            # vxassist -g diskgroup growto | growby | shrinkto | shrinkby vol_name size

            # vxresize [-bsx] -F fstype  -g diskgroup  vol_name  [+ | -]new_length
            -b  background
            -s  make sure to shrink volume length
            -x  make sure to expand volume length
3.30 Determine when and how to change the volume layout
            vxresize—automatically resizes both the volume and the file system  (resize everything at once)
            vxassist—resizes the volume but not the file system  (assist me with volume, then I’ll do the file system)
3.31 Describe how to manage volume maintenance tasks
            vxtask—monitor tasks, modify task states (pause, continue, and abort), modify rate of progress

            # vxtask [-ahlpr]  list  [task_id | task_tag]
            -a  show aborted tasks
            -h  hierarchical
            -l  long format
            -p  show paused tasks
            -r  show running tasks

            # vxtask [-c count]  [-ln]  [-t time]  [-w interval]  monitor  [task_id | task_tag]
            -c  show this number of tasks
-l   long format
            -n  show newly registered tasks
-t  exit after time in seconds
            -p  show paused tasks
            -w  show waiting after interval seconds with no activity

            # vxtask  abort | pause | resume   [task_id | task_tag]

            # vxtask [-i task_id]  set  slow=value

            Can display status of, control progress rate, reverse, or start a relayout operation:
            # vxrelayout -g diskgroup  status | reverse | start  vol_name
            # vxrelayout  -o slow=iodelay | iosize=size  [task_id | task_tag]

Other stuff to know:
            Create volume snapshot mirror to be backed up:
            # vxassist -g diskgroup  -b snapstart  vol_name

            To ensure the snapshot mirror is synchronized before detaching:
            # vxassist -g diskgroup  snapwait  orig_vol_name
           
            Create snapshot volume (detaches snapshot mirror, creates new volume and attaches mirror to new volume):
            # vxassist -g diskgroup  snapshot  orig_volume  new_volume

            To remove snapshot mirror that has not been detached and moved to new volume (not needed):
            # vxassist -g diskgroup  snapabort  orig_vol_name

            To remove the snapshot new_volume:
            # vxassist -g diskgroup  remove volume  new_volume

            Reassociate snapshot volume with original volume:
            # vxassist -g diskgroup  snapback  new_volume

            To use new_volume to merge back to orig_volume:
            # vxassist -g diskgroup  -o resyncfromreplica  snapback  new_volume

            To disassociate the snapshot from its original volume:
            # vxassist -g diskgroup  snapclear  new_volume
            Changing volume layouts:
            # vxassist -g diskgroup  relayout  vol_name | plex_name  layout=layout  ncol=+-n  stripeunit=size
[tmpsize=size]
Temporary (scratch) storage space defaults:
orig volume is less than 50MB, temp storage=volume size
orig volume is 50MB-1GB, temp storage=50MB
orig volume 1GB+, temp storage=1GB
Changing resilience level of volume (converting nonlayered to layered or vice versa):
            # vxassist -g diskgroup  convert   vol_name | plex_name  layout=layout
mirror-stripe    to         stripe-mirror
stripe-mirror    to         mirror-stripe
mirror-concat   to         concat-mirror
concat-mirror   to         mirror-concat

Section 4. Managing File Systems
4.01 Identify how to create a file system using the mkfs command
            # mkfs -F vxfs  [-o specific_options]  /dev/vx/rdsk/datadg/datavol  [size]
4.02 Explain how to set file system properties using mkfs command options
            -o  options:
N                      doesn’t really create it
            largefiles         supports 2+GB files  (default is nolargefiles)
            version=          specify layout version  (4 and 5 are valid; 5 is default)
            bsize=              sets logical block size (default is 1024b/1K)
            logsize=           number of blocks allocated for logging area (intent log) (default log size is 16384)
4.03 Select the best method to mount a file system using the mount command
            # mount -F vxfs  [-r] [-o specific_options]  /dev/vx/dsk/datadg/datavol  /my data
            -r   read-only
            mount -v   status of mounted file systems and options, verbose
            mount -p   display mounted file systems in  /etc/vfstab format
            mount -a   mount all file systems listed in /etc/vfstab
4.04 Explain how to maintain file system consistency by using the fsck command
            # fsck -F vxfs  [-m]  [-y|-n]  [-o full,nolog] [-o p]  /dev/vx/rdsk/datadg/datavol
            -m        check but don’t repair
            -o full   perform full system check
            -o nolog            do not replay the log
            -o p      perform parallel log replay (versus checking devices sequentially)
4.05 Identify how to resize a file system
            Before resizing a file system, check available free space of underlying device:
            prtvtoc or format to check size of disk partitions for file systems mounted on partitions
            vxprint to check size of VxVM volumes
            vxdg to check available free space on any disk within disk group
•      Resize VxVM file system:
            # fsadm -F vxfs [-b newsize]  [-r raw_device]  /mount_point

            newsize specified by sectors/512b
            raw_dev specifies path of raw device if not listed in /etc/vfstab and fsadm cannot determine raw device

            # vxdg -g datadg free
            # vxassist -g datadg growto datavol 1024000  (expand the volume)
            # fsadm -F vxfs -b 1024000 -r /dev/vx/rdsk/datadg/datavol  /datavol  (expand the file system)
            # df -k /datavol

            # fsadm -F vxfs -b -512000 -r /dev/vx/rdsk/datadg/datavol  /datavol  (shrink the file system)
            # vxassist -g datadg shrinkto datavol 512000  (shrink the volume)
4.06 Describe how to create and manage a snapshot file system

4.07 List features of the four VxFS file system layout options
            Version 1 Layout—VxFS 1.x—intent logging, extent allocation, unlimited inodes
            Version 2 Layout—VxFS 2.x—added dynamic inode allocation, ACLs, quotas
            Version 4 Layout—VxFS 3.2.x—added large file support, ability for extents to span allocation units
            Version 5 Layout—VxFS 3.5 +—added support for file system sizes up to 32TB
4.08 Define two types of fragmentation
            Directory fragmentation & Extent fragmentation—extent fragmentation most critical
            Fragmented file system has one or more of the following characteristics:
•      More than 50% of free space used by small extents of less than 64 blocks in length
•      A large number of small extents that are free, usually greater than 5% of free space in extents of less than 8 blocks in length
•      Less than 5% of the total file system size available is in large extents (i.e., lengths of 64 or more blocks)
4.09 Explain how to run fragmentation reports by using the fsadm command
            # fsadm -D /mount_point                    monitor Directory fragmentation
            # fsadm -E [-l largesize] /mount_point            monitor Extent fragmentation (largesize default value is 64 blocks)
            # df -F vxfs -o s                                   prints the number of free extents of each size
4.10 Define how to defragment a file system by using the fsadm command
            # fsadm [-d] [-D] [-e] [-E] [-s] [-v] [-l largesize] [-a days] [-t time] [-p passes] [-r rawdev]  /mount_point
            options:
                  -d                    reorganizes directories and reordered to place subdirectory entries first, then other entries                                      decreasing by time of last access; directory is also compacted to remove free space
                  -e                    reorganizes extents, to have the minimum number of extents
                  -D                    reports on directory fragmentation; directory reorgs complete before extent reorgs
                  -E                    reports on extent fragmentation
                  fragmentation reports are produced both before and after the reorganization (for -d, -e, -D, -E combinations)
                  -s                     summary of activity
                  -v                     verbose
                  -l largesize    extent reorg tries to group large files into large extents of 64 (default) blocks
                  -a days           show files not accesses within specific number of days as “aged” files (default is 14 days)
                  -t time             maximum length of time to run in seconds; fsadm exits when condition met
                  -p passes      number of passes (default is 5 passes); fsadm exits when condition met
                  -r rawdev       specify raw device
Section 5. Foundation Suite Architecture
5.01 Describe the role of the intent log in a VERITAS file system
The intent log records pending changes to the file system structure and writes the log records to disk in advance of the changes to the file system.  Once the intent log has been written, the other updates to the fs can be written in any order.  In event of system failure, VxFS fsck utility replays the intent log to recover a fs without completing a full structural check o f the entire fs.  The fs can be recovered and mounted only seconds after a failure.  Default intent log size is 16384 blocks.
5.02 Identify guidelines for selecting an intent log size to maximize file system performance
            Larger log sizes may improve performance for intensive synchronous writes, but may increase recovery time, memory                 requirements, and log maintenance time.  Log size should never be more than 50% of the             physical memory size of the             system.
5.03 Explain how to control logging behavior by using mount command options
            #mount -F vxfs  [generic_options]  [-o specific_options]  /mount_point
            -o options:
                log                          guarantees that all structural changes to the file system have been logged on disk when the                                                           system call returns; if system failure occurs, fsck replays recent changes so that they are not lost.
                delaylog                                default option that does not need to be specified.  Some system calls return before the intent log is                                                      written and the logging delay improves the system performance; some changes are not guaranteed until                                  shortly after system call returns when the intent log is written.  If a system failure occurs, recent                                                     changes may be lost.
                tmplog                   intent logging is almost always delayed.  This option greatly improves performance but recent changes                                                disappear if system crashes.  This mode is only recommended for temporary file systems.
                nodatainlog          use on systems with disks that do not support bad block revectoring
                blkclear                  used in increased security environments; guarantees that all storage is initialized before being                                                      allocated to files.  Increased integrity is provided by clearing extents on disk when they are allocated                                                 within a file.  10% slower than standard mode VxFS file system.
                logiosize=size      performance of storage devices using read-modify-write features improves if the writes are performed                                             in a particular size or multiple thereof.  Specify size in bytes of 512, 1024, 2048, 4096, 8192.
INTEGRITY              -o blkclear       -o log               -o delaylog                  -o tmplog    -> PERFORMANCE            -o nodatainlog                        
5.04 Interpret VxVM configuration database information, given examples
            configuration database quotas:
            By default, each disk group, VxVM maintains a minimum of 5 active database copies on the same controller.  If different                 controllers are represented on the disks in the same disk group, VxVM maintains a minimum of 2 active copies per             controller.
            To list detailed information from the configuration database about specific disks:
            # vxdisk -g diskgroup list  disk_name
5.05 Describe how to control the VxVM configuration daemon
            vxconfigd modes:
            Enabled—normal operating state
            Disabled—most operations not allowed
            Booted—part of normal system startup while acquiring rootdg
            Use vxdctl to control vxconfigd
•     To determine whether the configuration daemon is enabled / display the status:
            # vxdctl mode
•     To enable vxconfigd
            # vxdctl enable
            This command forces the configuration daemon to read all the disk drives in the system and to set up its tables to reflect     each known drive.  When a drive fails and the admin fixes the drive, this command enables VxVM to recognize the drive.
•     To disable | stop  vxconfigd
            # vxdctl disable | stop
            or #vxdctl -k stop to send a kill -9 to vxconfigd
•     To start vxconfigd:
            # vxconfigd
            Once started, vxconfigd automatically becomes a background process; by default vxconfigd issues errors to the console,                 but can be configured to issue errors to a log file.
Other stuff to know:
vxconfigd    when a system is booted, command vxdctl enable is automatically executed to start the VxVM configuration daemon—vxconfigd.  VxVM reads /etc/vx/volboot file to determine disk ownership and imports rootdg and other disk groups owned by host.  Vxconfigd reads kernel log to determine state of VxVM objects, the reads the configuration database on the disks, then uses the kernel log to update the state information of VxVM objects.
/etc/vx/volboot      contains a host ID that is used by VxVM to establish ownership of physical disks and is a list of disks to scan for the rootdg disk group
•       To view contents of volboot:
                # vxdctl list
•       To change host ID in volboot (if you change the host name in UNIX), and on all disks in disk groups currently imported on machine:
                # vxdctl hostid host_name
                # vxdctl enable
•       To recreate the volboot file if removed or invalidated:
              # vxdctl init [host_name]
3 types of VxVM disks:
simple disk—created dynamically in the kernel and has public and private regions contiguous inside a single partition
sliced disk—has separate slices for the public and private regions
NOPRIV disk—does not have a private region

Section 6. Introduction to Recovery
6.01 Describe how VxVM maintains data consistency after a system crash
Resynchronization—after system crash all mirrors in mirrored volumes contain exactly the same data and data and parity in RAID-5 volumes agree.  VxVM records when a volume is first written to and marks it as dirty; when all the writes have been completed, Volume Manager removes the dirty flag for the volume.  Only volumes marked as dirty when system reboots require resynchronization.
VxVM uses 2 types of resynchronization processes to maintain consistency of plexes in a volume:
Atomic-Copy resynchronization—sequential writing of all blocks of a volume to a plex
•      used in adding a new plex
•      reattaching a detached plex to a volume
•      online reconfiguration operations like moving or copying a plex, creating a snapshot, or moving a subdisk
Read-Writeback resynchronization—for volumes that were fully mirrored prior to a system failure, and there may be outstanding writes to the volume when system crashed
Plexes that were ACTIVE at crash are set to ACTIVE but volume is placed in SYNC or NEEDSYNC state
Read thread started for entire volume and blocks written back to other plexes
When resync is complete, SYNC flag changed to ACTIVE
To minimize resynchronization impact on performance use:
•          Dirty region logging for mirrored volumes
•          RAID-5 logging for RAID-5 volumes
•          FastResync for mirrored and snapshot volumes
•          SmartSync Recovery Accelerator for volumes used by database applications (resilvering)
6.02 Describe the hot-relocation process
vxrelocd     hot-relocation daemon; if redundancy failures are detected, vxrelocd automatically relocates affected data from mirrored or RAID-5 subdisks to spare disks/free space within disk group; notifies sys admin by email of relocation activity.
1.    vxrelocd detects disk failure
2.    administrator notified by email
3.    subdisks relocated to a spare
4.    volume recovery is attempted
Partial disk failure—redundant data on the failed portion of the disk is relocated and existing volumes on the unaffected portions of the disk remain accessible.  The disk is not removed from VxVM control and labeled FAILING rather than FAILED.  Before removing a failing disk for replacement, you must evacuate any remaining volumes on the disk.
Hot relocation is performed for redundant (mirrored or RAID-5) subdisks on a failed disk.  Nonredundant subdisks on a failed disk are not relocated, but sys admin is notified of the failure.
6.03 Identify the steps to manage spare disks
•     Create a spare disk for a disk group:
            # vxedit -g diskgroup set spare=on | off disk_media_name
•     Exclude a disk from hot relocation:
            # vxedit -g diskgroup set nohotuse=on | off disk_media_name
•     To force hot relocation to only use spare disks:
            Add spare=only to /etc/default/vxassist
•     To include spare disks in a space check:
            # vxassist -g diskgroup  -r  maxsize | maxgrow  layout=stripe
•     Reserve a set of disks for special purposes (unless specifically mentioned on vxassist make command line):
            # vxedit  set reserve=on | off  disk_name
6.04 Describe how to replace a failed disk
Temporary                             Failure                                                       Intermittent
Status=disabled                                disabled (vxdisk list)                                                   failing or io fail
Solution=turn power back on          disk replacement                                                         disk replacement
# devfsadm –C                                  # devfsadm –C                                                            # vxevac <source> <destination>
# vxdctl enable                                  # vxdctl enable                                                             (copies data off & reassociates objects)
# vxreattach –r                                   # vxdisksetup –i                                                           # vxdg -g <dg>  -k rmdisk  <failing_disk>
                                                              # vxdg -d <dg>  -k adddisk  <disk>=c#t#d#            (keeps object name & in removed state)
                                                              # vxrecover                                                                   # vxevac <source> <destination>
6.05 Return relocated subdisks back to their original disk, given commands
            # vxunreloc [-f]  [-g diskgroup] [-t tasktag] [-n diskname]  orig_diskname
            orig_diskname            disk where relocated subdisks originally resided
            -n diskname    unrelocates to a disk other than the original disk & specify new media name
            -f                      forces unrelocation if exact offsets are not possible

            To display all subdisks that were hot-relocated from a failed disk:
            # vxprint -g diskgroup  -se `sd_orig_dmname=”disk_name”’
6.06 Describe how to recover a volume
•      To reattach disks to disk group (for temporarily failed disks):
# vxreattach [-bcr]  [disk_name]
-b         performs in background
-c         checks to determine if reattachment is possible; no operation is performed
-r          attempts to recover stale plexes by invoking vxrecover
•      To recover specific volumes or all volumes on a disk:
# vxrecover [-bnpsvV] [-g diskgroup]  [volume_name | disk_name]
-b         performs in background
-n         starts volumes but does not perform recovery
-p         displays list of startable volumes
-s         starts disabled volumes
-v         displays info about each task started by vxrecover
-V         even more info
6.07 Describe tasks used to protect the VxVM configuration
•      To save VxVM disk group configuration database:
# vxprint -g diskgroup -hmQqr > backup.diskgroup 
(saves definition of volumes, plexes, subdisks, and diskgroup itself)
# vxprint -g diskgroup -hmvpsQqr > backup.diskgroup
(saves definition of volumes, plexes, and subdisks only)
•      To display entire disk group definition with all its objects:
# vxprint -D  -  -rht < backup.diskgroup
Section 7. Troubleshooting Foundation Suite
7.01 Identify examples of state changes in VxVM objects caused by I/O failure
            If VxVM can still access the private region on disk:
•      Disk marked as FAILING
•      Plex with affected subdisk is set with IOFAIL condition flag
•      Hot relocation relocates the affected subdisk, if enabled and if there is available redundancy
            If VxVM cannot access private region on disk:
•      Failed disk is detached and marked as FAILED
•      Plexes using that disk are changed to NODEVICE state
•      Nonredundant volumes on disk are disabled
•      If hot relocation is enabled, it is performed for redundant volumes
7.02 Explain how to resolve disk failures by using VxVM commands
Temporary                             Permanent Failure                                    Intermittent
Status=disabled                                disabled (vxdisk list)                                                   failing or io fail
Solution=turn power back on          disk replacement                                                         disk replacement
# devfsadm –C                                  # devfsadm –C                                                            # vxevac <source> <destination>
# vxdctl enable                                  # vxdctl enable                                                             (copies data off & reassociates objects)
# vxreattach –r                                   # vxdisksetup –i                                                           # vxdg -g <dg>  -k rmdisk  <failing_disk>
# vxrecover                                         # vxdg -d <dg>  -k adddisk  <disk>=c#t#d#            (keeps object name & in removed state)
                                                              # vxrecover                                                                   # vxevac <source> <destination>
7.03 Choose how to display state information for VxVM objects
            # vxprint -g diskgroup -ht
7.04 Interpret volume states, given appropriate information
Volume states:
EMPTY
CLEAN
ACTIVE
SYNC
NEEDSYNC—internal read thread has not been started
NODEVICE—bad drives
7.05 Interpret kernel states, given appropriate information
Kernel states:
ENABLED—object can transfer both system I/O to private region and user I/O to public region
DETACHED—object can transfer system I/O but not user I/O (maintenance mode)
DISABLED—no I/O can be transferred (offline state for volume or plex)

No comments:

Post a Comment