Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Monday, April 18, 2011

How to zone a Brocade SAN switch in command line base?

How to zone a Brocade SAN switch in command line base?
Here are the basics to add a new device to a Brocade SAN fabric. working with a Brocade DCX switch. In this scenario, there is a new server come with 2 HBA card that going to attach to the SAN switches.

Terminology
HBA - Host Bus Adapter, HBA card is the device that connects the servers to a Storage Area Networks (SAN) via Fibre Channel.

WWN - World Wide Name, a unique 8-byte number identifying the HBA. Each WWN is an 8-byte number derived from an IEEE OUI (for the first 3 bytes) and vendor-supplied information.

FC Zone - Fibre Channel Zone, a partitioned subset of the fabric. Members of a zone are allowed to communicate with each other, but devices are not allowed to communicate across zones.

Steps to Zone Brocade Switch

1.Plug in the FC Connector into an open port on the switch.
2.Login to the server and verify the HBA connection. It should see the switch but not the storage device.
3.Check the Brocade Switch Port. To do so, telnet to the brocade switches and login as user admin.
switch 1 - fabric A (SWITCH_1)
switch 2 - fabric B (SWITCH_2)

Create aliases for the hosts HBA's on each switch
Example:
switch_1> alicreate " HOSTNAME01_HBA_0","10:00:00:c9:69:3d:53"
switch_2> alicreate " HOSTNAME01_HBA_1","10:00:00:c9:69:ae:4e"

Tips: Do a switchshow to capture the WWN before start the aliases creation.

4.Create the storage zones using the aliases on each switch
switch_1> zonecreate "Z_HOSTNAME01_A", "HOSTNAME01_HBA_0"
switch_2> zonecreate "Z_HOSTNAME01_B", "HOSTNAME01_HBA_1"

Check the configuration
switch_1> zoneshow Z_HOSTNAME01_A
switch_2> zoneshow Z_HOST01_B

5.Add the zones to the fabrics on each switch
switch_1> cfgshow SWITCH_A
switch_1> cfgadd "SWITCH_A","Z_ HOSTNAME01_A"
switch_1> cfgsave
switch_1> cfgenable SWITCH_A

Check the configuration
switch_1> zoneshow
switch_2> cfgshow SWITCH_B
switch_2> cfgadd " SWITCH_B","Z_ HOSTNAME01_B"
switch_2> cfgsave
switch_2> cfgenable SWITCH_A

Check the configuration
switch_2> zoneshow

6.Login back in to the server to verify. It should now see the storage devices

Sunday, April 17, 2011

AIX Commands User Management

-----
USERS / ENVIRONMENT
-----

passwd -f Change current users gecos (user description)
passwd -s Change current users shell

chfn (username) Changes users gecos
chsh (username) (shell) Changes users shell

env Displays values of environment variables
printenv

id Displays current user's uid and gid details
id (user) Displays user uid and gid details

whoami Displays current user details
who am i (or who -m)

who Displays details of all users currently logged in.
w
who -b Displays system reboot time

uptime Displays number of users logged in, time since last
reboot, and the machine load averages.

lsuser ALL Lists all users details
lsuser (username) Lists details for user
lsuser -a(attribute) (username or ALL) Lists user attributes
lsuser -a home ALL

mkuser -a(attributes) (newuser) Add a new user

chuser (attributes) (user) Change a user
chuser login=false (user) Lock a user account

rmuser -p (user) Removes a user and all entries in security files

usrck -t ALL Checks all the user entires are okay.

fuser -u (logical volume) Displays processes using the files in that LV
fuser -k /dev/lv02 Will send a kill signal to all processes using
/dev/lv02

lsattr -D -l sys0 -a maxuproc Displays max number of processes per user
chdev -l sys0 -a maxuproc=(number) Changes max number of processes per user

chlang (language) Changes the language settings for system or user.
En_GB = PC850 code pages
en_GB = ISO8859 code pages (Great Britain)
C = posix

su - (user) Switch to new user and change to the new users environment.
su (user) Switch to new user, current environment is propated to the
new shell.

-----
REMOTE USERS
-----

ruser -a -f (user) Adds entry into /etc/ftpusers file
ruser -a -p (host) Adds entry into /etc/host.lpd file
ruser -a -r (host) Adds entry into /etc/hosts.equiv file

ruser -d -f (user) Deletes entry in /etc/ftpusers file
ruser -d -p (host) Deletes entry in /etc/host.lpd file
ruser -d -r (host) Deletes entry in /etc/hosts.equiv file

ruser -s -F Shows all entries in /etc/ftpusers file
ruser -s -P Shows all entries in /etc/host.lpd file
ruser -s -R Shows all entries in /etc/hosts.equiv file

