Sunteți pe pagina 1din 15

VX-CHEAT-SHEET

VX-CHEAT-SHEET Written by Administrator Friday, 03 October 2008 14:09


# # VX-CHEAT-SHEET: Volume manager & FS cheats # # $Id: VX-CHEAT-SHEET,v 1.4 2004/02/13 23:15:30 joomul Exp $ Adding a new disk ----------------vxdisksetup -i <disk_device_address> ex: /etc/vx/bin/vxdisksetup -i c2t1d0 or if enclosure-based naming is in use: /etc/vx/bin/vxdisksetup -i sena1_4 -i: Writes a disk header to the disk, making the disk directly usable (as a new disk in a disk group, for example). Default size of private region = 2048 blocks. Can be changed by: /etc/vx/bin/vxdisksetup -i c2t1d0 privlen=2500k If more than 500 volumes are to be created in a single disk group, the private region for each disk must be set to at least 1 megabyte. This can be accomplished by initializing each disk with the vxdisksetup command, as shown here: # vxdisksetup -i c#t#d# privlen=1m Removing a disk --------------vxdiskunsetup [-C] disk_device_address The vxdiskunsetup command reverses the configuration done by vxdisksetup and makes the specified disks unusable by VxVM. vxdiskunsetup can be applied only to VxVM-initialized disks that are not in use within an imported disk group. Force deconfiguration of a VxVM-initialized disk, c0f4d0: /etc/vx/bin/vxdiskunsetup -C c0t4d0 -C vxdiskunsetup usually does not operate on disks that appear to be imported by some other host (for example, a host that shares access to the disk). In this case, the -C option can be specified to force de-configuration of the disk, effectively removing the host locks that were detected by vxdiskunsetup. Default name for a volume? -------------------------vol01 Default name for a plex? -----------------------volname-## Which minimal pkgs are needed to run vxvm? -----------------------------------------lic & vxvm What is a plex? --------------One complete copy of a volume. Composed of either subdisks or volumes. What command to list installed licenses? ---------------------------------------vrts:vxlicense: INFO: Options are: -c create a license key file -p print license details -u print Host ID -t feature test a license -H print this message What is the default stripe size in an R5 vol? -------------------------------------------16K (raid5_stripeunit=width)

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

What is the command to import, clear and rename a diskgroup? -----------------------------------------------------------vxdg -n <newname> -C import <old dg name> What gives best resiliance: R0+1 or R1+0? ----------------------------------------R1+0: Mirrored at subdisk level and then mirrors striped together to make a volume. In case of a diskfailure, only a small subdisk need to be resynced. What is the command to shrink or grow a volume? ----------------------------------------------vxassist growto <volume> <newlength> vxassist growby <volume> <length> vxassist maxgrow <volume> vxassist shrinkby <volume> <length> vxassist shrinkto <volume> <newlenght> *Note: vxasissit does NOT resize the filesystem on <volume> NAME vxresize - change the length of a volume containing system a file

SYNOPSIS /etc/vx/bin/vxresize [-bfsx] [-F fstype] [-g diskgroup] tasktag] volume new_length [medianame...] see also "fsadm -b <newsize>" for sizing fs's. /etc/vx/bin/vxresize vol01 1g * volume must be mounted for the operation to succeed. What is the command to deport a diskgroup AND to rename it? ----------------------------------------------------------vxdg -n <newname> deport gallia Where to set the default 'trigger point' value for vxassist? -----------------------------------------------------------/etc/default/vxassist

