Wednesday, March 16, 2011

List Sub directories in tree format

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

Tuesday, February 22, 2011

Powerpath issue on HP Unix

Recent Issue:

Server was ignited earlier using OS image of one of the similar hardware model.
We had some issues on performance and found Powerpath issue. Removed the powerpath and installed it again, It required kernel rebuild and started system reboot. But system was not able to boot. Below is the error faced.


ERROR: phy_unit_init: Could not open file: /tmp/ign_configure/hw.info: No
such file or directory (errno = 2)
ERROR: read_hw_info failed

The configuration process has incurred an error, would you like
to push a shell for debugging purposes? (y/[n]):

Solution:
When powerpath software was uninstalled, it restored the pre-ignited image script to the startup files. This caused the server boot to fail checking for ignited configuration files in /tmp directory.

The backup files are saved during the post-installation when the server is ignited. In general the files should not be altered but PP package removal seems to behave differently.
The start scripts which were sourcing for ignited files were removed, rescanned the hardware, and the server was fully tested without PowerPath 5.1 installed.

After validation, we installed Power Path 5.1

learn:/sbin/rc2.d>swlist | grep -i emc
EMCpower HP.5.1.SP2_b113 PowerPath

After installation, the power path does not work as expected and behave the same way as the earlier version

learn:/sbin/rc2.d>sh S999emcp start
Unexpected error occured.
emcpmgr: internal library error (0xebad002)
Error: unable to update device configuration file(s)
No migrations found.

learn:/sbin/rc2.d>powermt display dev=all
Initialization error.

After numbers of attempts with remove/install PP, We finally found the main problem. It is actually a bug with PP and from versions like 4.x it is still there. What happened was that the entry in the /etc/inittab file for PP initialization which is running BEFORE the /sbin/init.d/emcp script and loads kernel modules to the host was missing on the host. /etc/inittab should have been updated during installation, but because that bug, it was not and PP kernel modules could not load at boot.

The entry below has been added to the /etc/inittab file and after reboot PPworked fine.
pwr::sysinit:/sbin/emcpstartup /dev/console 2>&1 # PowerPath

We should have noticed that earlier, but found it at the end.

You can find the solution on Powerlink article emc93018.

Thursday, December 23, 2010

After Ignite, problem with HP LVM

Recently we ignited the HP-UX server, later we had issues in LVM.
We were not able to delete the VGs when we wished to re-layout the VG and restore the data from Backup.

Beloa are the one finally helped.

vgchange -a n /dev/vg
vgexport /dev/vg

in script -
for vg in $(strings /etc/lvmtab | grep vg)
do
echo vgchange -a n $vg
echo vgexport $vg
done


Some useful scripts -

# printf "%-18s | %-17s | %-17s\n" "PV" "VGID" "PVID"; \ for pv in `ls /dev/rdsk/*` do xd -An -j8200 -N16 $pv > /dev/null 2>&1 if [[ $? -eq 0 ]]; then echo "$pv \c" xd -An -j8200 -N16 -tx $pv 2> /dev/null fi done \ | awk '$0 ~ /dev/ {printf "%-18s | %8s %8s | %8s %8s\n", $1, $4, $5, $2, $3}' \ | sort -k 2,5

Wednesday, December 22, 2010

HP UNIX - To Find the Alternate Links

for pv in $(ls /dev/rdsk/*)
do
echo $pv
xd -An -j8200 -N16 -tx $pv 2> /dev/null
done > /tmp/output

Wednesday, November 17, 2010

Linux LVM Notes

How to extend disk space of an existing file system in LVM, or How to configure LVM or create new volume group from command line, or Understand the maximum volume group size limitation.
How to create new Linux EXT3 file system in LVM with new hard disk by creating new logical volume?

Assuming a new IDE hard disk hooked up to Secondary-Slave IDE bus for the new logical volume / file system. Hence, the Linux device code will be /dev/hdd for this IDE hard disk, according to LANANA Linux Device List or the offline copy in /usr/src/linux-2.x/Documentation/devices.txt

1. Using the whole secondary-slave IDE hard disk for existing LVM volume group (called vg0 in my case) by creating the physical volume (PV):
pvcreate /dev/hdd

A similar message of this will be shown upon successful execution of pvcreate command:

pvcreate — physical volume “/dev/hdd” successfully created

2. Adding the new physical volume (PV) to volume group vg0, i.e. to extend the existing volume group size with new physical volume:
vgextend vg0 /dev/hdd

If no errors encounter while executing vgextend, a similar message of this will be seen:

vgextend — INFO: maximum logical volume size is 1023.97 Gigabyte
vgextend — doing automatic backup of volume group “vg0″
vgextend — volume group “vg0″ successfully extended

3. Create the new logical volume (LV) at 400MB (not fully utilize the whole IDE hard disk) to host the new EXT3 file system in question:
lvcreate -L 400M -n lvol1 vg0

Suppose lvcreate completed successfully, this similar message will be seen:

lvcreate — doing automatic backup of “vg0″
lvcreate — logical volume “/dev/vg0/lvol1″ successfully created

4. Now, create the new EXT3 file system on the new logical volume (LV) with 1% file system reserved block count:
mkfs -t ext3 -m 1 -v /dev/vg0/lvol1

Once the new EXT3 file system creation completed, you can examine the file system by executing

tune2fs -l /dev/vg0/lvol1

5. Create a mount point directory for the new EXT3 file system:
mkdir /mnt/newfs

6. It’s now ready to mount the new EXT3 file system:
mount -t ext3 /dev/vg0/lvol1 /mnt/newfs

To confirm that the new EXT3 file system has been mounted successful, type df -h

Reference and thanks to http://www.walkernews.net/2007/07/11/create-new-linux-ext3-file-system-in-lvm/

Tuesday, September 21, 2010

OpenSolaris SSH root

For openSolaris, we need to modify the role for the root user to enable root ssh .

### enable root ssh login ###
rolemod -K type=normal root

Saturday, September 18, 2010

HP UNIX TIPS

http://www.hpuxtips.es/?q=node/12