ruser -X -F Deletes all entries in /etc/ftpusers file
ruser -X -P Deletes all entries in /etc/host.lpd file
ruser -X -R Deletes all entries in /etc/hosts.equiv file

HP-UX Commands and Tricks 11.11 11.23 11.31-Unlock User

In HP-UX 11.11/11.23
1. If the system is trusted then run modprpw command to unlock the account.
/usr/lbin/modprpw -k username

2. In HP-UX 11.31
userdbset -d -u username auth_failures

Saturday, April 16, 2011

EMC TimeFinder Commands

The following are the Timefinder Procedural Commands

It outlines everything that needs to be done from start to finish. Realize that for routine operations, some of these steps won’t be needed; however, for the sake of completeness.

Prepare EMC structures

1. Create a Symmetrix disk group

symdg -t [ Regular | RDF1 | RDF2 ] create ${group}

2. Add devices to the disk group

symld -g ${group} add pd /dev/dsk/c#t#d#
symld -g ${group} add dev 01a

3. Associate BCV devices to the disk group

symbcv -g ${group} associate pd ${bcv_ctd}
symbcv -g ${group} associate dev ${bcv_dev}

Establish BCV mirrors

1. ID the logical device names: Timefinder defaults to using the logical device names. You can id the logical device names by:

symmir -g ${group} query

2. First time establish, execute a full establish:

symmir -g ${group} -full establish ${std_log_dev} bcv ${bcv_log_dev}

3. Use symmir query to monitor progress.

symmir -g ${group} query

Break BCV mirrors

1. Types of splits:

1. Instant split: Split is performed in the background after the completion of the split I/O request.
2. Force split: Splits the pair during establish or restore operations; invalid tracks may exist.
3. Reverse split: Resyncs the BCV with the full data copy from its local or remote mirror.
4. Reverse differential split: Enables a copy of only out-of-sync tracks to the BCV from its mirror.
5. Differential split: Enables a copy of only the updated tracks to the BCV’s mirror.

2. Commands:

symmir -g ${group} split
symmir -g ${group} split -instant
symmir -g ${group} split -differential
symmir -g ${group} reverse split -differential

Reestablish or restore BCV mirrors

1. Restore copies data from BCV back to standard pair. >Reestablish, on the other hand, does a differential update of the BCV from the standard device.

2. Commands:
symmir -g ${group} establish Differential reestablish from standard device to BCV
symmir -g ${group} -full restore Full restore of all tracks on BCV to standard device.
symmir -g ${group} restore Differential restore of BCV data to standard device.

The Timefinder Strategies are as follows

1. Maintain BCV mirrors with the standard device; break the mirrors when you want to backup, test, or develop on a copy of the original.

This is probably the most common way of running Timefinder. The advantage is that the split operation will happen almost instantly as the mirrors are fully synced all the time. The disadvantage is that anything towards that happens to the standard device will be reflected in the BCV mirror.

2. Maintain the BCV as a split device to keep an online backup of the original data.

Thursday, April 7, 2011

Short Guide for Netapp commands

This post contains the list of commands that will be most used and will come handy when managing or monitoring or troubleshooting a Netapp filer.


•sysconfig -a : shows hardware configuration with more verbose information

•sysconfig -d : shows information of the disk attached to the filer

•version : shows the netapp Ontap OS version.

•uptime : shows the filer uptime

•dns info : this shows the dns resolvers, the no of hits and misses and other info

•nis info : this shows the nis domain name, yp servers etc.

•rdfile : Like "cat" in Linux, used to read contents of text files/

•wrfile : Creates/Overwrites a file. Similar to "cat > filename" in Linux

•aggr status : Shows the aggregate status

•aggr status -r : Shows the raid configuration, reconstruction information of the disks in filer
•aggr show_space : Shows the disk usage of the aggreate, WAFL reserve, overheads etc.

•vol status : Shows the volume information

•vol status -s : Displays the spare disks on the filer

•vol status -f : Displays the failed disks on the filer

•vol status -r : Shows the raid configuration, reconstruction information of the disks

•df -h : Displays volume disk usage

•df -i : Shows the inode counts of all the volumes

•df -Ah : Shows "df" information of the aggregate

•license : Displays/add/removes license on a netapp filer

•maxfiles : Displays and adds more inodes to a volume

•aggr create : Creates aggregate

•vol create : Creates volume in an aggregate

•vol offline : Offlines a volume

•vol online : Onlines a volume

•vol destroy : Destroys and removes an volume

•vol size [+|-] : Resize a volume in netapp filer

