Installing new versions of Java on RHEL

RHEL includes the alternatives command providing the ability to point your users to different versions of software while not changing their links to the command.  For example if you wanted a specific version of JAVA this can be done with PATH changes or alternatives

man alternatives

for exact info.

For Java

/usr/sbin/alternatives --install /usr/bin/java java /location_to_new_java

/usr/sbin/alternatives --config java

Repeat for javac

Finally, set the environment for everyone on the machine by creating a java.sh script in /etc/profile.d:

#!/bin/sh
export JAVA_HOME=/usr/java/jdk
export JRE_HOME=$JAVA_HOME/jre
export J2RE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$J2RE_HOME/bin:$PATH

Find HBA WWID in RHEL

Finding information about your fibre channel cards in RHEL is pretty easy with qlogic cards look at:

cat  /sys/class/fc_host/host*/

files in here provide a log of info WWID’s are stored in:


cat  /sys/class/fc_host/host*/port_name

Vmware ESX change service console memory

So everytime you setup ESX you need to max out your service console memory to 800MB’s this can be done two ways.. the service console or gui both require that you reboot the node after making the change.

Via Service console:

Log in via root and type

  1. vmkpcidivy -i
  2. Press enter when prompted for the boot image
  3. Press enter when prompted for the name of the configuration
  4. Type 800mb when asked about memory
  5. Press enter to accept defaults until you exit
  6. Reboot node

Via gui

  1. Goto Inventory
  2. Configuration
  3. Memory
  4. Enter 800mb
  5. reboot node

Backup and restore your mbr (master boot record)

In Linux making block level copies of area’s is easy with the magical dd utility.   So to backup the mbr (first 512 bytes)  use this command (assuming your boot drive is hda)

dd if=/dev/hda of=/root/mbr_backup bs=512 count=1

Now in /root/mbr_backup you have a complete copy of your mbr.   BS means byte size and count means only (once) first 512.

To delete the mbr (not the partition table):

dd if=/dev/zero of=/dev/hda bs=446 count=1

To delete the mbr and partition:

dd if=/dev/zero of=/dev/hda bs=512 count=1

Restore the mbr:

dd if=/root/mbr_backup of=/dev/hda bs=512 count=1