Friday, April 20, 2012

How To Recover Lost Root Passwd on Linux Server (Using Rescue cd)

Situation

Lost or forgot the root password on Linux server

Resolution

  1. Boot server from the installation CD.
  2. Then select any installation method or Rescue System.
  3. At the first installation screen when selecting language, press ctrl-alt-f2 to open a virtual console.

    Note: If you selected Rescue System, select your keyboard language and then a Rescue Login prompt should appear. Login as root.

  4. Type
    fdisk -l
    to list the partitions. Locate the Linux root partition.
  5. Type
    mount /dev/sda4 /mnt
    (replace sda4 with the device name for the Linux root partition identified in the previous step).
  6. Run
    mount -o bind /dev /mnt/dev
    to make the device files available (this is needed for access to the urandom device which may be used by thepasswd command below).
  7. Enter
    chroot /mnt
  8. Now enter
    passwd root
    and reset the root password.
  9. Type
    exit
    to leave the chroot environment.
  10. Reboot the system.

How To Recover Lost Root Passwd on SLES or OpenSuse

It can be done many ways, but the easiest is by accessing single mode.

1. Need to reboot first.

2. Append boot option to single mode

If on other linux distribution, we can access to single mode by appending the kernel and type "single" and change the passwd after that.

But on SLES or OpenSuse, we need to add an parameter to boot option which is :

init=/bin/sh (refer to pic)




and dont forget to press enter.

3. After the single mode is loaded, kindly change passwd by using the "passwd" command

your-hostname:~ # passwd
Changing password for root.
New Password:

Reenter New Password:
Password changed.


4. Reboot and it was done successfully.

Wednesday, March 21, 2012

The correct way to add IP aliases (multiple IPs) on one device in SuSe Linux 10 (and below)

I've always been used to the Redhat/Fedora way of setting up aliases in /etc/sysconfig/network-scripts-ifcfg-: but SuSe/Novell Linux is slightly different. I see a lot of hackish examples/bad advice on the internet on how to set it up on SuSe/Novell Linux so I figured I'd make a note of it here.

To do it "right" under SuSe, you modify the main configuration file for your ethernet adapter.

For example, 'ifcfg-eth-id-de:ad:co:ed:ba:be' where the de:ad:co:ed:ba:be is replaced by a real MAC address.

As an example, you want the main IP of the system to be statically set to 192.168.100.1, and the other IPs to be 192.168.100.100, 192.168.100.101, and 192.168.100.102

Your original configuration will probably look something like this:

BOOTPROTO='static'
BROADCAST='192.168.100.255'
IPADDR='192.168.100.100'
MTU=1500
NAME='My awesome no-name PCI \"bus-mastering\" NE-2000 clone $1.99 CPU-cycle-hogging wondercard'
NETMASK='255.255.255.0'
NETWORK='192.168.100.0'
REMOTE_IPADDR=''
STARTMODE='onboot'
USERCONTROL='no'
_nm_name='bus-pci-0000:01:04.0'

You will want to change it to look like this:

BOOTPROTO='static'
BROADCAST='192.168.100.255'
IPADDR='192.168.100.100'
MTU=1500
NAME='My awesome no-name PCI \"bus-mastering\" NE-2000 clone $1.99 wondercard'
NETMASK='255.255.252.0'
NETWORK='192.168.100.0'
REMOTE_IPADDR=''
STARTMODE='onboot'
USERCONTROL='no'
_nm_name='bus-pci-0000:01:04.0'
IPADDR1='192.168.100.100'
NETMASK1='255.255.255.0'
LABEL1='0'
IPADDR2='192.168.100.101'
NETMASK2='255.255.255.0'
LABEL2='1'
IPADDR3='192.168.100.102'
NETMASK3='255.255.255.0'
LABEL3='2'

Save that and restart networking with '/etc/init.d/network restart' and you are good to go with:
eth0 set to 192.168.100.1
eth0:0 set to 192.168.100.100
eth0:1 set to 192.168.100.101
eth0:2 set to 192.168.100.102

The 'LABELx' settings are just setting the alias label you see after the 'eth0:'
You can get away with leaving out the 'LABELx' statements. One side effect is that you won't see the aliases under 'ifconfig'.

I know you can do this with 'yast' and other utilities but this seems more direct and easier to do on a high latency SSH console.

Credit to :

Tuesday, September 13, 2011

IBM Blade Center H : Blade Firmware Hang

If you found this symtomp at your blade server :

1. amber led alert at blade
2. keyboard is blinking
3. server cannot be accessed

You have to follow these steps :

1. Force shutdown
2. Reboot the server
3. During post message, press F2 to enter "Diagnostics"
4. Run the DSA
5. After finish, check to "Report Highlights", major error will be listed like below image :



Solution :

1. Need to update the firmware
2. Download from IBM support, the firmware is called as BOMC
3. Put the firmware into the usb drive
4. Reboot the server and press F12 to choose the boot media.
5. Choose boot from usb
6. Firmware installation will be boot up.
7. Choose to update all firmware.
8. After finish,reboot is required.
9. Solved

DB2 Backup Failure : Hard Disk Is Full

If you found this SQLCA Information like this after running "db2 list history backup all for (db_name)". This means that the root cause is hard disk if already full.

====================================================================================

SQLCA Information

sqlcaid : SQLCA sqlcabc: 136 sqlcode: -2419 sqlerrml: 37

====================================================================================

DB2 Backup Status Indicator

This info is generated when running "List History Backup All For (db_name)"

===========================================================================

Comment: DB2 BACKUP ABCD ONLINE
Start Time: 20060823230001
End Time: 20060824001941
Status: A

===========================================================================

A : Active
I : Inactive
E : Expired
D : Deleted


Referrence : http://bytes.com/topic/db2/answers/527376-list-history-backup-status

How To Check DB2 Backup History

Follow these steps in terminal :

1. su - db2inst1
2. . ./sqllib/db2profile
3. db2 list history backup all for (db name)

Example : db2 list history backup for all user_db