[-t

What is the command to see if vmsa_server is running? ---------------------------------------------vmsa_server - VERITAS VM Storage Administrator Server usage: vmsa_server [-V|-q|-k|-r|-h] Options: -V Prints the version -q Query to check if server is running -k Kill the server processes -r Start server in Read-Only mode -u Print client users connected to the server -h Prints out this help message What is the command to upgrade a dg from version 50 to the latest? -----------------------------------------------------------------vxdg -T 50 upgrade rootdg vxdg list rootdg What is the name of the Unix group for vmsa administrators? ----------------------------------------------------------vrtsadm What to choose in vmsa to create a concat-mirror? ------------------------------------------------vxassist -g rootdg make vol01 10m layout=nostripe What is the command to create a new diskgroup? ---------------------------------------------vxdg init gallia c0t1d0 What is the path to the vmsa logfile? -----------------------------------root@nestorix # ls -l /var/opt/vmsa/logs/ total 6 -rw-r--r-1 root root 104 Oct 24 18:25 access -rw-r--r-1 root root 946 Oct 24 23:34 command -rw-r--r-1 root root 933 Oct 27 10:48 server.log

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

What are the default parameters for stripes? -------------------------------------------[columns and strip size] stripe unit width= 128 blocks = 64KB columns=#disks What is a striped-pro volume? ----------------------------Is a volume that with mirroring at the subdisk level. The resulting columns are striped together to create a volume. Also know as R1+0. What command will scan all scsi busses for vxvm disks? -----------------------------------------------------vxdiskconfig root@nestorix # vxdiskconfig This command may take a few minutes to complete execution Executing Solaris command: drvconfig (part 1 of 4) at 13:44:36 MET Executing Solaris command: disks (part 2 of 4) at 13:44:50 MET Executing Solaris command: devlinks (part 3 of 4) at 13:44:52 MET Executing VxVM command: vxdctl enable (part 4 of 4) at 13:44:54 MET Command completed at 13:44:55 MET root@nestorix # which vxdiskconfig /usr/sbin/vxdiskconfig root@nestorix # file /usr/sbin/vxdiskconfig /usr/sbin/vxdiskconfig: executable /sbin/sh script What command to continously monitor task progress? -------------------------------------------------vxtask monitor 166 What command to set the read policy to "round robin" for a volume? -----------------------------------------------------------------vxvol rdpol round vol01 What command to set the readpolicy to one plex of a volume? ------------------------------------------------------------------vxvol rdpol prefer vol02 vol02-01 volnm plex What command to create a 3-way mirror? -------------------------------------vxassist -o ordered make mirstrvol 10g layout=mirror-stripe \ ncol=3 disk01 disk02 disk03 disk04 disk05 disk06 vxassist make vol01 1m layout=mirror nmirror=3 What command to remove a disk from a dg? ---------------------------------------vxdg -g rootdg rmdisk c0t1d0 What command to change the vxfs fs size? ---------------------------------------fsadm -b 10m /opt/v01 - works even on a mounted fs - increase does not work if fs 100% full ;-( errno 28 ) What are vxfs's possible blocksizes? -----------------------------------1024 - 8192 and be a power of 2 The default is 1024 bytes for all file system sizes. What command to create a vxfs snapshot? --------------------------------------mount -F vxfs -o snapof=/dev/vx/dsk/rootdg/vol01 \ /dev/vx/dsk/rootdg/vol02 \ /mnt What command to simulate the creation of a vxfs?
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

# vol to be snapped. # backing store # mtpt of snap

VX-CHEAT-SHEET

-----------------------------------------------mkfs -F vxfs -oN,... /dev/vx/rdsk/rootdg/vol01 What command to set the logsize for a vxfs? ------------------------- -----------------mkfs -F vxfs -o logsize=n blocks ERROR: logsize must be >= 256 and <= 16384 What command for defragmenting a vxfs? -------------------------------------fsadm -d Reorganizes directories. Directory entries are reordered to place subdirectory entries first, then all other entries in decreasing order of time of last access. The directory is also compacted to remove free space. -e Extent reorganization. Minimizes file system fragmentation. Files are reorganized to have the minimum number of extents. What command to report about vxfs fragmentation? -----------------------------------------------fsadm -E Reports on extent fragmentation. If specified with the -e option, the fragmentation report is produced both before and after the extent reorganization. -D Reports on directory fragmentation. If specified in with the -d option, the fragmentation report is produced both before and after the directory reorganization. What is the default size of the intent log for vxfs? ---------------------------------------------------16384 blocks = 8KB In a dg with 10 disks; how many config. copies are there at min.? ----------------------------------------------------------------10. From the vxdg manpage; With the default policy, at least one configuration and log copy is maintained for each enclosure. It is ensured that at least one configuration and log copy is maintained for each host controller connected to an enclosure. If this does not result in allocating at least 4 copies, then additional copies are spread uniformly across enclosures. From adminguide, p. 287; The default policy for configuration copies in the disk group is to allocate a configuration copy for each controller identified in the disk group, or for each target that contains multiple addressable disks. Looks like "4 copies" per DG is the minimum. What types of resyncing exist for vxvm? ---------------------------------------[atomic-blah] What command to print a re-usable configuration? -----------------------------------------------vxprint -mpvshr -g diskgroup_name What command for 'undoing' hot relocation? -----------------------------------------NAME vxunreloc - move a hot-relocated subdisk back to its nal disk SYNOPSIS /etc/vx/bin/vxunreloc [-f] [-g diskgroup] [-n tasktag] dm_name

origi-

dm_name]

