List of Unix Commands
#:
Used to make comments in a shell script or tells which shell to use as an interpreter for the script.
.:
Reads commands from a script and execute them in your current environment.
/etc/defaultrouter:
Defines the systems default routers. Values must be separated with whitespace, # can be used for comments.
/etc/gateways:
Contains all the routes and default gateways for the system.
/etc/hostname.interface:
Contains the hostname of the system and should match the hostname defined in the /etc/hosts file. The file is named with the interface name, such as hostname.hme0 or hostname.le0
/etc/hosts:
Configures names and aliases of IP-addresses. Fields should be separated with Tab or white space.
/etc/inetd.conf:
Is the Internet services database ASCII file which contains a list of available network services.
/etc/inetd.conf:
Is the Internet server database ASCII file that contains a list of available servers. Is invoked by inetd when it gets an Internet request via a socket.
/etc/inetd.conf:
Is the Internet server database, used by the inetd daemon, which contains a list of available network services.
/etc/inittab:
Is a script used by init. Controls process dispatching.
/etc/inittab:
Controls process dispatching. Used by init.
/etc/inittab:
Is a script used by init. Controls process dispatching.
/etc/lilo.conf:
Is the configuration file used by the Linux Loader while booting.
/etc/modules.conf:
Loads modules specific options at startup.
/etc/mygate:
Defines the systems default router or gateway.
/etc/myname:
Specifies the real host name for the system.
/etc/netsvc.conf:
Specifies how different name resolution services will look up names.
/etc/nodename:
Specifies the real hostname for the system.
/etc/nologin:
Is a text file that, if it exists in /etc/, will prevent non-root users from logging in. If a user attempts to login, it will be shown the contents of the file, and then be disconnected.
/etc/nologin:
Is a text file message that is shown to the user who tries to log on during a system shutdown process. After the message appears the log on procedure ends.
/etc/nsswitch.conf:
Specifies how the lookup for different databases are performed and in what order. Lookups are done left to right.
/etc/nsswitch.conf:
Specifies how the lookup for different databases is done and in what order.
/etc/printcap:
Describes printers and allows dynamic addition and deletion of printers by the spooling system.
/etc/printcap:
Describes printers and allows dynamic addition and deletion of printers by the spooling system.
/etc/rc.conf:
Is a configuration file used to configure the system daemons. It has three sections, the first turns features on or off, the second turns daemons on or off and the third sets parameters for the
/etc/resolv.conf:
Configures the system's network. Specifies hostname and gateway.
/etc/xinetd.conf:
Contains the configuration for the extended internet services started by the xinetd command.
a2p:
Transforms awk scripts to perl scripts, and shows the result on STDOUT.
ab:
Benchmarks your Apache server by sending requests to it.
ab:
Benchmarks your Apache server by sending requests to it.
ab:
Benchmarks your Apache server by sending requests to it.
ab_admin:
Manages an AnswerBook card catalog database through a shell-level interface. Will enable administrators to delete, add, list, verify and modify AnswerBook entries.
ac:
Shows how long a user or users have been logged in.
ac:
Counts how long a user or users have been using their accounts.
accept:
Enables the printer queue specified to receive print requests.
access:
Checks whether if a file can be accessed. Exits successfully if the file can be accessed with the specified mode.
accessx:
Configures the keyboard for use by people with disabilities. Requires OpenWindows version 3.4 or later.
acctcms:
Posted by Dinesh Yadav at 9:32 AM 0 comments
Aix commands Most usefulls
As you know, AIX® has a vast array of commands that enable you to do a multitude of tasks. Depending on what you need to accomplish, you use only a certain subset of these commands. These subsets differ from user to user and from need to need. However, there are a few core commands that you commonly use. You need these commands either to answer your own questions or to provide answers to the queries of the support professionals.
In this article, I'll discuss some of these core commands. The intent is to provide a list that you can use as a ready reference. While the behavior of these commands should be identical in all releases of AIX, they have been only tested under AIX 5.3.
Note:
The bootinfo command discussed in the following paragraphs is NOT a user-level command and is NOT supported in AIX 4.2 or later.
Commands
Kernel
How would I know if I am running a 32-bit kernel or 64-bit kernel?
To display if the kernel is 32-bit enabled or 64-bit enabled, type:
bootinfo -K
How do I know if I am running a uniprocessor kernel or a multiprocessor kernel?
/unix is a symbolic link to the booted kernel. To find out what kernel mode is running, enter ls -l /unix and see what file /unix it links to. The following are the three possible outputs from the ls -l /unix command and their corresponding kernels:
/unix -> /usr/lib/boot/unix_up # 32 bit uniprocessor kernel /unix -> /usr/lib/boot/unix_mp # 32 bit multiprocessor kernel/unix -> /usr/lib/boot/unix_64 # 64 bit multiprocessor kernel
Note:
AIX 5L Version 5.3 does not support a uniprocessor kernel.
How can I change from one kernel mode to another?
During the installation process, one of the kernels, appropriate for the AIX version and the hardware in operation, is enabled by default. Let us use the method from the previous question and assume the 32-bit kernel is enabled. Let us also assume that you want to boot it up in the 64-bit kernel mode. This can be done by executing the following commands in sequence:
#ln -sf /usr/lib/boot/unix_64 /unix
#/usr/lib/boot/unix bosboot -ad /dev/hdiskxx
#shutdown -r
The /dev/hdiskxx directory is where the boot logical volume /dev/hd5 is located. To find out what xx is in hdiskxx, run the following command:
#lslv -m hd5
Note:
In AIX 5.2, the 32-bit kernel is installed by default. In AIX 5.3, the 64-bit kernel is installed on 64-bit hardware and the 32-bit kernel is installed on 32-bit hardware by default.
Hardware
How would I know if my machine is capable of running AIX 5L Version 5.3?
AIX 5L Version 5.3 runs on all currently supported CHRP (Common Hardware Reference Platform)-based POWER hardware.
How would I know if my machine is CHRP-based?
Run the prtconf command. If it's a CHRP machine, the string chrp appears on the Model Architecture line.
How would I know if my System p machine (hardware) is 32-bit or 64-bit?
To display if the hardware is 32-bit or 64-bit, type:
#bootinfo -y
How much real memory does my machine have?
To display real memory in kilobytes (KB), type one of the following:
#bootinfo -r
#lsattr -El sys0 -a realmem
Can my machine run the 64-bit kernel?
64-bit hardware is required to run the 64-bit kernel.
What are the values of attributes for devices in my system?
To list the current values of the attributes for the tape device, rmt0, type:
#lsattr -l rmt0 -E
To list the default values of the attributes for the tape device, rmt0, type:
#lsattr -l rmt0 -D
To list the possible values of the login attribute for the TTY device, tty0, type:
#lsattr -l tty0 -a login -R
To display system level attributes, type:
#lsattr -E -l sys0
How many processors does my system have?
To display the number of processors on your system, type:
#lscfg | grep proc
How many hard disks does my system have and which ones are in use?
To display the number of hard disks on your system, type:
#lspv
How do I list information about a specific physical volume?
To find details about hdisk1, for example, run the following command:
#lspv hdisk1
How do I get a detailed configuration of my system?
Type the following:
#lscfg
The following options provide specific information:
-p
Displays platform-specific device information. The flag is applicable to AIX 4.2.1 or later.
-v
Displays the VPD (Vital Product Database) found in the customized VPD object class.
For example, to display details about the tape drive, rmt0, type:
lscfg -vl rmt0
You can obtain very similar information by running the prtconf command.
How do I find out the chip type, system name, node name, model number, and so forth?
The uname command provides details about your system.
#uname -p
Displays the chip type of the system. For example, PowerPC.
#uname -r
Displays the release number of the operating system.
#uname -s
Displays the system name. For example, AIX.
#uname -n
Displays the name of the node.
#uname -a
Displays the system name, nodename, version, machine ID.
#uname -M
Displays the system model name. For example, IBM, 9114-275.
#uname -v
Displays the operating system version.
#uname -m
Displays the machine ID number of the hardware running the system.
#uname -u
Displays the system ID number.
AIX
What version, release, and maintenance level of AIX is running on my system?
Type one of the following:
#oslevel –r
#lslpp -h bos.rte
How can I determine which fileset updates are missing from a particular AIX level?
To determine which fileset updates are missing from 5300-04, for example, run the following command:
#oslevel -rl 5300-04
What SP (Service Pack) is installed on my system?
To see which SP is currently installed on the system, run the oslevel -s command. Sample output for an AIX 5L Version 5.3 system, with TL4, and SP2 installed would be:
#oslevel –s5300-04-02
Is a CSP (Concluding Service Pack) installed on my system?
To see if a CSP is currently installed on the system, run the oslevel -s command. Sample output for an AIX 5L Version 5.3 system, with TL3, and CSP installed would be:
#oslevel –s5300-03-CSP
How do I create a file system?
The following command will create, within volume group testvg, a jfs file system of 10MB with mounting point /fs1:
#crfs -v jfs -g testvg -a size=10M -m /fs1
The following command will create, within volume group testvg, a jfs2 file system of 10MB with mounting point /fs2 and having read only permissions:
#crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2
How do I change the size of a file system?
To increase the /usr file system size by 1000000 512-byte blocks, type:
#chfs -a size=+1000000 /usr
Note:
In AIX 5.3, the size of a JFS2 file system can be shrunk as well.
How do I mount a CD?
Type the following:
#mount -V cdrfs -o ro /dev/cd0 /cdrom
How do I mount a file system?
The following command will mount file system /dev/fslv02 on the /test directory:
#mount /dev/fslv02 /test
How do I mount all default file systems (all standard file systems in the /etc/filesystems file marked by the mount=true attribute)?
The following command will mount all such file systems:
#mount {-a|all}
How do I unmount a file system?
Type the following command to unmount /test file system:
#umount /test
How do I display mounted file systems?
Type the following command to display information about all currently mounted file systems:
#mount
How do I remove a file system?
Type the following command to remove the /test file system:
#rmfs /test
How can I defragment a file system?
The defragfs command can be used to improve or report the status of contiguous space within a file system. For example, to defragment the file system /home, use the following command:
#defragfs /home
Which fileset contains a particular binary?
To show bos.acct contains /usr/bin/vmstat, type:
#lslpp -w /usr/bin/vmstat
Or to show bos.perf.tools contains /usr/bin/svmon, type:
which_fileset svmon
How do I display information about installed filesets on my system?
Type the following:
#lslpp -l
How do I determine if all filesets of maintenance levels are installed on my system?
Type the following:
#instfix -i | grep ML
How do I determine if a fix is installed on my system?
To determine if IY24043 is installed, type:
#instfix -ik IY24043
How do I install an individual fix by APAR?
To install APAR IY73748 from /dev/cd0, for example, enter the command:
#instfix -k IY73748 -d /dev/cd0
How do I verify if filesets have required prerequisites and are completely installed?
To show which filesets need to be installed or corrected, type:
#lppchk –v
How do I get a dump of the header of the loader section and the symbol entries in symbolic representation?
Type the following:
#dump –Htv
How do I determine the amount of paging space allocated and in use?
Type the following:
#lsps –a
How do I increase a paging space?
You can use the chps -s command to dynamically increase the size of a paging space. For example, if you want to increase the size of hd6 with 3 logical partitions, you issue the following command:
#chps -s 3 hd6
How do I reduce a paging space?
You can use the chps -d command to dynamically reduce the size of a paging space. For example, if you want to decrease the size of hd6 with four logical partitions, you issue the following command:
#chps -d 4 hd6
How would I know if my system is capable of using Simultaneous Multi-threading (SMT)?
Your system is capable of SMT if it's a POWER5-based system running AIX 5L Version 5.3.
How would I know if SMT is enabled for my system?
If you run the smtctl command without any options, it tells you if it's enabled or not.
Is SMT supported for the 32-bit kernel?
Yes, SMT is supported for both 32-bit and 64-bit kernel.
How do I enable or disable SMT?
You can enable or disable SMT by running the smtctl command. The following is the syntax:
#smtctl [ -m off | on [ -w boot | now]]
The following options are available:
-m off
Sets SMT mode to disabled.
-m on
Sets SMT mode to enabled.
-w boot
Makes the SMT mode change effective on next and subsequent reboots if you run the bosboot command before the next system reboot.
-w now
Makes the SMT mode change immediately but will not persist across reboot.
If neither the -w boot or the -w now options are specified, then the mode change is made immediately. It persists across subsequent reboots if you run the bosboot command before the next system reboot.
How do I get partition-specific information and statistics?
The lparstat command provides a report of partition information and utilization statistics. This command also provides a display of Hypervisor information.
Volume groups and logical volumes
How do I know if my volume group is normal, big, or scalable?
Run the lsvg command on the volume group and look at the value for MAX PVs. The value is 32 for normal, 128 for big, and 1024 for scalable volume group.
How to create a volume group?
Use the following command, where s partition_size sets the number of megabytes (MB) in each physical partition where the partition_size is expressed in units of MB from 1 through 1024. (It's 1 through 131072 for AIX 5.3.) The partition_size variable must be equal to a power of 2 (for example: 1, 2, 4, 8). The default value for standard and big volume groups is the lowest value to remain within the limitation of 1016 physical partitions per physical volume. The default value for scalable volume groups is the lowest value to accommodate 2040 physical partitions per physical volume.
#mkvg -y name_of_volume_group -s partition_size list_of_hard_disks
How can I change the characteristics of a volume group?
You use the following command to change the characteristics of a volume group:
#chvg
How do I create a logical volume?
Type the following:
#mklv -y name_of_logical_volume name_of_volume_group number_of_partition
How do I increase the size of a logical volume?
To increase the size of the logical volume represented by the lv05 directory by three logical partitions, for example, type:
#extendlv lv05 3
How do I display all logical volumes that are part of a volume group (for example, rootvg)?
You can display all logical volumes that are part of rootvg by typing the following command:
#lsvg -l rootvg
How do I list information about logical volumes?
Run the following command to display information about the logical volume lv1:
#lslv lv1
How do I remove a logical volume?
You can remove the logical volume lv7 by running the following command:
#rmlv lv7
The rmlv command removes only the logical volume, but does not remove other entities, such as file systems or paging spaces that were using the logical volume.
How do I mirror a logical volume?
1. #mklvcopy LogicalVolumeName Numberofcopies
2. #syncvg VolumeGroupName
How do I remove a copy of a logical volume?
You can use the rmlvcopy command to remove copies of logical partitions of a logical volume. To reduce the number of copies of each logical partition belonging to logical volume testlv, enter:
#rmlvcopy testlv 2
Each logical partition in the logical volume now has at most two physical partitions.
Queries about volume groups
To show volume groups in the system, type:
#lsvg
To show all the characteristics of rootvg, type:
#lsvg rootvg
To show disks used by rootvg, type:
#lsvg -p rootvg
How to add a disk to a volume group?
Type the following:
#extendvg VolumeGroupName hdisk0 hdisk1 ... hdiskn
How do I find out what the maximum supported logical track group (LTG) size of my hard disk?
You can use the lquerypv command with the -M flag. The output gives the LTG size in KB. For instance, the LTG size for hdisk0 in the following example is 256 KB.
#/usr/sbin/lquerypv -M hdisk0256
You can also run the lspv command on the hard disk and look at the value for MAX REQUEST.
What does syncvg command do?
The syncvg command is used to synchronize stale physical partitions. It accepts names of logical volumes, physical volumes, or volume groups as parameters.
For example, to synchronize the physical partitions located on physical volumes hdisk6 and hdisk7, use:
#syncvg -p hdisk4 hdisk5
To synchronize all physical partitions from volume group testvg, use:
#syncvg -v testvg
How do I replace a disk?
1. #extendvg VolumeGroupName hdisk_new
2. #migratepv hdisk_bad hdisk_new
3. #reducevg -d VolumeGroupName hdisk_bad
How can I clone (make a copy of ) the rootvg?
You can run the alt_disk_copy command to copy the current rootvg to an alternate disk. The following example shows how to clone the rootvg to hdisk1.
#alt_disk_copy -d hdisk1
Network
How can I display or set values for network parameters?
The no command sets or displays current or next boot values for network tuning parameters.
How do I get the IP address of my machine?
Type one of the following:
#ifconfig -a host Fully_Qualified_Host_Name
For example, type host cyclop.austin.ibm.com.
How do I identify the network interfaces on my server?
Either of the following two commands will display the network interfaces:
#lsdev -Cc if
#ifconfig –a
To get information about one specific network interface, for example, tr0, run the command:
#ifconfig tr0
How do I activate a network interface?
To activate the network interface tr0, run the command:
#ifconfig tr0 up
How do I deactivate a network interface?
For example, to deactivate the network interface tr0, run the command:
#ifconfig tr0 down
Posted by Dinesh Yadav at 9:31 AM 0 comments
Implementetion fo PLM
Implementing PLM
PLM Software Installation
Install the following filesets:
plm.license
plm.server.rte
plm.sysmgt.websm
Make sure SSL and OpenSSH are also installed
For setup of PLM, create .rhosts files on the server and all clients.After PLM has been set up, you can delete the .rhosts files.
Create SSH Keys
On the server, enter:
# ssh-keygen –t rsa
Copy the HMC’s secure keys to the server:
# scp hscroot@hmchostname:.ssh/authorized_keys2 \
~/.ssh/tmp_authorized_keys2
Append the server’s keys to the temporary key file and copy it back to the HMC:
# cat ~/.ssh/id_rsa.pub >> ~/.ssh/tmp_authorized_keys2
# scp ~/.ssh/tmp_authorized_keys2 \
hscroot@hmchostname:.ssh/authorized_keys2
Test SSH and Enable WebSM
Test SSH to the HMC. You should not be asked for a password.
# ssh hscroot@hmchostname lssyscfg –r sys
On the PLM server, make sure you can run WebSM. Run:
# /usr/websm/bin/wsmserver -enable
Configure PLM Software
On the PLM server, open WebSM and select Partition Load Manager.
Click on Create a Policy File. In the window open on the General Tab, enter a policy file name on the first line
Click on the Globals tab. Enter the fully qualified hostname of your HMC. Enter hscroot (or a user with the Systems Administration role) as the HMC user name. Enter the CEC name, which is the managed system name (not the fully qualified hostname).
Click on the Groups tab. Click the Add button. Type in a group name. Enter the maximum CPU and memory values that you are allowed to use for PLM operations.
Check both CPU and Memory management if you’re going to manage both.
Click on Tunables. These are the defaults for the entire group. If you don’t understand a value, highlight it and select Help for a detailed description.
Click on the Partitions tab. Click the Add button and add all of the running partitions in the group to the partitions list.
On the Partition Definition tab, use the partitions’ fully qualified hostnames and add them to the group you just created.
Click OK to create the policy file.
In the PLM server, view the policy file you created. It will be in /etc/plm/policies.
Perform the PLM setup step using WebSM. You must be root. Once this finishes, you’ll see “Finished: Success” in the WebSM working window.
In the server and a client partition, look at the /var/ct/cfg/ctrmc.acls file to see if these lines are at the bottom of the file:
IBM.LPAR
root@hmchostname * rw
If you need to edit this file, run this command afterward:
# refresh –s ctrmc
Test RMC authentication by running this command from the PLM server, where remote_host is a PLM client
# CT_CONTACT=remote_host lsrsrc IBM.LPAR
If successful, a lot of LPAR information will be printed out instead of “Could not authenticate user”
Start the PLM server. Look for “Finished:Success” in the WebSM working window.
Enter a configuration name. Enter your policy file name. Enter a new logfile name.
(If you have trouble with the logilfe, you may need to touch the file before you can access it)
If the LPAR details window shows only zeroed-out information, then there’s probably an RMC authentication problem.
If there’s a problem, on the server partition, run:
# /usr/sbin/rsct/bin/ctsvhbal
The output should list one or more identities. Check to see that the server’s fully qualified hostname is in the output.
On each partition, run /usr/sbin/rsct/bin/ctsthl –l. At least one of the identities shown on the remote partition’s ctsvhbal output should show up on the other partitions’ ctsthl –l output. This is the RMC list of trusted hosts.
If there are any entries in the RMC trusted hosts lists which are not fully qualified hostnames, remove them with the following command:
# /usr/sbin/rsct/bin/ctsthl –d –n identity
where identity is the trusted host list identity
If one partition is missing a hostname, add it as follows:
# /usr/sbin/rsct/bin/ctsthl –l –n identity –m METHOD –p ID_VALUE
Identity is the fully qualified hostname of the other partition
rsa512 is the method
Id_value is obtained by running ctsthl –l on the other partition to determine its own identifier
Posted by Dinesh Yadav at 9:29 AM 0 comments
Recovering a failed VIO Disk
Here is a recovery procedure for replacing a failed client disk on a Virtual IO
server. It assumes the client partitions have mirrored (virtual) disks. The
recovery involves both the VIO server and its client partitions. However,
it is non disruptive for the client partitions (no downtime), and may be
non disruptive on the VIO server (depending on disk configuration). This
procedure does not apply to Raid5 or SAN disk failures.
The test system had two VIO servers and an AIX client. The AIX client had two
virtual disks (one disk from each VIO server). The two virtual disks
were mirrored in the client using AIX's mirrorvg. (The procedure would be
the same on a single VIO server with two disks.)
The software levels were:
p520: Firmware SF230_145 VIO Version 1.2.0 Client: AIX 5.3 ML3
We had simulated the disk failure by removing the client LV on one VIO server. The
padmin commands to simulate the failure were:
rmdev -dev vtscsi01 # The virtual scsi device for the LV (lsmap -all)rmlv -f aix_client_lv # Remove the client LV
This caused "hdisk1" on the AIX client to go "missing" ("lsvg -p rootvg"....The
"lspv" will not show disk failure...only the disk status at the last boot..)
The recovery steps included:
VIO Server
Fix the disk failure, and restore the VIOS operating system (if necessary)mklv -lv aix_client_lv rootvg 10G # recreate the client LV mkvdev -vdev aix_client_lv -vadapter vhost1 # connect the client LV to the appropriate vhost
AIX Client
cfgmgr # discover the new virtual hdisk2 replacepv hdisk1 hdisk2 # rebuild the mirror copy on hdisk2 bosboot -ad /dev/hdisk2 # add boot image to hdisk2bootlist -m normal hdisk0 hdisk2 # add the new disk to the bootlistrmdev -dl hdisk1 # remove failed hdisk1
The "replacepv" command assigns hdisk2 to the volume group, rebuilds the mirror, and
then removes hdisk1 from the volume group.
As always, be sure to test this procedure before using in production.
No comments:
Post a Comment