Tricks

1. To mirror a terminal1 on terminal2
a. Open terminal 1 and find the pts value (ps -ef grep pts)
b. Open terminal 2 and enter 'portmir -t pts/1'
c. Now you will see commands and outputs from terminal 1 in terminal 2.
This is basically monitor a terminal.
d. Say "portmir -o" to end the mirroring after the use

2. Reset an Unknown Root Password

The following procedure describes how to recover access to root privileges when the system's root password is unavailable or unknown. The following procedure requires some system downtime. If possible, schedule your downtime when it least impacts your workload to protect yourself from a possible loss of data or functionality.

1. Insert the product media for the same version and level as the current installation into the appropriate drive.
2. Power on the machine.
3. When the screen of icons appears, or when you hear a double beep, press the F1 key repeatedly until the System Management Services menu appears.
4. Select Multiboot.
5. Select Install From.
6. Select the device that holds the product media and then select Install.
7. Select the AIX version icon.
8. Define your current system as the system console by pressing the F1 key and then press Enter.
9. Select the number of your preferred language and press Enter.
10. Choose Start Maintenance Mode for System Recovery by typing 3 and press Enter.
11. Select Access a Root Volume Group. A message displays explaining that you will not be able to return to the Installation menus without rebooting if you change the root volume group at this point.
12. Type 0 and press Enter.
13. Type the number of the appropriate volume group from the list and press Enter.
14. Select Access this Volume Group and start a shell by typing 1 and press Enter.
15. At the # (number sign) prompt, type the passwd command at the command line prompt to reset the root password. For example:

# passwd
Changing password for "root"
root's New password:
Enter the new password again:

16. To write everything from the buffer to the hard disk and reboot the system, type the following:
sync;sync;sync;reboot

When the login screen appears, the password you set in step 15 should now permit access to root privileges.

3. How to disable telnet in AIX

#vi /etc/inetd.conf

comment out telnet from this file (#telnet ... ... .. )
save it and
#refresh -s inetd
Then telnet session will be disabled in that server from now

4. Fix a corrupted BLV in AIX

Recreate BOOT LOGICAL VOLUME (BLV) in AIX


If a Boot Logical volume (BLV) is corrupted, a machine will not boot.
(Eg:bad block in a disk might cause a corrupted BLV)

To fix this situation, You must boot your machine in maintenance mode, from a CD or Tape. If a NIM has been setup for a machine, you can also boot the machine from a NIM master in maintenance mode.

The bootlists are set using the bootlist command or through the System Management Services Progam (SMS). pressing F1 will go to SMS Mode.
then change the bootlist for service(maintenance) mode as 1st device to CD ROM.

#bootlist -m service cd0 hdisk0 hdisk1

then start maintenance mode for system recovery,

Access rootvg,


access this volum group to start a shell,

then recreate BLV using bosboot command.

#bosboot -ad /dev/hdisk0

it's important that you do a proper shutdown, All changes need to be written from memory to disk.
#shutdown -Fr

Important: bosboot command requires that boot logical volume hd5 exists. If you want to create a BLV ( may be it had been deleted by mistake ), do the following,

1. boot your machine in maintenance mode,
2. Create a new hd5 logical volume, one PP size, must be in rootvg,specify boot as logical volume type,

#mklv -y hd5 -t boot rootvg 1

3. Then run bosboot command as described.

If you have an HMC, then at the time of booting select boot as SMS in the properties of that partition

5. Link Aggregation in AIX
Link Aggregation ( Network Bonding ) in AIX

Link aggregation means you can give one IP address to two network cards and connect to two different switches for redundancy purpose. In this only one network card will be active in one time, and when it got failed the other network card goes active and let us continue our work.

It is better to use through SMIT.

#smit
then goto
Devices > Communication > EtherChannel / IEEE 802.3ad Link Aggregation > Add An EtherChannel / Link Aggregation
here select the network card that you want to use, ie active.
Eg: select ent0

Important: then select Mode as 8023ad

then select backup adapter for redundancy.(press F4 to show N/W adapters.)
Eg: ent1

press enter.

now ent0 and ent1 got bonded.
then automatically a virtual adapter will be created named ent2.

then put IP address and all to this virtual adapter.

#smit
Communications Applications and Services > TCP/IP > Minimum Configuration & Startup
here select ent2 ( new bonded virtual adapter )
put IP Address and all, give start now option.

Now you are successfully completed Link aggregation and check whether it works or not by removing the 2nd cable to the network card and check ping, then put the 2nd cable and remove 1st cable. 2 - 3 drops normally occurs in my experience.

6. Configure NTP Server on AIX

1.Verify that you have a suitable NTP server.
#lssrc -ls xntpd

Note : sys peer should show a valid server or 127.127.1.0

If the server is "insane", you should need to correct it by adding a server line into /etc/ntp.conf and restarting xntpd.

Following these steps
#vi /etc/ntp.conf
Add server :
server 127.127.0.1
Double check that "broadcastclient" is commented.
#stopsrc -s xntpd
#startsrc -s xntpd

Note : If the server runs databases, use the -x flag to prevent the clock from changing in a negative direction. Enter the following:

#startsrc -s xntpd -a "-x"

2.Enter
#lssrc -ls xntpd

to verify that the server is synched. This process can take upto 12 minutes.

Configure NTP Client on AIX

1. Verify that you have a server suitable for synchronization, Enter:

#ntpdate -d ip.address.of.server

The offset must be less than 1000 seconds for xntpd to synch. If the offset is greater than 1000 seconds, change the time manually on the client and run ntpdate -d again.

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server (see above )and that no firewalls are blocking port 123.

2. Specify your xntpd server in /etc/ntop.conf, Enter

#vi /etc/ntp.conf

comment "broadcastclient" line and add

server ip.address.of.server prefer

leave the driftfile and tracefile at their defaults.

3. start the xntpd daemon,
#startsrc -s xntpd
( use the -x flag if it is appropriate in your environment.)

4. Uncomment xntpd from /etc/rc.tcpip so it will start on reboot.
#vi /etc/rc.tcpip
Unconmment the following line
start /usr/sbin/xntpd "$src-running"

If using the -x flag, add "-x" to the end oof the line. you must include the qoutes around "-x"

5. verify that the client is synched.

#lssrsc -ls xntpd

Note: sys peer should display the IP Adress or name of your xntpd server.This process may take 12 minutes.

2 comments:

Unknown said...

good one mohi

Unknown said...

Nice work....! But I want to know is there any data lost which reset root password by following this method. We ha SAP AS Server running on this machine. and forgot password. tried many time to hit but no success. please guide.

Post a Comment