[-t

DESCRIPTION The VERITAS Volume Manager (VxVM) hot-relocation feature can detect an I/O failure in a subdisk, relocate the subdisk, and recover the plex associated with the subdisk. vxunreloc lets you reverse the process and move the hot-relocated subdisks back onto a disk that was replaced after a disk failure. Volume layout before the failed disk
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

v pl sd pl sd

jvol jvol-01 disk01-01 jvol-02 disk02-01

jvol jvol-01 jvol jvol-02

ENABLED ACTIVE ENABLED ACTIVE disk01 0 ENABLED ACTIVE disk02 0

409600 409600 409600 411255 411255

fsgen CONCAT 0 CONCAT 0

c0t4d0 c1t3d0

SELECT RW ENA RW ENA

Volume layout v pl sd pl sd jvol jvol-01 disk01-01 jvol-02 disk03-01

after the hot-relocation operation jvol jvol-01 jvol jvol-02 ENABLED ACTIVE ENABLED ACTIVE disk01 0 ENABLED STALE disk03 0 409600 409600 409600 411255 411255 fsgen CONCAT 0 CONCAT 0 c0t4d0 c1t4d0 SELECT RW ENA WO ENA

Volume layout

after the command vxunreloc -g datadg disk02 fsgen CONCAT 0 CONCAT 0 c0t4d0 c1t3d0 SELECT RW ENA RW ENA

v jvol ENABLED ACTIVE 409600 pl jvol-01 jvol ENABLED ACTIVE 409600 sd disk01-01 jvol-01 disk01 0 409600 pl jvol-02 jvol ENABLED ACTIVE 411255 sd disk02-UR-001 jvol-02 disk02 0 411255 Note the unrelocated subdisk "disk02-UR-001"

What vxvm kernel states degrade performance? -----------------------------------------------[ENABLED, DETACHED, FAILED] What is the result of mounting a snapshotfs? ------------------------------------------[data first written to snapshot, then to volume] - Orginal data is first read off the volume. - Data is written to the snapshot (only once) - Data is written to the volume. Question should be: What happens with a write to a snapshotted FS? What command to add a disk to a dg and name it 'rootmir'? -------------------------------------------------------vxdg -g rootdg adddisk rootmir=c0t1d0 What command to add a mirror ? -----------------------------vxassist mirror bigvol Caution: Do not use vxassist to mirror an encapsulated root disk. Instead use menu item 6 (Mirror Volumes on a Disk) in the vxdiskadm command. What command to make a 10G striped volume ----------------------------------------vxassist -g rootdg make vol01 10g layout=stripe ncol=2 stripeunit=128K rootdisk rootmir delete a volume? ---------------vxedit -rf rm vol01 vxassist remove volume vol01 Stopped volume in vxprint? -------------------------v vol01 fsgen pl vol01-01 vol01 sd rootmir-01 vol01-01 sd rootdisk-03 vol01-01 i.e. DISABLED. What command to remove a plex from a mirror? -------------------------------------------vxplex dis vol01-02 vxedit -rf rm vol01-02 - dis-associates plex "vol01-02" with the vol01 volume. - removes plex "vol01-02" and associated subdisk. OR vxassist remove mirror <volname> What command to grow a volume + fs? ----------------------------------vxresize
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

DISABLED DISABLED ENABLED ENABLED

20971520 20978399 10489311 10485800

0 0

CLEAN CLEAN -

VX-CHEAT-SHEET

What command to create a concat volume with logging --------------------------------------------------vxassist -g rootdg make vol01 10m layout=nostripe,log nmirror=2 \ alloc="rootdisk rootmir" What command to remove a dg (including all disks in it)? -------------------------------------------------------1. remove all disk from the dg. The last one cannot be removed. 2. vxdg destroy test What command to list the stripe unit width for a striped volume? --------------------------------------------------------------vxprint -ht <volname> lists: v vol01 ENABLED ACTIVE 2097152 SELECT pl vol01-01 vol01 ENABLED ACTIVE 2104323 STRIPE .... Two columns. Width = 128 blocks = 64KB. What command to create a striped volume with a unitwidth of 128k? ----------------------------------------------------------------vxassist make vol01 2g layout=stripe stripeunit=128k How to delete a snapshot? ------------------------Snapshot is deleted when the snapshot volume is unmounted.

vol01-01 fsgen 2/128 RW ^^^^^

================================================================================ disklayouts ================================================================================ concat -----A concatenated volume is made up of one or more disk regions that are linked together (concatenated) in a linear fashion. A concatenated volume can consist of disk regions on multiple disks; a concatenated volume that extends across two or more disks is also known as a spanned volume. Note that the data in this type of volume cannot be recovered if the underlying disk fails. However, a concatenated volume can be mirrored (copied) onto another disks to protect its data against disk failure. stripe -----Striped volume data is interleaved (striped) across two or more physical disks. Striped volume data is spread across the disks alternately and evenly in small, equal-sized portions of data called "stripe units". Striping improves performance. Note that the data in this type of volume cannot be recovered if one of the underlying disks fails. However, a striped volume can be mirrored (copied) onto another disks to protect its data against disk failure. mirror -----Volumes with concatenated or striped layouts can be mirrored to increase data availability. All of the data in a mirrored volume is duplicated on at least one other physical disk. If one of the disks fails, the data can still be accessed from one of the remaining disks. The plexes in a mirrored volume typically have the same layout, but a volume can consist of plexes with different layouts. A mirrored volume has a A mirrored volume has a "mixed" layout if the plexes in the volume have different layouts. layered ------A layered volume is built on one or more other volumes. The underlying volumes are typically mirrored. In layered volumes, mirroring is done at a lower level and with smaller granularity than with non-layered volumes, so each mirror covers a relatively small storage region. Layered volumes tolerate disk failure better than non-layered volumes and provide improved data redundancy. If a disk in a layered volume fails, only a portion of the redundancy is lost and recovery time is usually quicker than it would be for a non-layered volume. Layered volumes also reduce the chance that two disk failures will result in lost data. The underlying volumes in a layered volume are used exclusively by VxVM and are not intended for user manipulation.

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

You can create the following types of LAYERED volumes: - Concatenated Pro Volume A concatenated pro volume is a layered volume that concatenates several underlying mirror volumes. vxassist cmd = concat-mirror | c | c | c | c |\ m m m m m - vol01 | | | | |/ - Striped Pro Volume A striped pro volume is a layered volume that stripes several underlying mirror volumes. vxassist cmd = stripe-mirror | s | s | s | s |\ m m m m m - vol01 | | | | |/ The vxassist cmd's like mirror-stripe or mirror-stripe should be interpreted as "mirror OF stripe" (I.e, first stripe than mirror, i.e., raid 0+1). mirror-stripe ------------Specifies that new volumes should be mirrored and striped. The mirroring is done at the volume level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. mirror-concat ------------Specifies that new volumes should be mirrored. The mirroring is done at the volume level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. raid5 ----RAID-5 volume data is interleaved (striped) across three or more physical disks. Within each stripe across the set of disks, the data on one of the disks is parity data. If one of the physical disks fails, the parity data can be used to reconstruct and recover the lost data. Note that RAID-5 volumes cannot be mirrored. stripe-mirror-col ----------------Specifies that new volumes should be striped and mirrored. The mirroring is handled at each column level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. stripe-mirror-sd ---------------Specifies that new volumes should be striped and mirrored. The mirroring is handled at each subdisk level. ** Note that there are no simple "mirror" or "stripe" specifiers, however, the Help below DOES show "mirror" and "stripe" layouts ** root@nestorix # vxassist help layout vxassist [ options ] [ -b ] make volume length [ attribute...]

Layout attributes for vxassist: Usage: vxassist keyword operands ... layout=layout-attr[,attr[,...]] stripe,nostripe mirror,nomirror,raid5 stripe-mirror stripe-mirror-sd mirror-stripe concat-mirror mirror-concat contig,nocontig span,nospan diskalign,nodiskalign log,nolog Create a striped or non-stripe volume. Create a mirrored, unmirrored, or RAID-5 volume. Create a striped and mirrored volume. Create a striped and mirrored volume. Create a mirrored and striped volume. Create a concatenated and mirrored volume. Create a mirrored and concatenated volume. Require that allocations be (not be) contiguous. Allow (disallow) allocations from spanning disks. Align (don't align) on disk tracks and cylinders. Create (don't create) DRL, DCM, or RAID-5 log.

vxassist [ options ] [ -b ] mirror volume [ attribute...] Mirroring attributes for vxassist: Usage: vxassist keyword operands ... mirror=mirror-attr[,attr[,...]] or: vxassist keyword operands ... wantmirror=mirror-attr[,attr[,...]]

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

<number> ctlr target tray

Create Mirror Mirror Mirror

<number> mirrors for a volume (default: 2). between controllers. between SCSI targets. between separately removable disk trays. The

NOTE: wantmirror indicates desired, but not required, attributes. wantmirror attribute does not take a number.

What is an "accessname" and what is a "diskname"? ------------------------------------------------accessname = system-specific names that relate to disk addresses = c#t#d#s# medianame = logical name assigned by vm, eg "rootdisk", "swapvol". vxdisk can only access "accessnames" What can be converted with the "vxassist c# # VX-CHEAT-SHEET: Volume manager & FS cheats # # $Id: VX-CHEAT-SHEET,v 1.4 2004/02/13 23:15:30 joomul Exp $ Adding a new disk ----------------vxdisksetup -i <disk_device_address> ex: /etc/vx/bin/vxdisksetup -i c2t1d0 or if enclosure-based naming is in use: /etc/vx/bin/vxdisksetup -i sena1_4 -i: Writes a disk header to the disk, making the disk directly usable (as a new disk in a disk group, for example). Default size of private region = 2048 blocks. Can be changed by: /etc/vx/bin/vxdisksetup -i c2t1d0 privlen=2500k If more than 500 volumes are to be created in a single disk group, the private region for each disk must be set to at least 1 megabyte. This can be accomplished by initializing each disk with the vxdisksetup command, as shown here: # vxdisksetup -i c#t#d# privlen=1m Removing a disk --------------vxdiskunsetup [-C] disk_device_address The vxdiskunsetup command reverses the configuration done by vxdisksetup and makes the specified disks unusable by VxVM. vxdiskunsetup can be applied only to VxVM-initialized disks that are not in use within an imported disk group. Force deconfiguration of a VxVM-initialized disk, c0f4d0: /etc/vx/bin/vxdiskunsetup -C c0t4d0 -C vxdiskunsetup usually does not operate on disks that appear to be imported by some other host (for example, a host that shares access to the disk). In this case, the -C option can be specified to force de-configuration of the disk, effectively removing the host locks that were detected by vxdiskunsetup. Default name for a volume? -------------------------vol01 Default name for a plex? -----------------------volname-## Which minimal pkgs are needed to run vxvm? -----------------------------------------lic & vxvm What is a plex? --------------One complete copy of a volume. Composed of either subdisks or volumes. What command to list installed licenses? ---------------------------------------vrts:vxlicense: INFO: Options are: -c create a license key file -p print license details -u print Host ID
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

-t feature -H

test a license print this message

What is the default stripe size in an R5 vol? -------------------------------------------16K (raid5_stripeunit=width) What is the command to import, clear and rename a diskgroup? -----------------------------------------------------------vxdg -n <newname> -C import <old dg name> What gives best resiliance: R0+1 or R1+0? ----------------------------------------R1+0: Mirrored at subdisk level and then mirrors striped together to make a volume. In case of a diskfailure, only a small subdisk need to be resynced. What is the command to shrink or grow a volume? ----------------------------------------------vxassist growto <volume> <newlength> vxassist growby <volume> <length> vxassist maxgrow <volume> vxassist shrinkby <volume> <length> vxassist shrinkto <volume> <newlenght> *Note: vxasissit does NOT resize the filesystem on <volume> NAME vxresize - change the length of a volume containing system a file

SYNOPSIS /etc/vx/bin/vxresize [-bfsx] [-F fstype] [-g diskgroup] tasktag] volume new_length [medianame...] see also "fsadm -b <newsize>" for sizing fs's. /etc/vx/bin/vxresize vol01 1g * volume must be mounted for the operation to succeed. What is the command to deport a diskgroup AND to rename it? ----------------------------------------------------------vxdg -n <newname> deport gallia Where to set the default 'trigger point' value for vxassist? -----------------------------------------------------------/etc/default/vxassist

