A little experience on dealing with Disk Array in HPUX machine to be shared.
It is happened at an old HPUX machine with disk array attached. After 2 of the hard disks in the disk array are being replaced, the new hard disks cannot be seen in SAM. To discover back the missing hard disks, issue the following command:
armdiscover <array alias>
After the command, you should able to see the hard disks in SAM, and even can see the unmounted partitions. However you wouldn’t able to do anything with it, either mount it, remove it or recreate it. You should get some errors like “can’t find /dev/dsk/cxtxdx”. Then issue the following command:
armdsp -s <array alias>
This command will show the hard disks path in the disk array. You will see that the path is not the same inside the error. The unmounted partitions are actually still referring to the old hard disk path, where you need to remove it using the following command:
vgreduce -l /dev/vgxx /dev/dsk/cxtxdx
You must include “-l” in the command to remove the missing path. After that you need to add back the actual hard disk path either using SAM or
vgextend command, and everything should be back to normal.
Aside from access through console port, HPUX like other Unix or Linux, can be accessed through Telnet or SSH. If some how you cannot access your HPUX through these 2 methods, it may be either the service is not started or the firewall of the machine blocking your way. Solutions below are tried at HPUX 11.3.
To start the Telnet Service:
- Edit /etc/inetd.conf, search for keyword “telnet”
- If you see the line is commented (hash in front), uncomment it by removing the hash sign
- Issue command “inetd -c” to reconfigure, now the telnet service should be up.
However if you still unable to access through Telnet, try to disable the firewall by issuing this command:
In my case, after doing these 2 solutions, I able to access through either telnet or ssh.
This post is continue from Add header to printout in HPUX using JetDirect, if you’re not using JetDirect but other print server such as DLINK, you might use method below to set your printout header:
- Add your queues using System Administrator Manager (SAM):
- Go to our destination:
- Create a file called
enbanner. This is used to set which queue to print out header and which don’t, simply 1 stand for yes and 0 stand for no, and it is space sensitive (10 character space for the queue name). Here is the sample:
- You can found an execution file called lp, rename it to lporig:
mv lp lporig.
- create a text file called lp and put in the following code:
printer=`echo $1 | /usr/bin/cut -b 3-100`
enbanner=`cat /usr/bin/enbanner | grep $printer | cut -c11`
if [ `expr $enbanner` != 0 ]
/usr/bin/lp2 $1 $2 $TEMP
/usr/bin/lporig $1 $TEMP $2
/usr/bin/lporig $1 $2
- create a text file called lp2 and put in the following code:
printer=`echo $1 | /usr/bin/cut -b 3-100`
# Print the standard header
banner `basename $fname`
reqqueadd=`expr $reqque + 1`
echo "Request id: $reqid Printer: `basename $printer`\n"
echo "" > $TEMP
do_banner >> $TEMP
- Then make lp and lp2 executable:
chmod 777 lp
chmod 777 lp2
- Now you can try to print out the header, depend on the setting at enbanner.
In HPUX, we use LP command to print text file, for example
lp -dprt1 printme.txt, where
prt1 is the LP destination name (or also known as queue name) and
printme.txt is the file to be printed.
If the print server used is a HP JetDirect, we can set the printout header using the HPPI utility:
- Install the HP JetDirect Installer (in HPUX 11iv3, the installation file is named as
- Then copy
- Run HPPI (HP Printer Installer) by typing
- Select option 1 (Spooler Administration) then option 1 again (Add printer to local spooler).
- Type in print server IP address.
- Type in the LP destination name (option 1) then select option 5 (additional printer configuration).
- Type in hp2560 in Model Script (option 1, there is actually a list of model script for you to select but you won’t find hp2560 in the list) then continue for the rest.
- Finally you can find a file named exactly like the queue name in
/etc/lp/interface/model.orig. You can add or modify a function called
do_banner() in order to add a customized printout header.
Below is a list of TAR and CPIO command integrated with REMSH command in order to remote access tape drive in another HPUX server. Refer Tar and Untar tape drive in another HPUX server to setup the server before try the commands below.
- CPIO into tape:
find /dir/or/files/to/cpio -print | cpio -oacvB | remsh OLDSERVER 'dd of=/dev/rmt/0m bs=64b'
- Verify CPIO tape:
remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (cpio -itcvB)
- CPIO from tape:
remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (cpio -iacvBdum)
- TAR into tape:
(tar -cvfb - 64
) | remsh OLDSERVER 'dd of=/dev/rmt/0m bs=64b'
- Verify TAR tape:
remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (tar -tvfb - 64)
- UNTAR from tape:
remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (tar -xvpfb - 64)
There is situation when you have a new HPUX server and then you need to access the old tape that is not supported on the new tape drive. If there is extra SCSI port on the server, definitely you can move the old tape drive to the new server. But when there is no extra SCSI port and you don’t want to buy extra SCSI card, or the old tape drive is needed to be attached to the old server, you still can access the old tape drive using “remsh” command.
We assume the new server’s host name is newserver, while the old server’s host name is oldserver:
- Decide a user login to be used to access the old tape drive, let’s said james.
- Ensure that both servers have that particular user login (with same password).
- Add the host names of both servers into both hosts file (/etc/hosts), for example:
- At old server, create or edit the .rhosts file at the home directory of that particular user by adding the following line:
- To untar files from old tape drive on old server, use this command:
remsh oldserver dd if=/dev/rmt/0m bs=64b|(cd /location/to/untar;tar -xvpfb - 64)
- While to tar files into the old tape drive, use this command:
tar -cvpfb - 64|remsh oldserver dd of=/dev/rmt/0m bs=64b
Refer Remote access tape drive in another HPUX server for extra commands.
HPUX 11iv3 has a feature called MirrorDisk that enable user to do software mirroring, basically is integrated with LVM. However you need to pay extra in order to use it. After installing this feature, follow steps below to mirror the disks (assume the new disk as c2t2d0):
- Create physical volume for new disk:
pvcreate -f -B /dev/rdsk/c2t2d0
- Add disk to current root volume group.
vgextend /dev/vg00 /dev/dsk/c2t2d0
- Make new disk bootable.
- Copy correct AUTO file into new LIF area.
mkboot -a "hpux -lq (;0)/vmunix" /dev/rdsk/c2t2d0
- Here is the part to mirror up the logical volume, boot (stand) logical volume need to be done first so that it occupies the first contiguous set of extends on the new disk. Normally logical volume 1 is for stand, 2 is for swap and 3 is for root.
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0
- Update the boot information contained in BDRA for the mirror copies of boot, root and primary swap.
lvlnboot -b /dev/vg00/lvol1
lvlnboot -v -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
- Check if the BDRA is correct.
lvlnboot -R /dev/vg00
- Verify if the mirrors were properly created.
After finish all the steps, try to restart the server and boot from the new disk. If server is able to boot, it means the mirroring setup is success.