Author: Emerson .

Error updating RHEL package: Cannot retrieve repository metadata for repository: rhel-x86_64-server-5

I made a local repository on my network to avoid updating the package through the internet. But my system was giving me the following error

root@linux:~ # yum update nscd
Loaded plugins: rhnplugin, security
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-x86_64-server-5. Please verify its path and try again

To solve this problem, I disabled the rhnplugin

root@linux:~ # vi /etc/yum/pluginconf.d/rhnplugin.conf
[main]
enabled = 0
gpgcheck = 1

# You can specify options per channel, e.g.:
#
#[rhel-i386-server-5]
#enabled = 1
#
#[some-unsigned-custom-channel]
#gpgcheck = 0

cannot fork [Resource temporarily unavailable]

Tried to login to a Linux server but gave the error cannot fork [Resource temporarily unavailable]

ssh oracle@linux
/etc/profile[62]: .[5]: .: line 46: cannot fork [Resource temporarily unavailable]

Saw how many processes oracle user has

root@linux:~ # ps -ef | grep oracle | wc -l
2038

Then increased the number of processes

root@linux:~ # vi /etc/security/limits.conf
#oracle soft nproc 2048
oracle soft nproc 4096

Configuring HP-UX routes

Add or delete a route to a specific host:

root@hp-ux:/ # route add host 192.168.1.1 192.168.0.1 1

root@hp-ux:/ # route delete host 192.168.1.1 192.168.0.1

Add or delete a route to a network

root@hp-ux:/ # route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.1 1

root@hp-ux:/ # route delete net 192.168.1.0 netmask 255.255.255.0 192.168.1.1

Add or delete a default route

root@hp-ux:/ # route add default 192.168.0.1 1

root@hp-ux:/ # route delete default 192.168.0.1

Flush all gateway entries from the routing table

root@hp-ux:/ # route -f

Saving the IP Routing Configuration

root@hp-ux:/ # vi /etc/rc.config.d/netconf
ROUTE_DESTINATION[0]=”net 129.1.0.0″
ROUTE_MASK[0]=”255.255.0.0″
ROUTE_GATEWAY[0]=”128.1.0.1″
ROUTE_COUNT[0]=”1″
ROUTE_ARGS[0]=””
ROUTE_SOURCE[0]=””
ROUTE_DESTINATION[1]=”default”
ROUTE_MASK[1]=””
ROUTE_GATEWAY[1]=”128.1.0.1″
ROUTE_COUNT[1]=”1″
ROUTE_ARGS[1]=””
ROUTE_SOURCE[1]=””

Update HP iLO Firmware on HP Proliant

To update the HP iLO, go to this page http://h18013.www1.hp.com/products/servers/management/iloadv3/index.html and under the section Products Firmware and Tools, click on the version that your server has and download the firmware.

Download the file according to your Operating System. My OS is a Red Hat Enterprise Linux 5, so I downloaded the file and then copied to the server.

iLO 1 v.1.96 – CP023365.scexe
iLO 2 v.2.29 – CP027871.scexe
iLO 3 v.1.20 – CP014002.scexe
You first need to have at least iLO 3 version 1.20 to update to later versions
iLO 3 v.1.85 – CP026424.scexe
iLO 4 v.2.30 – CP026236.scexe

To update, you run the file as shown below

root@linux:/tmp # bash ./CP018561.scexe

FLASH_iLO3 v1.09 for Linux (Jan 23 2013)
(C) Copyright 2002-2013 Hewlett-Packard Development Company, L.P.
Firmware image: ilo3_155.bin
Current iLO 3 firmware version 1.26; Serial number ILOBRC14004X5

Component XML file: CP018561.xml
CP018561.xml reports firmware version 1.55
This operation will update the firmware on the
iLO 3 in this server with version 1.55.
Continue (y/N)?y
Current firmware is 1.26 (Aug 26 2011 )
Firmware image is 0x801664(8394340) bytes
Committing to flash part…
******** DO NOT INTERRUPT! ********
Flashing is underway… 67 percent programmed. –

After the flashing finishes, wait a few minutes for iLO to restart

******** DO NOT INTERRUPT! ********
Flashing completed.
Attempting to reset device.
Succeeded.
***** iLO 3 reboot in progress (may take up to 60 seconds.)
***** Please ignore console messages, if any.
iLO 3 reboot completed.

If the update fails, follow the instructions on this page Error when updating iLO2 in HP Proliant to unpack the files in the self-executable and try to update the iLO using the web interface.

HP-UX: root password expired in a trusted system

There is an HP-UX system that had the root password expired