[-t

What is the command to see if vmsa_server is running? ---------------------------------------------vmsa_server - VERITAS VM Storage Administrator Server usage: vmsa_server [-V|-q|-k|-r|-h] Options: -V Prints the version -q Query to check if server is running -k Kill the server processes -r Start server in Read-Only mode -u Print client users connected to the server -h Prints out this help message What is the command to upgrade a dg from version 50 to the latest? -----------------------------------------------------------------vxdg -T 50 upgrade rootdg vxdg list rootdg What is the name of the Unix group for vmsa administrators? ----------------------------------------------------------vrtsadm What to choose in vmsa to create a concat-mirror? ------------------------------------------------vxassist -g rootdg make vol01 10m layout=nostripe What is the command to create a new diskgroup? ---------------------------------------------vxdg init gallia c0t1d0 What is the path to the vmsa logfile?
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

-----------------------------------root@nestorix # ls -l /var/opt/vmsa/logs/ total 6 -rw-r--r-1 root root 104 Oct 24 18:25 access -rw-r--r-1 root root 946 Oct 24 23:34 command -rw-r--r-1 root root 933 Oct 27 10:48 server.log What are the default parameters for stripes? -------------------------------------------[columns and strip size] stripe unit width= 128 blocks = 64KB columns=#disks What is a striped-pro volume? ----------------------------Is a volume that with mirroring at the subdisk level. The resulting columns are striped together to create a volume. Also know as R1+0. What command will scan all scsi busses for vxvm disks? -----------------------------------------------------vxdiskconfig root@nestorix # vxdiskconfig This command may take a few minutes to complete execution Executing Solaris command: drvconfig (part 1 of 4) at 13:44:36 MET Executing Solaris command: disks (part 2 of 4) at 13:44:50 MET Executing Solaris command: devlinks (part 3 of 4) at 13:44:52 MET Executing VxVM command: vxdctl enable (part 4 of 4) at 13:44:54 MET Command completed at 13:44:55 MET root@nestorix # which vxdiskconfig /usr/sbin/vxdiskconfig root@nestorix # file /usr/sbin/vxdiskconfig /usr/sbin/vxdiskconfig: executable /sbin/sh script What command to continously monitor task progress? -------------------------------------------------vxtask monitor 166 What command to set the read policy to "round robin" for a volume? -----------------------------------------------------------------vxvol rdpol round vol01 What command to set the readpolicy to one plex of a volume? ------------------------------------------------------------------vxvol rdpol prefer vol02 vol02-01 volnm plex What command to create a 3-way mirror? -------------------------------------vxassist -o ordered make mirstrvol 10g layout=mirror-stripe \ ncol=3 disk01 disk02 disk03 disk04 disk05 disk06 vxassist make vol01 1m layout=mirror nmirror=3 What command to remove a disk from a dg? ---------------------------------------vxdg -g rootdg rmdisk c0t1d0 What command to change the vxfs fs size? ---------------------------------------fsadm -b 10m /opt/v01 - works even on a mounted fs - increase does not work if fs 100% full ;-( errno 28 ) What are vxfs's possible blocksizes? -----------------------------------1024 - 8192 and be a power of 2 The default is 1024 bytes for all file system sizes. What command to create a vxfs snapshot?
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

--------------------------------------mount -F vxfs -o snapof=/dev/vx/dsk/rootdg/vol01 \ /dev/vx/dsk/rootdg/vol02 \ /mnt What command to simulate the creation of a vxfs? -----------------------------------------------mkfs -F vxfs -oN,... /dev/vx/rdsk/rootdg/vol01 What command to set the logsize for a vxfs? ------------------------- -----------------mkfs -F vxfs -o logsize=n blocks ERROR: logsize must be >= 256 and <= 16384

# vol to be snapped. # backing store # mtpt of snap

What command for defragmenting a vxfs? -------------------------------------fsadm -d Reorganizes directories. Directory entries are reordered to place subdirectory entries first, then all other entries in decreasing order of time of last access. The directory is also compacted to remove free space. -e Extent reorganization. Minimizes file system fragmentation. Files are reorganized to have the minimum number of extents. What command to report about vxfs fragmentation? -----------------------------------------------fsadm -E Reports on extent fragmentation. If specified with the -e option, the fragmentation report is produced both before and after the extent reorganization. -D Reports on directory fragmentation. If specified in with the -d option, the fragmentation report is produced both before and after the directory reorganization. What is the default size of the intent log for vxfs? ---------------------------------------------------16384 blocks = 8KB In a dg with 10 disks; how many config. copies are there at min.? ----------------------------------------------------------------10. From the vxdg manpage; With the default policy, at least one configuration and log copy is maintained for each enclosure. It is ensured that at least one configuration and log copy is maintained for each host controller connected to an enclosure. If this does not result in allocating at least 4 copies, then additional copies are spread uniformly across enclosures. From adminguide, p. 287; The default policy for configuration copies in the disk group is to allocate a configuration copy for each controller identified in the disk group, or for each target that contains multiple addressable disks. Looks like "4 copies" per DG is the minimum. What types of resyncing exist for vxvm? ---------------------------------------[atomic-blah] What command to print a re-usable configuration? -----------------------------------------------vxprint -mpvshr -g diskgroup_name What command for 'undoing' hot relocation? -----------------------------------------NAME vxunreloc - move a hot-relocated subdisk back to its nal disk SYNOPSIS /etc/vx/bin/vxunreloc [-f] [-g diskgroup] [-n tasktag] dm_name DESCRIPTION
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

origi-

dm_name]