•vol options : Displays/Changes volume options in a netapp filer

•qtree create : Creates qtree

•qtree status : Displays the status of qtrees

•quota on : Enables quota on a netapp filer

•quota off : Disables quota

•quota resize : Resizes quota

•quota report : Reports the quota and usage

•snap list : Displays all snapshots on a volume

•snap create : Create snapshot

•snap sched : Schedule snapshot creation

•snap reserve : Display/set snapshot reserve space in volume

•/etc/exports : File that manages the NFS exports

•rdfile /etc/exports : Read the NFS exports file

•wrfile /etc/exports : Write to NFS exports file

•exportfs -a : Exports all the filesystems listed in /etc/exports

•cifs setup : Setup cifs

•cifs shares : Create/displays cifs shares

•cifs access : Changes access of cifs shares

•lun create : Creates iscsi or fcp luns on a netapp filer

•lun map : Maps lun to an igroup

•lun show : Show all the luns on a filer

•igroup create : Creates netapp igroup

•lun stats : Show lun I/O statistics

•disk show : Shows all the disk on the filer

•disk zero spares : Zeros the spare disks

•disk_fw_update : Upgrades the disk firmware on all disks

•options : Display/Set options on netapp filer

•options nfs : Display/Set NFS options

•options timed : Display/Set NTP options on netapp.

•options autosupport : Display/Set autosupport options
•options cifs : Display/Set cifs options
•options tcp : Display/Set TCP options
•options net : Display/Set network options
•ndmpcopy : Initiates ndmpcopy

•ndmpd status : Displays status of ndmpd

•ndmpd killall : Terminates all the ndmpd processes.

•ifconfig : Displays/Sets IP address on a network/vif interface

•vif create : Creates a VIF (bonding/trunking/teaming)

•vif status : Displays status of a vif

•netstat : Displays network statistics

•sysstat -us 1 : begins a 1 second sample of the filer's current utilization (crtl - c to end)
•nfsstat : Shows nfs statistics

•nfsstat -l : Displays nfs stats per client

•nfs_hist : Displays nfs historgram

•statit : beings/ends a performance workload sampling [-b starts / -e ends]
•stats : Displays stats for every counter on netapp. Read stats man page for more info

•ifstat : Displays Network interface stats

•qtree stats : displays I/O stats of qtree

•environment : display environment status on shelves and chassis of the filer
•storage show : Shows storage component details

•snapmirror intialize : Initialize a snapmirror relation

•snapmirror update : Manually Update snapmirror relation

•snapmirror resync : Resyns a broken snapmirror

•snapmirror quiesce : Quiesces a snapmirror bond

•snapmirror break : Breakes a snapmirror relation

•snapmirror abort : Abort a running snapmirror

•snapmirror status : Shows snapmirror status

•lock status -h : Displays locks held by filer

•sm_mon : Manage the locks

•storage download shelf : Installs the shelf firmware

•software get : Download the Netapp OS software

•software install : Installs OS

•download : Updates the installed OS

•cf status : Displays cluster status

•cf takeover : Takes over the cluster partner

•cf giveback : Gives back control to the cluster partner

•reboot : Reboots a filer

Aix General Commands and Tips

1. creation and deletion of user accounts
mkuser
rmuser

2. list all users
lsuser -f ALL

3. change user account
chuser -a

4. smit

5. hostid -For checking the hostid

6. Top,Sar,vmstat,iostat for performance troubleshooting
topas
sar 4 5 (4 seconds and 5 readings)
vmstat
iostat

9.How to Check the logs?
alog -o -t

10.How to see the size in MBs?
df -m

11.Display the swap size?
lsps -a

12.How to ativate the swap?
swapon -a

13. How to check the runlvel in AIX?
uname -r (runlevel)

14.For device listing
lsdev -C

15.network parameters
no -a

16.
bootinfo -s hdisk#

17. How to list the physical volumes?
lspv

18.How to create a Volume Group?
mkvg

19.How to list the logical volumes?
lslv

20.How to create a Logical Volume?
mklv

21.How to extend the logical volume?
extendlv

22.How to remove the logical volume?
rmlv

23.How to list the devices of particular Class (processor,tape)

lsdev -Cc processor
lsdev -Cc tape

24.How to check the model number?
bootinfo -m

25.How to find out the kernel parameter?
bootinfo -K

26.How to uninstall the software?
installp -u

27.How to install a software?
installp -a

28.How to verify the software is installed?
lppchk -v

29. How to list all softwares?
lslpp -L all

30.Where the software directory is located?
/sw/lpp

31.How to list the installed patches?
instfix -i

32.How to install devices for the attached peripherals?
cfgmgr -v