Tuesday, January 8, 2013

Steps To Add Swap Space In AIX

1) Run lsps -a command to retrieve all the swap space in the system. #lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum hd6 hdisk2 rootvg 4608MB 81 yes yes lv 0 # 2) Run prtconf and look for hdisk2 physical volume. From below we noticed that there are free PPs so we are able to add more swap space. #prtconf ←-- snipped ----> ===================================================================== rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk2 active 639 172 35..00..00..09..128 hdisk3 active 639 172 35..00..00..09..128 ===================================================================== ←-- snipped ----> 3) To check more details on rootvg volume group follow this: #lsvg rootvg VOLUME GROUP: rootvg VG IDENTIFIER: 00f619aa00004c0000000131f69ac173 VG STATE: active PP SIZE: 32 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 1278 (40896 megabytes) MAX LVs: 256 FREE PPs: 344 (11008 megabytes) LVs: 11 USED PPs: 934 (29888 megabytes) OPEN LVs: 10 QUORUM: 1 (Disabled) TOTAL PVs: 2 VG DESCRIPTORS: 3 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 2 AUTO ON: no MAX PPs per VG: 32512 MAX PPs per PV: 1016 MAX PVs: 32 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable PV RESTRICTION: none INFINITE RETRY: no 4) To add 250MB swap space you need to add 8 PPs(8 x 32MB). # mkps -a -n -s 8 rootvg paging00 # 5)Verify the newly added paging space: #cat /etc/swapspaces * /etc/swapspaces * * This file lists all the paging spaces that are automatically put into * service on each system restart (the 'swapon -a' command executed from * /etc/rc swaps on every device listed here). * * WARNING: Only paging space devices should be listed here. * * This file is modified by the chps, mkps and rmps commands and referenced * by the lsps and swapon commands. hd6: dev = /dev/hd6 auto = yes checksum_size = 0 paging00: dev = /dev/paging00 Check the status using lsps command. #lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum hd6 hdisk2 rootvg 4608MB 78 yes yes lv 0 paging00 hdisk2 rootvg 250MB 0 yes yes lv 0 # Now to remove the paging space, we need to use the below commands. # swapoff /dev/paging00 # # rmps paging00 rmlv: Logical volume paging00 is removed. # #lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum hd6 hdisk2 rootvg 4608MB 78 yes yes lv 0#

Thursday, January 3, 2013

ksh: 0403-030 The fork function failed. Too many processes already exist.

ksh: 0403-030 The fork function failed. Too many processes already exist. Steps to resolve the above issue: 1) Check the process and look for defunct processes and owner of the process. Defunct process is zombie process and do not take much resources but in this cases caused too many files exist for the particular user which generate the above error. We have to kill this processes in order to release it. The only way is to kill the parent processes for that particular owner. Reboot help too but we can avoid it. 2) Communicate with the user and retrieve all the parent processes that running under this owner. Request permission to kill all the process in order to release all the defunct processes.

Wednesday, January 2, 2013

Linux Rename Eth0/Eth1 Network Interface Card Name [ Udev ]


We can use udev to change these settings.

Step #1: Find out the MAC address of the Ethernet device

Type the following command:
# ifconfig -a | grep -i --color hwaddr

Sample outputs:

#ifconfig -a | grep -i --color hwaddr
eth1      Link encap:Ethernet  HWaddr 00:0C:29:CD:5A:7F 
virbr0    Link encap:Ethernet  HWaddr 52:54:00:7F:E6:58 
virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:7F:E6:58 

Note down the MAC address.

Step #2: Rename eth0 as wan0

To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/ directory, enter:
# vi /etc/udev/rules.d/70-persistent-net.rules

The names of the Ethernet devices are listed in this file as follows:

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:cd:5a:7f", ATTR{type}=="1", KERNEL=="eth*", NAME
="eth1"


Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth1 will be renamed to wan0 (change NAME="eth1" to NAME="wan0"):


# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:cd:5a:7f", ATTR{type}=="1", KERNEL=="eth*", NAME
="wan0"

Save and close the file. Reboot the system to test changes:
# reboot

Verify new settings:
# ifconfig -a
# ifconfig wan0