ABC Of AIX

Welcome to the World of AIX learning!!!

Posts Tagged ‘lsdev

Devices

with 2 comments

Devices:

1. Command used for listing of /dev directory:

# ls –l /dev

2. Predefined means supported. (PdDv)

Command used:

# lsdev –PH

3. Customized means configured / defined (entry in ODM class CuDV) / available (CuDV)

Command used is:

# lsdev –CH

4. How is the location code understood:

AB-CD-EF-GH

Means

AB: Drawer

CD: Slot

EF: Connector

GH: Port

AB-CD together is adapter

Happy Learning!

Summary Of Device Commands

leave a comment »

Device Commands

Brief Overview (Summary) of Device Commands:

# lsdev

It will list all the devices and device information.

# lsdev –Pc

# lsdev –Pc adapter

# lsdev –Pc disk

# lsdev –Pc processor

# lsdev –Pc tape

# lsdev –Pc cdrom

# lsdev –Pc floppy

# lsdev –Pc memory

# lsdev –Pc tcpip

# lsdev –Pc ip

# rmdev –l <device name>

# rmdev –dl <device name>

# mkdev –l <device name>

# cfgmgr

# chdev <device name>

Attributes of devices:

# lsattr –EH –l sys0

# lsattr –EH –l proc0

# lsattr –EH –l mem0

# lsattr –EH –l adapter

# lsattr –EH –l hd0

# lsattr –EH –l hdisk0

# lsattr –EH –l inet0

# lsattr –EH –l en0

# lsattr –EH –l ent0

# lsattr –EH –l en1

You can check in detail about all these commands in previous posts on this blog.

Happy Learning !

Networking Concepts

with 2 comments

This post is an extension to the Networking Concepts post we discussed in the past.

You can refer to the post on Networking Concepts by following this link: http://abcofaix.wordpress.com/2012/03/11/networking-concepts-ip/

Let us revise some of the concepts we learnt in the past.

Command to check Ethernet adapters’ availability is:

# lsdev –Cc adapter

# lsdev –Cc if

Where If stands for the Interface.

This command will check how many interfaces are available.

Each adapter will have 2 interfaces.

For eg:

Ent0 adapter will have 2 interfaces:

1.       En0

2.       Et0

En0 is a standard Ethernet interface used in assigning ip addresses.

Et0 is used basically in IEEE as Ethernet interface.

Ip is never assigned directly to the adapter.

To assign an ip, command used is:

# ifconfig en0 <ip address> <network address>

To check current ip address, command used is:

# ifconfig –a

254 ip addresses can be assigned to a single interface.

Eg to assign an ip to an interface is:

# ifconfig en0 192.168.0.1 255.255.255.0

i.e.

# ifconfig en0 <ip address> <subnet mask>

When do we use ‘ALIAS’?

Consider the following command:

# ifconfig en0 <ip address> <subnet mask> alias

What is the function of ‘alias’ here?

Alias is basically used to assign more than 1 ip address to a single interface.

For eg:

# ifconfig en0 192.168.0.2 255.255.255.0 alias

This command will assign 2 ip addresses to a single interface en0.

If no ‘alias’ is used:

# ifconfig en0 192.168.0.2 255.255.255.0

This command will replace the earlier ip address for the interface en0 with a new ip address.

So, by using ‘alias’, we can assign 255 ip addresses to a single interface.

Command to delete an ip address from an interface:

# ifconfig en0 192.168.0.2 255.255.255.0 delete

This command will delete this particular ip address from en0 interface.

# ifconfig en0 down

This command will turn off network interface en0.

To permanently add an ip address to en0 or en1 interface, command used is:

# chdev –EH –l en0 –a netaddr = <ip address> -a <subnet mask>

For eg:

# chdev –EH –l en0 –a netaddr = 192.168.0.1 –a 255.255.255.0

To permanently add alias to the interface, command used is:

# chdev –EH –l en0 –a alias = <ip address> -a <subnet mask>

For eg:

# chdev –EH –l en0 –a alias = 192.168.0.2 –a 255.255.255.0