user@linux:~ $ ssh root@hp-ux
Last successful login for root: Mon Apr 1 13:01:33 BRA3BDT 2013
Last unsuccessful login for root: Mon Apr 1 13:02:14 BRA3BDT 2013
Your password has expired.
Last login: Mon Apr 1 13:01:33 2013 from 172.16.4.198
Changing password for root
Old password:
Sorry.

I was unable to change the password since it is not known

root@hp-ux:/root # passwd root
Changing password for root
Old password:
Sorry.

Since there is no /etc/shadow file because this is a trusted system, to delete the root password you go to the /tcb/files/auth/r/root and delete the password from the :u_pwd attribute

root@hp-ux:/tcb/files/auth/r # cat root
root:u_name=root:u_id#0:\
:u_pwd=2576d348b7120d068cf812db81d2a414:\
:u_bootauth:u_auditid#0:\
:u_auditflag#1:\
:u_succhg#1348864982:u_unsucchg#1364832324:u_pswduser=root:u_suclog#1364832138:\
:u_unsuclog#1364832144:u_numunsuclog#1:u_maxtries#0:u_lock@:\
:chkent:

Then you should not have a problem to change the password

root@hp-ux:/tcb/files/auth/r # passwd root
Changing password for root
Last successful password change for root: Fri Sep 28 17:43:02 2012
Last unsuccessful password change for root: Mon Apr 1 13:05:24 2013

Do you want (choose one letter only):
pronounceable passwords generated for you (g)
a string of letters generated (l) ?
to pick your passwords (p) ?

Enter choice here: p
New password:
Re-enter new password:
Passwd successfully changed

AIX – Mirroring a logical volume

Check the logical volume to be mirrored

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 64 7 open/syncd /data

Run the command below to make two copies of this logical volume

root@aix:/ # mklvcopy mirroring 2

Then start syncing the volume group

root@aix:/ # nohup syncvg -v datavg &

To verify that the volume is mirrored, verify if the column PPs is the double of the column LPs

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 128 14 open/stale /data

HP-UX – Import a volume group

To import a volume group in HP-UX you need to specify the disks that are part of this volume group. In the example below, the volume group only has one disk

root@hp-ux:/# vgimport /dev/vgomni /dev/disk/disk22
vgimport: Volume group “/dev/vgomni” has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

After activacting the volume groups

root@hp-ux:/# vgchange -a y
Volume group “/dev/vg00” is already active on this system.
Activated volume group.
Volume group “/dev/vgomni” has been successfully changed.

And I took a backup of the volume group configuration

root@hp-ux:/# vgcfgbackup /dev/vgomni
Volume Group configuration for /dev/vgomni has been saved in /etc/lvmconf/vgomni.conf

HP-UX vgdisplay: /etc/lvmtab: No such file or directory

root@hp-ux:/ # vgdisplay
vgdisplay: /etc/lvmtab: No such file or directory
vgdisplay: No volume group name could be read from “/etc/lvmtab”.

To recreate the /etc/lvmtab, run vgscan -a to make it rescan all the multipathed physical volumes

root@hp-ux:/ # vgscan -a
Creating “/etc/lvmtab”.

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c77t0d1
/dev/dsk/c79t0d1
/dev/dsk/c81t0d1
/dev/dsk/c83t0d1
/dev/dsk/c85t0d1
/dev/dsk/c89t0d1
/dev/dsk/c91t0d1
/dev/dsk/c87t0d1

The Volume Group /dev/vg01 was not matched with any Physical Volumes.
The Volume Group /dev/vgomni was not matched with any Physical Volumes.
*** LVMTAB has been created successfully.
*** If PV links are configured in the system.
*** Do the following to resync information on disk.
*** #1. vgchange -a y
*** #2. lvlnboot -R

Then depending on your system you may need to run vgimport against some disks in your server

HP Multipath Device Mapper for Linux Software

Previously HP had a kit to enable the native open-source multipathing solution called Device Mapper Multipath Enablement Kit for HP StorageWorks Disk Arrays

Nowadays HP recommends to read a document called Native Linux Device-Mapper Multipath for HP StorageWorks Disk Arrays reference guide to enable the native open-source multipathing solution.

Linux – Adding timestamp to history

root@linux:~ # history
2 2013-03-18 15:08:24 vi df_mon.cfg
3 2013-03-18 15:08:38 /var/opt/OV/bin/instrumentation/UXMONbroker -d psmon
4 2013-03-18 15:08:41 ps -ef |grep -i scopeux
5 2013-03-18 15:09:11 perfstat

To have the time and date of when the command is issued when using the bash shell, add the following statement to your .bashrc file

export HISTTIMEFORMAT=”%F %T “