Tech Blog

These are blog entries written by the UNIX Health Check development team. Our team has extensive technical experience on both AIX and Red Hat systems, and we like to share our knowledge with our visitors.

Topics: Red Hat / Linux

ILO: Using Virtual Media with the Command-Line Interface

ISOs may be loaded from an HTTP server using Virtual Media with the iLO command-line interface.

Example:

$ ssh -l ilo-admin 10.215.14.5
User:ilo-admin logged-in to ilo.(10.215.14.5)
iLO Advanced 1.82 pass1 at 15:53:34 Aug 22 2005
Server Name: ilo
Server Power: On

hpiLO-> vm cdrom insert http://10.251.20.20/RHEL4.6-i386-ES.iso
Note: use IPs when specifying an HTTP server.
hpiLO-> vm cdrom get
VM Applet = Disconnected
Boot Option = NO_BOOT
Write Protect = Yes
Image Inserted = Connected
Image URL = http://10.251.20.20/RHEL4.6-i386-ES.iso
Note: the "NO_BOOT" means that the system will not boot off the "connected" image. And the "Image URL" option is not shown with ILO version 1.
hpiLO-> vm cdrom set boot_once
Note: The next boot will be from the connected image. You can also use "vm cdrom set connect" to permanently connect the ISO image. If you want to get rid of the ISO image, use "vm cdrom eject".
hpiLO-> power reset
Now, the server will reboot and boot off the ISO image. If you ever run into a situation where it won't boot of the ISO image, but simply skips over booting from the CDROM, then make sure to check if any physical cables are connected to the server, for example, KVM cables or USB keyboards. If this is the case, the server will not boot of any virtual media. Unplug those cables and reboot again, to make the server boot of the ISO image.

Topics: LVM, Red Hat / Linux, Storage

Howto extend an ext3 filesystem in RHEL5

You can grow your ext3 filesystems while online: The functionality has been included in resize2fs so to resize a logical volume, start by extending the volume:

# lvextend -L +2G /dev/systemvg/homelv
And the resize the filesystem:
# resize2fs /dev/systemvg/homelv
By omitting the size argument, resize2fs defaults to using the available space in the partition/lv.

Topics: Installation, Red Hat / Linux

Linux Kickstart using a configuration file on a USB thumbdrive

In case you're wondering "How do I load a kickstart configuration file on my USB thumbdrive, while installing Linux?", we can tell you, it is really simple. You only have to know the syntax to do this.

First, make sure that both the Linux DVD and the USB thumdrive are connected to the system, either directly, or through virtual media. Then, to install linux, type:

# linux ks=hd:sdc:/ks.cfg
(Replace "ks.cfg" with the actual Kickstart configuration file name)

More information can be found here: This is similar to a bos_inst.data, and lppsource definition in one file. Every Linux installation will generate one of these based on the selections made during the install. It usually can be found in /home/root/ks.cfg or sometimes /root/ks.cfg. The installer (anaconda) will tell you which of the two locations to look. This file can then be used to do various degrees of hands on/of installations. Also, a vendor may supply a ks.cfg file of their own for use to use.

Topics: Networking, Red Hat / Linux

Howto Red Hat Enterprise Linux 5 configuring the network

Red Hat LogoRed hat Linux provides following tools to make changes to Network configuration such as add new card, assign IP address, change DNS server, etcetera:

  • GUI tool (X windows required) - system-config-network
  • Command line text based GUI tool (No X windows required) - system-config-network-tui
  • Edit configuration files directly, stored in /etc/sysconfig/network-scripts directory
The following instructions are compatible with CentOS, Fedora Core and Red Hat Enterprise Linux 3, 4 and 5.

Editing the configuration files stored in /etc/sysconfig/network-scripts:

First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:
  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file
To edit/create the first NIC file, type the following command:
# vi ifcfg-eth0
Append/modify as follows:
# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.251.17.204
NETMASK=255.255.255.0
ONBOOT=yes
Save and close the file. Define the default gateway (router IP) and hostname in /etc/sysconfig/network file:
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=host.domain.com
GATEWAY=10.251.17.1
Save and close the file. Restart networking:
# /etc/init.d/network restart
Make sure you have correct DNS server defined in /etc/resolv.conf file. Try to ping the gateway, and other hosts on your network. Also check if you can resolv host names:
# nslookup host.domain.com
And verify if the NTP servers are correct in /etc/ntp.conf, and if you can connect to the time server, by running the ntpdate command against one of the NTP servers:
# ntpdate 10.20.30.40
This should synchronize system time with time server 10.20.30.40.

Topics: Red Hat / Linux

Dmidecode

Should you ever need hardware information from your Linux server, then a very useful command is dmidecode. it is a tool for dumping a computer's DMI table contents in a human-readable format. This table contains a description of the system's hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision.

For example:

# dmidecode | awk 'BEGIN {RS = "\n\n"} /System Information/'
Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: HP
        Product Name: ProLiant DL360 G5
        Version: Not Specified
        Serial Number: MX8Q835AYV
        UUID: 34353379-3232-4D85-5183-333843155695
        Wake-up Type: Power Switch
        SKU Number: 457922-001
        Family: ProLiant

Topics: AIX, Red Hat / Linux, System Admin

Change the PuTTY title

When you have a lot of Putty screens, or if you frequently login to a host through a jump server, it's very easy to set the title of the Putty window, for exmaple to the hostname of the server you're currently logged into. This way, you'll easily recognize each telnet screen, and avoid entering -possibly destructive- commands in the wrong window:

echo "\033]0;`hostname`\007"
For example, you can add this line to /etc/profile, and have the hostname of the PuTTY title set automatically.

Topics: HMC, Red Hat / Linux

Installing Linux websm client from HMC version 3.3.6

How do you install the Linux Web Based System Manager (websm) client from an HMC version 3.3.6, if your only access to the system is through ssh? The following procedure can be used:

First, get the Linux websm software of the HMC to the Linux system:

# ssh -l hscroot hmc ls -als /usr/websm/pc_client/*
# cd /tmp
# scp hscroot@labhmc1:/usr/websm/pc_client/*linux* .
Install the java2 runtime environment:
# rpm -ihv *rpm
Install websm:
# ./wsmlinuxclient.exe -silent
Install some additional software required:
# yum install libXp compat-libstdc*
Run websm:
# /opt/websm/bin/wsm

Topics: AIX, Red Hat / Linux, System Admin

Remote file system copy

How to copy a filesystem from one server to another:

Make sure you can execute a remote shell on the target host (by adding an entry of the source host in the /.rhosts file). Login to the source system as root and enter:

# (cd LOCAL_MOUNTPOINT && tar cpvBf - . ) | rsh REMOTEHOST 'cd REMOTE_MOUNTPOINT && tar xpvBf -'
For ssh, use the following command:
# tar -cf - myfiles | ssh user@host "umask 000 ; cat | tar -xpf -"
You might also have run into the problem that, when FTP'ing CD software on a Windows PC to a remote AIX system, files with lowercase names suddenly change to uppercase file names. This is how to copy the complete contents of a CD on a Red Hat Linux system to a remote AIX system as a tar file:
  • Login as root on the Linux system.
  • Mount the CD-ROM:
    # mount /mnt/cdrom
    # cd /mnt/cdrom
    
  • Tar the contents:
    # tar -cvf - . | ssh userid@hostname "cd /path/to/where/you/want/it/on/the/target/system ; cat > filename.tar"
  • Unmount the CD-ROM:
    # cd /
    # umount /mnt/cdrom
    
Important note: make sure you can write with your user-ID in the target folder on the target system. Otherwise your tar file might end up in the home directory of the user-ID used.

Topics: AIX, Red Hat / Linux

Line numbers in VI

To display line numbers in VI: Press ESC, then type

:set number
To remove the line numbers again, type
:set nonumber

Topics: Red Hat / Linux, Security

Accessing ILO through SSH tunnelling

To manage Linux server, running on HP blades, you need to be able to access the ILO. Without it, you won't be able to remotely access the console or to reboot the server. If your ILO is on a separate network and your only access is through SSH, it can be difficult to access the ILO, since the web-based GUI is only supported in Microsoft Internet Explorer. By means of SSH tunneling however, it is possible to access the ILO.

First, you need to have a UNIX box which is capable of accessing the ILO directly through SSH (in our example called "jumpserver"). Also, you'll need to have the ILO's IP address.

On your Linux client in a system console (let's assume, this client is called "desktop"), create the SSH tunnel and forward the correct ports needed for ILO access, by running as user root:

# ssh -g -L 23:10.250.21.38:23 -L 443:10.250.21.38:443 -L 17988:10.250.21.38:17988 -L 3389:10.250.21.38:3389 jumpserver -N
This will create the SSH tunnel, open up ports 23, 443, 17988 and 3389 through host "jumpserver" to IP address 10.250.21.38. Of course, adjust the name of the jumpserver and the IP address of the ILO to your configuration.

Now open up an Internet Explorer on a Windows PC (which is capable of accessing the Linux client "desktop"), and point your browser to https://desktop. You should see the login screen of the ILO.

When you're done working on the ILO, simply type CTRL-C in the system console on "desktop".

Likewise, you can do something similar to this, if you don't have a Linux client (like "desktop" in the example above) to work with, by using PuTTY on a Windows PC. In this case, configure PuTTY to set up a SSH tunnel to the "jumpserver" and forward the same ports. Then open up Internet Explorer, and point your browser to https://localhost, which should then open up the ILO login screen.

Number of results found for topic Red Hat / Linux: 103.
Displaying results: 71 - 80.