To permanently remove added alias from the interface, command used is:

# chdev –EH –l en0 –a delalias = <ip address> -a <subnet mask>

For eg:

# chdev –EH –l en0 –a delalias = 192.168.0.2 –a 255.255.255.0

To remove all tcp / ip configuration from host, command used is:

# rmtcpip

One can see ent0 statistics by running the following command:

# netstat –v ent0 | more

To add gateway:

A gateway is basically added to connect intranet to internet i.e. to connect your home/private network to the internet.

To add a gateway, command used is:

# route add –net <destination network ip address> <default gateway>

To check gateway, command used is:

# netstat –r

To delete a gateway, command used is:

# route delete <destionation network ip address> <default gateway>

To add / make STATIC gateway:

Edit the file /etc/rc.net by running the following command:

# vi /etc/rc.net

Add the following line:

# route add –net <ip address> <subnet mask> -a <gateway>

# route

Command will make manual entries in routing table till the next reboot.

To check the routing table which has gateway information, command used is:

# netstat –rn

To check MAC address of a particular Ethernet interface, command used is:

# entstat en0

Or

# netstat –i

This command will check incoming/outgoing network packet errors.

Ip packets can be captured using iptrace or tcpdump or netstat –in command.

To listen / capture packets from a specific device, command used is:

# tcpdump –I en0 –n <filename where information will be stored> <destination ip address>

Only the root user can run this command.

Arp stands for address resolution protocol.

arp command displays and modifies address resolution.

# arp –a

Command will display local arp cache.

Nslookup command always query internet domain name servers.

Tracert (traceroute) command displays route that ip packets takes to network hosts. For eg:

# tracert google.com

This will be all for this post. I’ll keep updating this blog as and when needed.

P.S: everything written on this blog is written after thorough study of various red hat pdf’s and online material available, mixed with writer’s experience and understanding of the subject. I do not hold any copyrights to the content published here. Anybody can make use of this content. A word of appreciation is enough for me to keep moving.

Till then,

Happy Learning!

Regards

RA

PV Commands

leave a comment »

This post is a brief overview about various PV commands and their significance. You can find about these commands in detail in previous posts.

Steps To Create A File System

Device Administration

AIX Devices Information

Commands:

# lsdev

abc of aix

lsdev

Command will list all the devices in ODM.

# chdev

Command is used to change the characteristics of a device(s).

# mkdev

Or

# cfgmgr

Command is used to add devices to the system. Mkdev command is discussed in detail in this post.

# rmdev

Command is used to remove devices from the system. Rmdev command can be studied in detail in this post.

# chpv

Command is used to change the state of PV in a VG.

# lspv

abc of aix

lspv commands

Command is most frequently used and it displays information about PVs in VG.

# migratepv

Command is basically used when admin wants migration of data from 1 PV to another PV (in the form of PPs), both the PVs must be present in the same VG. This way admin can free PV and remove it later from the VG group once entire PV is migrated to another PV.

Commands for PV migration:

# migratepv <pvname1> <pvname2>

For eg:

# migratepv hdisk0 hdisk1

Command will migrate pv hdisk0 to hdisk1 on condition that both the PVs must be present within the same VG.

# migratepv –l <lvname> <pvname1> <pvname2>

For eg:

# migratepv –l lv01 hdisk0 hdisk1

To verify migration, command used is:

# lslv –m <lvname>

Happy learning!

Written by RA

April 8, 2012 at 10:06 am

Device Administration

leave a comment »

This post will discuss about device administration and their management.

Last post we looked at information about the devices and their states. You can refer that post here.

This post is a step closer to device management.

The main command to list all devices present in the system is:

# lsdev

abcofaix

lsdev

This command will list all the devices present in ODM in the system.

# lscfg

abcofaix

lscfg

Command is used to list the configuration of all the devices present on the system.

# lscfg -vp

abcofaix

lscfg -vp

Command is used to list the complete hardware information.

# lscfg –vpl hdisk0

abcofaix

lscfg -vpl hdisk0

Will give complete hardware information about hdisk0.

If lscfg is used with flags for eg:

# lscfg –v

abcofaix

lscfg -v

Command will give complete information in form of list of all the devices installed on the system. This information output will be detailed information available for each device installed on the machine.

Other commands like,

# lscgf –vl <device name>

Will give complete information about the device installed on the machine.

You can make use of help command to know more about the flags associated with lscfg command.

As we have already seen devices connected to the system can have 4 states, we will discuss these states in detail now.

Undefined means devices may be connected to the system but not defined.

Defined means devices connected and defined but still unavailable to the system.

Available means devices are defined and present in the system.

Stopped means devices are unavailable but defined and not known to the system by a device number.

Command to convert the state of a device from DEFINED to AVAILABLE is:

# mkdev –l  <device name>

This command will convert the raw device which is in defined state to available state after execution.

Another command to change the state of the device from DEFINED to AVAILABLE is:

# cfgmgr

This command changes the state from defined to available for the device.

This performs the same functionality as mkdev command does. This command is basically used to configure plug & play devices. Freshers in AIX must remember this command from interview point of view.

Once the device state is changed from DEFINED to AVAILABLE, admin can always revert back to DEFINED state by running the following command:

# rmdev –l <device name>

This command will remove the device and its information from the AVAILABLE state of devices and put the device back in DEFINED state.

For eg:

# rmdev –l hdisk9

This command will show hdisk9 in defined state not available state.

To remove the device completely from the system, command used is:

# rmdev –dl <device name>

Another command can be used if the devices installed are having child devices (dependencies attached to it), command to remove the device completely in such a situation is:

# rmdev –SR <device name>

S flag will stop the device

And

R flag will unconfigure all the child devices connected to the parent device.

To list all the PRE-DEFINED devices, command used is:

# lsdev –Pc hdisk

Or

# lsdev –Pc tape

Or

# lsdev –Pc cdrom

abcofaix

lsdev cdrom

Where

P stands for predefined and c stands for class of the device whether tape, cdrom, hdisk etc.

Remember: pre-defined devices are those which are in undefined/supported state.

For eg: to check pre-defined supported adapter:

# lsdev –Pc adapter

Command to list all the customized devices, command used is:

# lsdev –Cc hdisk

Or

# lsdev –Cc tape

Or

# lsdev –Cc cdrom

Where

C stands for customized and c for class.

Remember: customized devices means devices are defined and available to the system.

For eg: to check customized adapter (to check Ethernet adapter (NIC Cards) availability)

# lsdev –Cc adapter

# lsdev –CH

abcofaix

lsdev -CH

Command is used to list entire information about customized devices.

# lsdev –PH

abcofaix

lsdev -PH

Command will list entire information about all pre-defined devices.

To check total number of CPUs, command used is:

# lsdev –Pc processor

# lsdev –Cc processor

To check how many interfaces are available, command used is:

# lsdev –Cc if

abcofaix

lsdev adapter & if commands

Each adapter will have 2 interfaces.

For eg:

Ent0 will have 2 interfaces, en0 and et0

En0 is used for assigning ip and et0 is used for IEEE Ethernet interface (for research).

IP is never assigned directly to the adapter, it is assigned to the interface. 256 ip’s can be assigned to a single interface.

We will discuss about all these concepts in network administration as well.

To check speed and attributes of processor, command used is:

# lsattr –EH –l proc0

abcofaix

lsattr commands

This will generally give speed as 332 mhz.

To check system attributes:

# lsattr –EH –l sys0

Command used to check real memory is:

# lsattr –EH –l sys0 –a realmem

Real memory can also be checked by using this command:

# bootinfo –r

Various bootinfo commands we have already discussed in this post.

Some other commands:

# lsattr -EH -l sys0 -a autostart

abcofaix

lsattr -EH -l sys0 -a autorestart command

# lsattr -EH -l tty0 -a speed

abcofaix

lsattr -EH -l tty0 -a speed

# lsattr – EH -l mem0

abcofaix

lsattr -EH -l mem0 command

# lsattr -EH -l inet0

abcofaix

lsattr -EH -l inet0

Thanks for reading this post!

Happy learning!