This blog contains experience gained over the years of implementing (and de-implementing) large scale IT applications/software.

Corrupt OEL 5.7 ISO Prevents Boot into Installer

I ran into this little problem whilst trying to install OEL 5.7 into a Hyper-V environment.

Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(xxx,xx)“.

I tried all different manner of parameters with “linux xxxxx” as recommended by the installer.
None of these worked.
It looked like the Hyper-V drivers weren’t working at first.

So I re-downloaded the OEL 5.7 ISO, and re-attached to the VM cd-rom.
Then it worked!
Must have been a corrupt OEL 5.7 ISO that prevented it booting into install/setup from Hyper-V.

HowTo: OEL/RHEL 5.7 Create New VolGroup and LVol for new disk

If you need to add an additional mount point onto a RHEL or OEL Linux server, here’s how to do it using the logical volume manager for maximum flexibility:

We assume that you’ve added a new physical disk and that it’s called /dev/sdb.

First check size of the device to ensure you’ve got the correct one:

# fdisk -l /dev/sdb

Now create a new primary partition on the disk:

# fdisk /dev/sdb
n        (new partition)
p        (primary partition)
1        (partition number)
<return> for 1st block
<return> for last block
w       (write config)
q       (quit)
Check you can see the new partition:

# ls -la /dev/sdb*

(You should see /dev/sdb1)

Now ensure that you create a new physical volume that the volume manager can see:

# pvcreate /dev/sdb1

Physical volume "/dev/sdb1" successfully created

Create a new Volume Group containing the new physcial partition:

# vgcreate VolGroup01 /dev/sdb1

Volume group "VolGroup01" successfully created

Create a new logical volume inside the volume group:

# lvcreate -L 480GB -n LogVol01 VolGroup01

Logical volume "LogVol01" created

Format the new logical volume using EXT3 (you can choose which version of EXT you want):

# mkfs -t ext3 /dev/VolGroup01/LogVol02

Now you just need to mount the partition up.

HowTo: Know if you’re using pure RedHat, CentOS or Oracle Enterprise Linux

Scenario: You been given access to a server and you don’t know if it’s a pure RedHat, CentOS or Oracle Enterprise Linux server.

We all know how to query the version of the Linux OS using the following :

> uname -a

> cat /etc/redhat-release

But these don’t necessarily differentiate between a pure RedHat O/S and the downstream Linux distributions such as CentOS or Oracle Enterprise Linux.

As well as the above, you can query what’s been installed through RPM:

> rpm -qa | grep oraclelinux

> rpm -qa | grep centos

Any output in one or the other will confirm an OEL or CentOS distribution.

HP MSL 2024 LTO Tape Library on Oracle Enterprise Linux 5.7 (RHEL 5.7)

Whilst working on a HP ProLiant ML370 G6 server running Linux kernel 2.6.18 (Oracle Enterprise Linux 5.7), I was trying to get the O/S to see an HP MSL 2024 LTO-4 tape drive and library.

After a reboot, there was still no sign of the “st” device in /dev:

> ls -l /dev/st[0-9]*

And no SCSI device listed other than the DVDROM:

> cat /proc/scsi/scsi

Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: hp Model: DVDROM DH40N Rev: IS01
Type: CD-ROM ANSI SCSI revision: 05

I found the following “page” very helpful:
https://www.kernel.org/doc/Documentation/blockdev/cciss.txt

It mentioned the HP Smart Array driver, also known as cciss.
I checked I had one of these puppies:

> lspci |grep Array
05:00.0 RAID bus controller: Hewlett-Packard Company Smart Array G6 controllers (rev 01)
1b:00.0 RAID bus controller: Hewlett-Packard Company Smart Array G6 controllers (rev 01)

Yep, I had two.
I checked the Kernel module for cciss was loaded:

> lsmod | grep cciss
cciss 125033 3
scsi_mod 199129 12 be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2,scsi_transport_iscsi2,sr_mod,sg,libata,cciss,sd_mod

Yep, it was loaded.
Also notice that the scsi_mod has 12 modules referenced.

So my problem was probably like the “page” I pointed out suggested:

Additionally, note that the driver will not engage the SCSI core at init
time. The driver must be directed to dynamically engage the SCSI core via
the /proc filesystem entry which the “block” side of the driver creates as
/proc/driver/cciss/cciss* at runtime. This is because at driver init time,
the SCSI core may not yet be initialized (because the driver is a block
driver) and attempting to register it with the SCSI core in such a case
would cause a hang. This is best done via an initialization script
(typically in /etc/init.d, but could vary depending on distribution).

Note the words “dynamically engage”.
They are not written like that for fun. Guess what was required? Yep, I need to engage the SCSI core:

> ls -l /proc/driver/cciss
-rw-r--r-- 1 root root 0 Mar 15 14:16 cciss0
-rw-r--r-- 1 root root 0 Mar 15 14:16 cciss1

> echo "engage scsi" > /proc/driver/cciss/cciss0
> echo "engage scsi" > /proc/driver/cciss/cciss1

Now load the “st” tape module into the Kernel:

> modinfo st
filename: /lib/modules/2.6.18-274.0.0.0.1.el5/kernel/drivers/scsi/st.ko
alias: char-major-9-*
license: GPL
description: SCSI tape (st) driver
author: Kai Makisara
srcversion: AA839FAA66A7758BC7A5C9D
depends: scsi_mod
vermagic: 2.6.18-274.0.0.0.1.el5 SMP mod_unload gcc-4.1
parm: buffer_kbs:Default driver buffer size for fixed block mode (KB; 32) (int)
parm: max_sg_segs:Maximum number of scatter/gather segments to use (256) (int)
parm: try_direct_io:Try direct I/O between user buffer and tape drive (1) (int)
parm: try_rdio:Try direct read i/o when possible (int)
parm: try_wdio:Try direct write i/o when possible (int)
module_sig: 883f3504e2dbc6ac74ff6cf7d76a7e6112d2d09e302b4a8f57e42688cd5258668b7a3044163799609e32cd3dacb7e842b9a84ef2d2032f542f69e866

> insmod /lib/modules/2.6.18-274.0.0.0.1.el5/kernel/drivers/scsi/st.ko

Check that it’s loaded:

> lsmod | grep st
st 72805 0
scsi_mod 199129 13 st,be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2,scsi_transport_iscsi2,sr_mod,sg,libata,cciss,sd_mod

You will see on the above output that the scsi_mod now has accessed the “st” module (in the list) and shows 13 (yours maybe different) modules.

Check we have a SCSI device:

> cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: hp Model: DVDROM DH40N Rev: IS01
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: Ultrium 4-SCSI Rev: U55W
Type: Sequential-Access ANSI SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: MSL G3 Series Rev: 5.50
Type: Medium Changer ANSI SCSI revision: 05

Bingo!

We can confirm what DMESG sees:

> dmesg | tail
scsi2 : cciss
scsi3 : cciss
Vendor: HP Model: Ultrium 4-SCSI Rev: U55W
Type: Sequential-Access ANSI SCSI revision: 05
st 3:0:0:0: Attached scsi tape st0
st0: try direct i/o: yes (alignment 512 B)
st 3:0:0:0: Attached scsi generic sg1 type 1
Vendor: HP Model: MSL G3 Series Rev: 5.50
Type: Medium Changer ANSI SCSI revision: 05
scsi 3:0:0:1: Attached scsi generic sg2 type 8
st0: Block limits 1 - 16777215 bytes.

And there at the end is the confirmation that we should now have a /dev/st0 device:

> ls -l /dev/st0
crw-rw---- 1 root disk 9, 0 Mar 15 12:50 /dev/st0

With a tape confirmed as in the tape drive (through the web based HP MSL tape library web GUI), we can do a basic backup using TAR:

> echo "Hello Darryl" > /tmp/dmg.txt
> tar -cvf /dev/st0 /tmp/dmg.txt

Or to not rewind the tape after, we could use nst0:

> tar -cvf /dev/nst0 /tmp/dmg.txt

Then read the file back from the tape device:

> rm /tmp/dmg.txt
> tar -tvf /dev/st0
-rw-r--r-- root/root 13 2013-03-15 14:54:20 tmp/dmg.txt

> tar -xvf /dev/st0 tmp/dmg.txt

Intel CPU Flags from dmidecode on Linux

If you run the dmidecode command on a Linux machine, you get a nice list of the Intel CPU flags for the CPUs on your machine, plus a handy text description:

FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
SBF (Signal break on FERR)