VERITAS Commands : Quick Refference

Veritas Command Reference

Interactive front end to the vxdisk program
vxdisk rm disk99
command to remove a grayed out or obsolete disk, or remove a disk from a disk group. In this example disk99
vxdisk list
List all disks under volume manager control and give there status.
vxdisk clearimport c?t?d?s?
Allow a disk to be imported after a server crash.
vxdisk rm c?t?d?
remove a disk so that it is no longer under volume manager control
vxdiskadd c?t?d?
vxdisksetup -i c?t?d?
add or bring a disk under volume manager control
It might help to newfs the s2 slice of the disk and perform a vxdctl enable to get it to add a disk

vxassist make neville 100m
make a volume called neville of size 100m using any available disk
vxassist make neville 100m disk99
make a volume called neville to be 100m big using the disk disk99.
vxassist mirror neville disk99 disk88
Uses the disks disk99 and disk88 to make a mirror on the volume called neville
vxassist mirror neville 50m layout=mirror
make a 50 mb mirror called neville using any two free disks
vxassist make neville 50m layout=mirror disk99 disk88
make a 50mb mirror using the two disks disk99 and disk88
xvassist make neville 50m layout=mirror,stripe,log disk99 disk88 disk77 disk66
make a 50mb stripe disk using disks disk99 and disk88 and mirror this on a stripped mirror using disk77 and disk66 and use a log subdisk
vxassist make neville 100m layout=raid5
make a 100mb raid5 volume called neville on any free disk
vxassist -g rootdg mirror vol99 vol88
In the disk group rootdg mirror volume vol99 to vol88
vxassist mirror neville
mirrior the disk neville on any free disk
vxassist naxsize layout=stripe
This shows the largest stripe you can have on the system i.e.
Maximum volume size: 18952192 (9254Mb)
vxassist naxsize layout=raid5
This shows the largest raid5 partition you can have on the system
Maximum volume size: 18952192 (9254Mb)
vxassist growto neville 2000
grow the size of the volume neville to 2000 512byte sectors
vxassist growby neville 2000
grow the size of the volume neville by 2000 512byte sectors
vxassist shrinkto neville 2000
shrink the volume neville to 2000 512byte sectors
vxassist shrinkby neville 2000
shrink the volume neville by 2000 512byte sectors
vxassist move neville !disk99
move the volume neville to any ouhter disk except disk99
vxassist maxgrow volume-name
shows how much the volume can be grown by i.e.
Volume volume-name can be extended by 9476096 to: 12549992 (6127Mb+1896 sectors
vxassist addlog volume-name
create a log disk for a raid5 or mirror of the volume volume-name

vxtrace volume-name
traces all the I/O on the selected volume

vxstat -d
report disk statistics

vxedit -g rootdg rename disk99 disk88
rename the disk disk99 to be called disk88 in the group rootdg
vxedit -g homedg set spare=on disk99
set disk99 in the group homedg to ba a hot spare
vxedit set user=red group=green mode=0666 neville
sets the user to red, the group to green and the mode rw-rw-rw on the volume neville
vxedit -rf rm neville
remove a volume called neville and any plex(es) and subdisks
vxedit set comment"testing" subdisk01-01
set the comment field of sunbisk subdisk01-01 to testing

vxmirror rootdisk disk99
mirror all the volumes on the disk rootdisk to the disk disk99

vxdg -g homedg rmdisk disk99
from the disk group homedg remove the disk disk99
vxdg -g homedg adddisk disk99=c0t0d0
in the disk group homedg add the physical disk c0t0d0 calling it disk99
xvdg free
display free space on the disks
vxsd aslog disk-name volume-name
add a log disk disk-name to the volume volume-name

vxsd mv subdisk-99 sundisk-88
move the contents of subdisk-99 to subdisk-88 then move subdisk-88 to the plex where subdisk-99 was. this leaves subdisk-99 free for whatever.
vxsd join subdisk-88 subdisk-77 subdisk-99
joins subdisk-88 and subdisk-77 to create the new bigger subdisk-99

vxvol rdpol prefer volume-name plex-name
set a prefered plex to read from
vxvol rdpol round neville
sets a round robin read policy on the volume neville
vxvol -g disk-group volume-name
will stop the volume volume-mane in the group disk-group
vxvol maint neville
puts the volume neville into maintainance mode

vxplex att neville plex-01
attaches the plex plex-01 to the volume neville

vxmend off plex-name
sets the plex plex-name offline
vxmend on plex-name
sets the plex plex-name on
vxmend fix clean plex-name
sets the plex to a clean state so thet you can start the volume and aceess data

ssaadm display -p c?
show disk iops
ssaadm -t 1|2|3 stop|start controller
stop or start the controller controller. this effectivly stops whole disk trays.

vxrecover -s volume-name
will start recovery on the volume volume-name
vxrecover -s
will start recovery on all volumes
vxrecover -b volume
this will bring the plexes bacl online. the -b means background mode

vxinfo volume-name
usefull info about the volume. usefull if it wont come up.

vxmake plex plex-name sd=sub-disk-name
make a plex called plex-name using the subdisk sub-disk-name
vxmake sd sub-disk-name disk-name,0,10000
this will make a subdisk called sub-disk-name at the beginning of the disk disk-name of size 10000 blocks.
if you wanted to put another sub-disk on this disk then you would have an offset of the size of the previous sub-disk ie 10000 e.g.
vxmake sd sub-disk-name2 disk-name,10000,20000

vxdctl mode / enable / disable
When doing any disk configurations check that the vxconfigd daemon is in the enabled mode. to check this use the command vxdctl mode if it is not enabled enable it.
This is the daemon that allows for extended I/O calls without blocking calling processes.
As this is a kernel thread you cannot see it with ps hense you have to use the vxiod command to see if it is running.
use the command vxiod set X to set the number of threads where X is the desired number (usually 10)
This is the main deamon and needs to be running all the time. It is started at boot time.

vxprint -ht
You will get a display about the volumes something
like :-
Disk group: rootdg
dg rootdg       default      default  0        902269639.1025.taupo
dm disk02       c0t1d0s2     sliced   3590     17678493 -
dm rootdisk01   c3t5d0s2     sliced   3590     17678493 -
v  rootvol      root         ENABLED  ACTIVE   1027026  ROUND     -
pl rootvol-01   rootvol      ENABLED  ACTIVE   1027026  CONCAT    -        RW
sd disk02-01    rootvol-01   disk02   0        1027026  0         c0t1d0s2 ENA
pl rootvol-02   rootvol      ENABLED  ACTIVE   1027026  CONCAT    -        RW
sd rootdisk01-01 rootvol-02  rootdisk01 0      1027026  0         c3t5d0   ENA
v  swapvol      swap         ENABLED  ACTIVE   2050461  ROUND     -
pl swapvol-01   swapvol      ENABLED  ACTIVE   2050461  CONCAT    -        RW
sd disk02-02    swapvol-01   disk02   1027026  2050461  0         c0t1d0s2 ENA
pl swapvol-02   swapvol      ENABLED  ACTIVE   2050461  CONCAT    -        RW
sd rootdisk01-02 swapvol-02  rootdisk01 1027026 2050461 0         c3t5d0   ENA
v  usr          fsgen        ENABLED  ACTIVE   2050461  ROUND     -
pl usr-01       usr          ENABLED  ACTIVE   2050461  CONCAT    -        RW
sd disk02-03    usr-01       disk02   3077487  2050461  0         c0t1d0s2 ENA
pl usr-02       usr          ENABLED  ACTIVE   2050461  CONCAT    -        RW
sd rootdisk01-03 usr-02      rootdisk01 3077487 2050461 0         c3t5d0   ENA
v  var          fsgen        ENABLED  ACTIVE   3073896  ROUND     -
pl var-01       var          ENABLED  ACTIVE   3073896  CONCAT    -        RW
sd disk02-04    var-01       disk02   5127948  3073896  0         c0t1d0s2 ENA
pl var-02       var          ENABLED  ACTIVE   3073896  CONCAT    -        RW
sd rootdisk01-04 var-02      rootdisk01 5127948 3073896 0         c3t5d0   ENA
This says that in the group rootdg there are 4 volumes,
those being rootvol, swapvol, usr and var.
An example of a volume will be var.  This says that the 
volume is made up of 2 plexes called var-01 and var-02.
In tern the plex var-01 is made up of the subdisk
disk02-04 and the plex var-02 is made up of the subdisk 
The filesystem types of the volumes in this group are :-
rootvol                     root          (root filesystem)
swapwol                  swap        (swap file system)
/usr                         fsgen       (generic filesystem)
/var                         fsgen   (generic filesystem)
other posssible filsystem types are gen and raid5
vxprint -l volumename
vxprint -vl
xvrpint -vt
display information about volumes
vxprint -l plex-name
vxprint -lp
display information about plex(es)
vxprint -l diskname-??
vxprint -st
display information about Subdisks
vxprint -t -v -e 'aslist.aslist.sd_disk="boot-disk-name"'
list all the volumes on the boot disk boot-disk-name

vxmksdpart -g rootdg diskpart 1 0x03 0x01
Rebuild the partition table after recovering from a root disk failure.
This is after re-mirroring the disk

init and Boot scripts in Linux

init and boot scripts:

The main startup process is initiated by the program init, which spawns all other processes. The purpose of init is to bring the system into a usable state. init reads the file /etc/inittab

■First, the main initialization script is run, /etc/rc.sysinit (a Bash script).

■If started in single user mode (runlevel 1 or S), the script /etc/rc.single is run.

■If in any other runlevel (2-5), /etc/rc.multi is run instead.

■The last script to run is /etc/rc.local (via /etc/rc.multi), which is empty by default


/etc/rc.sysinit is a script and not a place for settings. It sources (i.e. reads and inherits variables and functions) rc.conf for settings and /etc/rc.d/functions for the functions that produce its graphical output (nice colors, alignments, switching 'busy' to 'done', etc.). This file should not be edited as it is overwritten on upgrade.

The tasks of rc.sysinit are:

1.sources the /etc/rc.conf and /etc/rc.d/functions scripts.

2.displays a welcome message.

3.mounts various virtual file systems.

4.make sure rootfs is mounted read-only (if needed).

5.starts bootlogd.

6.print deprecation warnings.

7.configures the hardware clock.

8.starts udev, loads modules from the MODULES array defined in rc.conf, and waits for udev to finish processing coldplug events.

9.starts the loopback interface.

10.configures RAID, btrfs and encrypted filesystem mappings.

11.check partitions (fsck).

12.remount the rootfs in order to apply the options from /etc/fstab.

13.mounts local filesystems (networked drives are not mounted before a network profile is up).

14.start monitoring lvm groups.

15.activates swap areas.

16.configure timezone.

17.initialize the random seed.

18.removes various leftover/temporary files, such as /tmp/*.

19.sets the hostname, locale and system clock as defined in rc.conf.

20.configures the locale, console, and keyboard mappings.

21.sets the console font.

22.writes output from dmesg to /var/log/dmesg.log.

B. /etc/rc.single:

/etc/rc.single Single-user mode boots straight into the root user account and should only be used if one cannot boot normally. This script ensures no daemons are running except for the bare minimum: syslog-ng and udev.

The single-user mode is useful for system recovery where preventing remote users from doing anything that might cause data loss or damage is necessary

C. /etc/rc.multi :

/etc/rc.multi is run on any multi-user (i.e. normal) runlevel (i.e. 2, 3, 4, and 5). Typically, users do not notice the transition from rc.sysinit to rc.multi because rc.multi also uses /etc/rc.d/functions for handling output. This script:

1.runs sysctl to apply the settings in /etc/sysctl.conf, modifying kernel parameters at runtime; Arch has very few of these by default (mainly networking settings).

2.starts the daemons, as per the DAEMONS array in rc.conf.

3.runs /etc/rc.local to handle user customizations.

D. /etc/rc.local:

/etc/rc.local is the local multi-user startup script. Empty by default, it is a good place to put any last-minute commands the system should run at the very end of the boot process.

Most common system configuration tasks (like loading modules, changing the console font, or setting up devices) usually have a dedicated place where they are entered.

To avoid confusion, ensure that commands entered in rc.local are not better suited elsewhere, such as /etc/profile.d.

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks