Posts Tagged ‘chdev’
Brief Overview (Summary) of Device Commands:
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>
# 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 !
This post will discuss about some additional information about AIX OS that can be used in production environment.
If the admin wants to filescan the root file system:
- Admin must go into the maintenance mode after booting from the disk.
- Type the following command:
- # /etc/continue <bootdisk> exit
- For eg:
- # /etc/continue hdisk0 exit
- # fsck /dev/hd4
To filescan the /usr directory:
- To do this, /usr should be unmounted. Unmounting is not an easy process as /bin directory is linked to /usr directory in /usr/bin. So admin must go into the maintenance mode first and then run
- # getrootfs <bootdisk> sh
- For eg:
- # getrootfs hdisk0 sh
- After running this command, next command user needs to run is:
- # fsck /dev/hd2
To change the parameters (for eg: number of processes per user run), command used is:
- # lsattr –EH –l sys0 –a maxuproc
- # chdev –EH –l sys0 –a maxuproc = 200
To list all the virtual printers a print queue is using, command used is:
- # lsvirprt
To check if AIX has a PTF applied to it or not, command used is:
- # lslpp –B1 UXXXXXXX
- UXXXXXXX is the PTF number
PTF stands for program temporary fix.
Click cancel or F10 to exit from SMIT menu.
To check inode statistics, command used is:
- # istat /etc/passwd
Various degraf commands are:
- # defrag –q
- # defrag –r
- # defrag –s
Alog information is available in /var/adm/ras directory.
- # smit alog_show
- Command can also be used for the same output on smit screen as that of alog command.
Fileset Revision Level Identification (FRLI)
- XX stands for Version (0-2)
- XX stands for release (0-2)
- XXXX stands for modification (1-4)
- XXXX stands for Fix level (1-4)
- # smit update_all command can also be used for modification and fix level information.
JFS stands for journeled file system.
- Hd1 : Home
- Hd2 : USR
- Hd3 : TMP
- Hd4 : ROOT
- Hd5 : BLV
- Hd6 : Paging Space
- Hd7 : Not Found
- Hd8 : JFS / JFS2
- Hd9 : VAR
- Hd10 : OPT
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.
Ent0 adapter will have 2 interfaces:
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
# 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.
# 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>
# 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>
# 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>
# 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:
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>
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
# 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.
This post is a brief overview about various PV commands and their significance. You can find about these commands in detail in previous posts.
Command will list all the devices in ODM.
Command is used to change the characteristics of a device(s).
Command is used to add devices to the system. Mkdev command is discussed in detail in this post.
Command is used to remove devices from the system. Rmdev command can be studied in detail in this post.
Command is used to change the state of PV in a VG.
Command is most frequently used and it displays information about PVs in VG.
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>
# 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>
# migratepv –l lv01 hdisk0 hdisk1
To verify migration, command used is:
# lslv –m <lvname>
This post is about the steps taken to remove or generate a new PV ID from the hard disk in the AIX BOX.
Every disk connected to the AIX Box and made available, has a PV ID associated to it. This PV ID can be changed with the help of commands as per the end user requirements.
Command to remove PV ID:
# chdev –l hdisk0 –a PV = clear
Command to generate a new PV ID:
# chdev –l hdisk0 –a PV = yes
Next post will discuss about Paging Space and Paging Space Administration.