[-t

VX-CHEAT-SHEET

The VERITAS Volume Manager (VxVM) hot-relocation feature can detect an I/O failure in a subdisk, relocate the subdisk, and recover the plex associated with the subdisk. vxunreloc lets you reverse the process and move the hot-relocated subdisks back onto a disk that was replaced after a disk failure. Volume layout before the failed disk v jvol ENABLED ACTIVE 409600 fsgen pl jvol-01 jvol ENABLED ACTIVE 409600 CONCAT sd disk01-01 jvol-01 disk01 0 409600 0 c0t4d0 pl jvol-02 jvol ENABLED ACTIVE 411255 CONCAT sd disk02-01 jvol-02 disk02 0 411255 0 c1t3d0 Volume layout v pl sd pl sd jvol jvol-01 disk01-01 jvol-02 disk03-01 after the hot-relocation operation jvol jvol-01 jvol jvol-02 ENABLED ACTIVE ENABLED ACTIVE disk01 0 ENABLED STALE disk03 0 409600 409600 409600 411255 411255 fsgen CONCAT 0 CONCAT 0 c0t4d0 c1t4d0

SELECT RW ENA RW ENA

SELECT RW ENA WO ENA

Volume layout

after the command vxunreloc -g datadg disk02 fsgen CONCAT 0 CONCAT 0 c0t4d0 c1t3d0 SELECT RW ENA RW ENA

v jvol ENABLED ACTIVE 409600 pl jvol-01 jvol ENABLED ACTIVE 409600 sd disk01-01 jvol-01 disk01 0 409600 pl jvol-02 jvol ENABLED ACTIVE 411255 sd disk02-UR-001 jvol-02 disk02 0 411255 Note the unrelocated subdisk "disk02-UR-001"

What vxvm kernel states degrade performance? -----------------------------------------------[ENABLED, DETACHED, FAILED] What is the result of mounting a snapshotfs? ------------------------------------------[data first written to snapshot, then to volume] - Orginal data is first read off the volume. - Data is written to the snapshot (only once) - Data is written to the volume. Question should be: What happens with a write to a snapshotted FS? What command to add a disk to a dg and name it 'rootmir'? -------------------------------------------------------vxdg -g rootdg adddisk rootmir=c0t1d0 What command to add a mirror ? -----------------------------vxassist mirror bigvol Caution: Do not use vxassist to mirror an encapsulated root disk. Instead use menu item 6 (Mirror Volumes on a Disk) in the vxdiskadm command. What command to make a 10G striped volume ----------------------------------------vxassist -g rootdg make vol01 10g layout=stripe ncol=2 stripeunit=128K rootdisk rootmir delete a volume? ---------------vxedit -rf rm vol01 vxassist remove volume vol01 Stopped volume in vxprint? -------------------------v vol01 fsgen pl vol01-01 vol01 sd rootmir-01 vol01-01 sd rootdisk-03 vol01-01 i.e. DISABLED. What command to remove a plex from a mirror? -------------------------------------------vxplex dis vol01-02 vxedit -rf rm vol01-02 - dis-associates plex "vol01-02" with the vol01 volume. - removes plex "vol01-02" and associated subdisk.
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

DISABLED DISABLED ENABLED ENABLED

20971520 20978399 10489311 10485800

0 0

CLEAN CLEAN -

VX-CHEAT-SHEET

OR vxassist remove mirror <volname> What command to grow a volume + fs? ----------------------------------vxresize What command to create a concat volume with logging --------------------------------------------------vxassist -g rootdg make vol01 10m layout=nostripe,log nmirror=2 \ alloc="rootdisk rootmir" What command to remove a dg (including all disks in it)? -------------------------------------------------------1. remove all disk from the dg. The last one cannot be removed. 2. vxdg destroy test What command to list the stripe unit width for a striped volume? --------------------------------------------------------------vxprint -ht <volname> lists: v vol01 ENABLED ACTIVE 2097152 SELECT pl vol01-01 vol01 ENABLED ACTIVE 2104323 STRIPE .... Two columns. Width = 128 blocks = 64KB. What command to create a striped volume with a unitwidth of 128k? ----------------------------------------------------------------vxassist make vol01 2g layout=stripe stripeunit=128k How to delete a snapshot? ------------------------Snapshot is deleted when the snapshot volume is unmounted.

vol01-01 fsgen 2/128 RW ^^^^^

================================================================================ disklayouts ================================================================================ concat -----A concatenated volume is made up of one or more disk regions that are linked together (concatenated) in a linear fashion. A concatenated volume can consist of disk regions on multiple disks; a concatenated volume that extends across two or more disks is also known as a spanned volume. Note that the data in this type of volume cannot be recovered if the underlying disk fails. However, a concatenated volume can be mirrored (copied) onto another disks to protect its data against disk failure. stripe -----Striped volume data is interleaved (striped) across two or more physical disks. Striped volume data is spread across the disks alternately and evenly in small, equal-sized portions of data called "stripe units". Striping improves performance. Note that the data in this type of volume cannot be recovered if one of the underlying disks fails. However, a striped volume can be mirrored (copied) onto another disks to protect its data against disk failure. mirror -----Volumes with concatenated or striped layouts can be mirrored to increase data availability. All of the data in a mirrored volume is duplicated on at least one other physical disk. If one of the disks fails, the data can still be accessed from one of the remaining disks. The plexes in a mirrored volume typically have the same layout, but a volume can consist of plexes with different layouts. A mirrored volume has a A mirrored volume has a "mixed" layout if the plexes in the volume have different layouts. layered ------A layered volume is built on one or more other volumes. The underlying volumes are typically mirrored. In layered volumes, mirroring is done at a lower level and with smaller granularity than with non-layered volumes, so each mirror covers a relatively small storage region. Layered volumes tolerate disk failure better than non-layered volumes and provide improved data redundancy. If a disk in a layered volume fails, only a
http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

portion of the redundancy is lost and recovery time is usually quicker than it would be for a non-layered volume. Layered volumes also reduce the chance that two disk failures will result in lost data. The underlying volumes in a layered volume are used exclusively by VxVM and are not intended for user manipulation. You can create the following types of LAYERED volumes: - Concatenated Pro Volume A concatenated pro volume is a layered volume that concatenates several underlying mirror volumes. vxassist cmd = concat-mirror | c | c | c | c |\ m m m m m - vol01 | | | | |/ - Striped Pro Volume A striped pro volume is a layered volume that stripes several underlying mirror volumes. vxassist cmd = stripe-mirror | s | s | s | s |\ m m m m m - vol01 | | | | |/ The vxassist cmd's like mirror-stripe or mirror-stripe should be interpreted as "mirror OF stripe" (I.e, first stripe than mirror, i.e., raid 0+1). mirror-stripe ------------Specifies that new volumes should be mirrored and striped. The mirroring is done at the volume level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. mirror-concat ------------Specifies that new volumes should be mirrored. The mirroring is done at the volume level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. raid5 ----RAID-5 volume data is interleaved (striped) across three or more physical disks. Within each stripe across the set of disks, the data on one of the disks is parity data. If one of the physical disks fails, the parity data can be used to reconstruct and recover the lost data. Note that RAID-5 volumes cannot be mirrored. stripe-mirror-col ----------------Specifies that new volumes should be striped and mirrored. The mirroring is handled at each column level. The attributes stripe-mirror-col-trigger-pt and stripe-mirror-col-split-trigger-pt are ignored with this layout. stripe-mirror-sd ---------------Specifies that new volumes should be striped and mirrored. The mirroring is handled at each subdisk level. ** Note that there are no simple "mirror" or "stripe" specifiers, however, the Help below DOES show "mirror" and "stripe" layouts ** root@nestorix # vxassist help layout vxassist [ options ] [ -b ] make volume length [ attribute...]

Layout attributes for vxassist: Usage: vxassist keyword operands ... layout=layout-attr[,attr[,...]] stripe,nostripe mirror,nomirror,raid5 stripe-mirror stripe-mirror-sd mirror-stripe concat-mirror mirror-concat contig,nocontig span,nospan diskalign,nodiskalign Create a striped or non-stripe volume. Create a mirrored, unmirrored, or RAID-5 volume. Create a striped and mirrored volume. Create a striped and mirrored volume. Create a mirrored and striped volume. Create a concatenated and mirrored volume. Create a mirrored and concatenated volume. Require that allocations be (not be) contiguous. Allow (disallow) allocations from spanning disks. Align (don't align) on disk tracks and cylinders.

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

VX-CHEAT-SHEET

log,nolog

Create (don't create) DRL, DCM, or RAID-5 log.

vxassist [ options ] [ -b ] mirror volume [ attribute...] Mirroring attributes for vxassist: Usage: vxassist keyword operands ... mirror=mirror-attr[,attr[,...]] or: vxassist keyword operands ... wantmirror=mirror-attr[,attr[,...]] <number> ctlr target tray Create Mirror Mirror Mirror <number> mirrors for a volume (default: 2). between controllers. between SCSI targets. between separately removable disk trays. The

NOTE: wantmirror indicates desired, but not required, attributes. wantmirror attribute does not take a number.

What is an "accessname" and what is a "diskname"? ------------------------------------------------accessname = system-specific names that relate to disk addresses = c#t#d#s# medianame = logical name assigned by vm, eg "rootdisk", "swapvol". vxdisk can only access "accessnames" What can be converted with the "vxassist convert" command? ---------------------------------------------------------mirror-stripe <-> stripe-mirror mirror-concat <-> concat-mirror I.e., "convert" is to change to- and from layered volumes. Example commands ---------------config is two enclosures with six disks each. Created is a RAID 1+0 (layered) volume named 'nsr'. First, get the maxsize: vxassist -g datadg maxsize layout=stripe-mirror mirror=ctrl ncol=5 \ nsr01 nsr02 nsr03 nsr04 nsr05 nsr06 nsr07 nsr08 nsr09 nsr10 Maximum volume size: 355604480 (173635Mb) vxassist -b -g datadg make nsr 355604480 layout=stripe-mirror \ mirror=ctrl ncol=5 \ nsr01 nsr02 nsr03 nsr04 nsr05 nsr06 nsr07 nsr08 nsr09 nsr10 result: nsr01 -m - nsr06, nsr02 -m- nsr07 .... | -s| How to make sure that all disks in a dg have a config copy? ----------------------------------------------------------vxedit -g rootdg set nconfig=all rootdg vxedit -g datadg set nconfig=all datadg onvert" command? ---------------------------------------------------------mirror-stripe <-> stripe-mirror mirror-concat <-> concat-mirror I.e., "convert" is to change to- and from layered volumes. Example commands ---------------config is two enclosures with six disks each. Created is a RAID 1+0 (layered) volume named 'nsr'. First, get the maxsize: vxassist -g datadg maxsize layout=stripe-mirror mirror=ctrl ncol=5 \ nsr01 nsr02 nsr03 nsr04 nsr05 nsr06 nsr07 nsr08 nsr09 nsr10 Maximum volume size: 355604480 (173635Mb) vxassist -b -g datadg make nsr 355604480 layout=stripe-mirror \ mirror=ctrl ncol=5 \ nsr01 nsr02 nsr03 nsr04 nsr05 nsr06 nsr07 nsr08 nsr09 nsr10 result: nsr01 -m - nsr06, nsr02 -m- nsr07 .... | -s| How to make sure that all disks in a dg have a config copy? ----------------------------------------------------------vxedit -g rootdg set nconfig=all rootdg vxedit -g datadg set nconfig=all datadg

http://www.darklab.net/resources/veritas/vx-cheat-sheet.htm[21-Jul-10 3:59:20 PM]

S-ar putea să vă placă și