This is a UNIX guide for systems administrators and a procedure that a manager should have his admins create. This document is not outdated but two version old. This document has a lot of information that admins still need. This file is mostly for HP Unix but I have another for all types that I will send out shortly.

OVERVIEW

This complex is comprised of __ systems: and their individual functions are discussed below.

ONLINE AVAILABILITY

MAINTENANCE
SCHEDULING MAINTENANCE
(Production)

To schedule maintenance, you need to make sure that you schedule through Operations phone numbers

If the maintenance window needed is over 2 hours, you will need to

If the maintenance window needed is under 2 hours, you can

(Non Production)

To schedule maintenance, you need to coordinate with the major users of that system.

PREVENTIVE MAINTENANCE SCHEDULE

(Production) Twice a year – spring and fall

(Non Production) Twice a year – summer and winter

ROUTINE PROCEDURES

HOW TO REBOOT

NOTES ABOUT REBOOTING

If you are rebooting the primary boot path is 10/0.5.0 and the alternate boot path is 10/0.14.0 In addition to the procedure listed below under REBOOR PROCEDURES, please observe the following exceptions.
REBOOT PROCEDURES

  1. If this is a production system that you will be rebooting, let _ know that you will be rebooting this server.
  2. Send a wall message to the users letting them know that the system will be rebooted in 5 minutes.
  3. Get the system ready for the reboot:
    a) Create mapfiles of all of the volume groups:
    • cd /root_home
    • create_mapfiles
    • cd /etc/lvmconf
    • head map # Make sure you see VGID
    b) Shutdown measureware:
    • mwa stop all
    c) Run the sync command
    • sync;sync;sync
  4. Reboot the system:
    shutdown -r -y 0
  5. Once the system comes back up, return the system to normal operations by:
    a) checking oracle:
    • check oracle
    • If everything does not start up gracefully, page the Oncall DBA

REBOOT PROCEDURES FOR clusters

  1. Things to know about before you start:

System Name Application the system normally runs (without switchover) Package the system normally runs (without switchover) Volume groups the system normally has (without switchover)

  1. To reboot

a) View the cluster status
root_home> cmviewcl

CLUSTER STATUS

cluster up

NODE STATUS STATE
name up running

PACKAGE STATUS STATE PKG_SWITCH NODE
pkg2 up running enabled name

Prevent the package from switching over

root_home> cmmodpkg -dvn name pkg2

Disabling node name from switching of package lnppkg3.
cmmodpkg : Warning: Node name is already unable to run package pkg2
cmmodpkg : Completed successfully on all packages specified.

e) Check what is currently mounted:
root_home> bdf

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 22094 171295 11% /
/dev/vg00/lvol1 47829 15951 27095 37% /stand
/dev/vg00/lvol8 307200 84563 209205 29% /var
/dev/vg00/lvol10 512000 249675 246305 50% /var/adm/sw
/dev/vg00/lvol9 307200 1181 286900 0% /var/adm/diag
/dev/vg00/lvol7 512000 372342 130950 74% /usr
/dev/vg00/lvol11 102400 49078 50050 50% /usr/localcw
/dev/vg00/lvol12 1536000 1382918 143577 91% /usr/local/oracle
/dev/vg00/lvol6 512000 3370 477190 1% /tmp
/dev/vg00/lvol5 512000 403152 102106 80% /opt
/dev/vg00/lvol14 2072576 22699 1921776 1% /opt/lnpsite
/dev/vg00/lvol13 2072576 323879 1639444 16% /opt/lnp
/dev/vg00/lvol4 512000 2918 477308 1% /home

f) Shutdown the system:

root_home> shutdown -r -y 0

g) After the reboot, view the cluster status:

root_home> cmviewcl

n) Enable the package to switch over, if necessary:

root_home> cmmodpkg -ev pkg2

Enabling switching for package pkg2.
cmmodpkg : Successfully enabled package pkg2.
cmmodpkg : Completed successfully on all packages specified.

TAKE CORE

Usually this is done when a system is in a “hung” condition. Try to do as many of the steps as you can before you do the “TC” command.

  1. Take core:
    a) Press Ctrl-B from the console
    b) For a T-Class box, type: SP to go to the SP mode
    c) For all classes (including the T-class), type TC to take the core
    d) If the system is HP-UX 10.01, HP-UX 10.10, or HP-UX 10.20, then you do not have to type anything more to get the core image.
    e) If the system is HP-UX 11.0, keep watching the console.
    • Press the space bar to when the system prompts you to interrupt the transfer of control sequence
    • Press F to get a full image
    • If you can not get a full image, choose the option that will save the most amount

HOW TO POWER OFF A MACHINE

  1. Shutdown measureware:
    • mwa stop all
  2. Clear the buffers:
    • sync;sync;sync
  3. Halt the system:
    a) shutdown -h -y 0

SPECIAL PROCEDURES FOR TIMECHANGE

There are no special procedures needed for timechange.

WHICH FILESYSTEMS THAT A SYSTEM ADMINISTRATOR MONITORS

/
/home
/logs ** /opt
/stand
/usr
/usr/local ** (location of 3rd party software)
/var
/var/adm/crash
/var/adm/diag
/var/adm/sw
/tmp

Other filesystems:
FINDING WHAT IS FILLING UP A FILESYSTEM

Example #1: /home is 100%. No one can do any work. Look to see if huge files
can be removed or gzipped.

  1. Check the current size of /home:
    root_home> bdf /home
    Filesystem kbytes used avail %used Mounted on
    /dev/vg04/lvol6 409600 409600 0 100% /home
  2. Find files that are huge in this filesystem:
    home> find . -xdev -size +1000 -print
    ./oper/bin/OperateJobs
    ./oper/bin/OpCrossMarket
    ./oper/bin/asgnDist
    ./oper/bin/FilePlacer
    ./oper/bin/OpCopyToXmk_c
    ./oper/bin/OperateJobs.sav
    ./oper/bin/blFullDay
    ./oper/bin/blFullConfirm
    ./oper/bin/blFullUndo
    ./oper/bin/OpCheckImmed
    ./oper/bin/OpCrossMarket.save
    ./vh1251/core *** Look for core files! ***
    ./lb5837/OpCopyToXmk_c
    ./lb5837/blrr_lsrrt
    ./rl9783/obk_081197.dmp.gz
    ./sw2709/SQL/DL/okcoperown_081298.dmp.gz
    ./sw2709/BL_MAESTRO/BIN/blFullConfirm
    ./sw2709/BL_MAESTRO/BIN/blFullDay
    ./sw2709/BL_MAESTRO/BIN/blgn_getpr
    ./sw2709/BL_MAESTRO/BIN/blFullUndo
    ./opersupp/bin12/BIN_DATE/ad1day2lgcldate
    ./opersupp/work/appbin12/arddRq_Pym
    ./opersupp/work/appbin12/ardd_PbAnlz
    ./opersupp/work/appbin12/ardd_PbInt
    ./opersupp/work/appbin12/ardd_RqExt
    ./opersupp/work/appbin12/ardd_SettleRd
  3. Link the core file to /dev/null:
    home> cd vh1251
    home/vh1251> ll core
    -rw——- 1 vh1251 oper 226513920 Nov 14 07:54 core
    home/vh1251> rm core
    home/vh1251> ln -s /dev/null core
  4. Check the size of /home:
    home/vh1251> bdf .
    Filesystem kbytes used avail %used Mounted on
    /dev/vg04/lvol6 409600 188356 208007 48% /home

Example #2: /home is 100%. No one can do any work. You have removed all of
the large files that could be removed, and gzipped files that could be gzipped.
There are no more huge files that can be removed or gzipped in /home.
Something else is filling up /home.

  1. Check the current size of /home:
    root_home> bdf /home
    Filesystem kbytes used avail %used Mounted on
    /dev/vg04/lvol6 409600 409600 0 100% /home
  2. Find files that are huge in this filesystem:
    home> find . -xdev -size +1000 -print
    ./oper/bin/OperateJobs
    ./oper/bin/OpCrossMarket
    ./oper/bin/asgnDist
    ./oper/bin/FilePlacer
    ./oper/bin/OpCopyToXmk_c
    ./oper/bin/OperateJobs.sav
    ./oper/bin/blFullDay
    ./oper/bin/blFullConfirm
    ./oper/bin/blFullUndo
    ./oper/bin/OpCheckImmed
    ./oper/bin/OpCrossMarket.save
    ./lb5837/OpCopyToXmk_c
    ./lb5837/blrr_lsrrt
    ./rl9783/obk_081197.dmp.gz
    ./sw2709/SQL/DL/okcoperown_081298.dmp.gz
    ./sw2709/BL_MAESTRO/BIN/blFullConfirm
    ./sw2709/BL_MAESTRO/BIN/blFullDay
    ./sw2709/BL_MAESTRO/BIN/blgn_getpr
    ./sw2709/BL_MAESTRO/BIN/blFullUndo
    ./opersupp/bin12/BIN_DATE/ad1day2lgcldate
    ./opersupp/work/appbin12/arddRq_Pym
    ./opersupp/work/appbin12/ardd_PbAnlz
    ./opersupp/work/appbin12/ardd_PbInt
    ./opersupp/work/appbin12/ardd_RqExt
    ./opersupp/work/appbin12/ardd_SettleRd

Notice all of the above files are executables which can not be gzipped by root. But, this does not explain why /home is filling up. There should be something very huge filling up home that has not yet written out to disk.

  1. Use /root_home/lsof to find all processes that are reading from and writing to /home:

root_home> /root_home/lsof /home

COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
ksh 1992 sw2709 19u VREG 64,0×040006 353626 6485 /home (/dev/vg04/lvol6)
rlogin 2065 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
dtexec 3119 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
xterm 3120 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
ksh 3122 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
ksh 3122 sw2709 19u VREG 64,0×040006 353626 6485 /home (/dev/vg04/lvol6)
rlogin 3158 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
rlogin 3159 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
dtexec 3338 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
ksh 3340 sw2709 cwd VDIR 64,0×040006 2048 4356 /home (/dev/vg04/lvol6)
ttsession 8521 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
ttsession 8521 vh1251 1w VREG 64,0×040006 6581 8098 /home (/dev/vg04/lvol6)
ttsession 8521 vh1251 2w VREG 64,0×040006 6581 8098 /home (/dev/vg04/lvol6)
su 9871 opersupp cwd VDIR 64,0×040006 1024 5328 /home (/dev/vg04/lvol6)
su 9871 opersupp 29uw VREG 64,0×040006 28104 321 /home (/dev/vg04/lvol6)
ksh 9897 sw2709 19u VREG 64,0×040006 353626 6485 /home (/dev/vg04/lvol6)
ksh 9921 sw2709 19uw VREG 64,0×040006 353626 6485 /home (/dev/vg04/lvol6)
dtfile 10396 sw2709 1w VREG 64,0×040006 734 7776 /home (/dev/vg04/lvol6)
sch_monit 10701 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
tlg_oper 24261 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
jobman 25289 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
.jobmanrc 25315 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
.jobmanrc 25315 vh1251 18r VREG 64,0×040006 1771 5123 /home (/dev/vg04/lvol6)
sch_gener 25968 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
conman 25970 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OprunStar 26102 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OprunStar 26102 vh1251 4w VREG 64,0×040006 486128640 1649 /home (/dev/vg04/lvol6)**
sch_monit 26877 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
tlg_oper 27302 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
vuepad 28061 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
softmsgsr 28075 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
vuepad 28129 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
sch_monit 28153 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OPSYS_Opr 29442 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OPSYS_Opr 29456 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OprunStar 29496 vh1251 cwd VDIR 64,0×040006 1024 422 /home (/dev/vg04/lvol6)
OprunStar 29496 vh1251 4w VREG 64,0×040006 486128640 1649 /home (/dev/vg04/lvol6)**

PIDs 29496 and 26102 are running, and writing information to /home. The reason why the files do not show up in /home is that the processes have not completely written to disk.

Since both of these jobs are OprunStart, operational support needs to be involved to kill off these processes, as well as to troubleshoot that program to see what it is creating a huge temporary file in /home.

  1. Check the size of /home after those processes are killed:
    root@amadeus:/root_home> bdf /home
    Filesystem kbytes used avail %used Mounted on
    /dev/vg04/lvol6 409600 188356 208007 48% /home

DAILY CHECK OF THE BOXES

Daily/Weekly Maintenance

Pri Item/location Frequency Criteria
1 root file system Daily bdf -l and grep for vg00. If /var is 100% full the system cannot run.
1 File systems > 90% Daily bdf -l | grep -v ora | sort +4 Look for files systems > 90%
1 Stale Mounts Daily bdf -t nfs | grep stale to search for stale mounts.
1 uptime Daily and throughout the day Routine check.
1 swapinfo and swapinfo -t Daily establish norms. Remove cores
2 Top Processes Daily top. Check for long running oracle processes or other unusual processes.
1 lpstat -r Daily, insure scheduler is running Routine check
1 lpstat -o Daily, insure jobs are spooling Routine check
1 dmesg Daily may show items not in syslog.log
1 Syslog.log /var/adm/syslog
Daily Look for unusual system events, who su’d to root, etc. tail -200 syslog.log | pg (or print if desired).
 Also, note “vmunix”messages.
2 Check for old users Daily who -u | grep old Kill
3 V Box Console /spp/data/consolelog
3 On “T” Boxes check the attention light Bi-Weekly If illuminated, go to the console and type a Ctrl-b, then sp, then dl. Look at all of the logs that are highlighted. Also, periodically clear out the tombstone logs so that the machine can receive new tombstone logs if a new hardware disaster happens on that machine.

PROCESSES RUNNING ON A SYSTEM

CREATE WEEKLY PERFORMANCE CHARTS (if you have software)

Draw the chart in perfview:
• type “pv” to bring up perfview
• Click on Data Sources
• Click on Manage
• Click on the hostname that you want to pull data from
• Click on Open
• Once you see hostname:SCOPE in the Connected Data Sources, click on Draw
• Click on hostname:SCOPE
• Click on GLOBAL from the Class List window
• Click on the following metric items from the Metric List window:
• GBL_CPU_TOTAL_UTIL for CPU Utilization
• GBL_MEM_UTIL for Memory Utilization
• GBL_SWAP_SPACE_UTIL for Swap Space Utilization
• GBL_RUN_QUEUE for Load Average
• Click on OK
• Click on Draw

Timeframe:
• The previous 7 days (please make sure that you report from Monday to Sunday)
• Make sure that you are consistent with the dates

Change the settings:
• Click on settings
• Click on Points Every…
• Click on 1 hr
• Click on Settings
• Click on Change Visual Effects…
• Change yellow to some other color

Print the chart:
• Click on File
• Click on Print
• You should see a box pop up with “File: request id is hp1600-XXXX (1 file)”

HOW TO ADD A FILESYSTEM

General notes:

  1. Always copy /etc/fstab to a safe place before you make any changes to /etc/fstab.
  2. Try to comment /etc/fstab when you edit it – it comes in very handy when troubleshooting. One common practice is adding free & available LV’s as comment statements to /etc/fstab. When you need a free lvol – uncomment it and give it a name.

Before you add a filesystem:

  1. Make sure that this is a valid request for a filesystem. A filesystem request form should be filled out.
  2. Make sure that you have the space to add the filesystem:
    • Type the following:
    for i in strings /etc/lvmtab | grep vg
    do
    echo $i:
    vgdisplay $i | grep -e Mbyte -e Free
    done
  3. Multiply the Mbyte by Free which will give you the amount in Mbyte that is free in each volume group.
  4. If it is a filesystem for the Operating System:
    • You should put the filesystem in vg00
  5. If it is any other filesystem:
    • You should not put the filesystem in vg00
  6. Also check /etc/fstab to find any logical volumes are have been commented out, or are unused.

Build the logicial volume:

  1. Check to see if the volume group is on EMC disks or on HP/Jamaica disks.
    for j in vgdisplay -v vgXX | grep dsk | awk -F "/" '{print $NF}'
    do
    diskinfo /dev/rdsk/$j | grep vendor
    done
  2. If this is for any filesystem on HP/Jamaica disks:
    • lvcreate -L [size in Mbytes] /dev/vg??
    • Remember to mirror this new logical volume.
  3. If this is for an oracle filesystem on EMC disks:
    • If there are other oracle filesystems on the system, then make this logical volume like the others.
    • If there are no other oracle filesystems on the system, then make the logical volume:
    • lvcreate -L [size in Mbytes] -i [number of disks in the volume group] -I [stripe size] /dev/vg??
    • newfs -F [filesystem type] /dev/vg??/rlvol?

Example:
lvcreate -L 4065 -i 5 -I 64 /dev/vg20
mkfs -F vxfs -o bsize=8192 /dev/vg20/rlvol1

  1. If this is not for an oracle filesystem (flat filesystem) on EMC disks:
    • Look at the other logical volumes in the same volume group, and make it like those.
    • If there are no other logical volumes in the volume group, then make the logical volume:
    • lvcreate -L [size in Mbytes] -i [number of disks in the volume group] -I [stripe size] /dev/vg??
    • newfs -F vxfs /dev/vg??/rlvol?

Example:
lvcreate -L 4065 -i 5 -I 32 /dev/vg20
mkfs -F vxfs /dev/vg20/rlvol1

Mount the filesystem:

  1. cd /
  2. mkdir [mount point]
  3. cp /etc/fstab /etc/fstab.safe
  4. vi /etc/fstab # include the new filesystem
  5. mount /[filesystem]

Examples:
• You need to add a filesystem that is 200 MB for /var/adm/diag
• You need to add a filesystem that is 1 Gb for /usr/local/oracle
• You need to add a filesystem that is 4 Gb for /ora1

• What you should see is the following:
vg00:
4
1000
vg01:
1
4096
vg02:
1
2048
From this example, you have the following free space:
vg00 4000 MB
vg01 4096 MB
vg02 2048 MB
• You should put /var/adm/diag in vg00
• You should keep /usr/local/oracle out of vg00
• To make the /var/adm/diag filesystem:
• lvcreate -L 200 /dev/vg00
• newfs -F vxfs /dev/vg00/rlvol10
• vi /etc/fstab  to make sure that an entry is added for /dev/vg00/lvol10 /var/adm/diag vxfs delaylog 0 2
• mount /var/adm/diag
• lvextend -m 1 /dev/vg00/lvol10 /dev/dsk/c4t4d0  to mirror this if it is on HP internal disks
• To make the /usr/local/oracle filesystem:
• lvcreate -L 1024 /dev/vg02
• newfs -F vxfs /dev/vg02/rlvol1
• vi /etc/fstab  to make sure that an entry is added for /dev/vg02/lvol1 /usr/local/oracle vxfs delaylog 0 2
• mount /usr/local/oracle
• To make the /ora1 filesystem:
• lvcreate -L 4065 -i 5 -I 64 /dev/vg01  To stripe across the number of disks in the volume group with a stripe size of 64 Mb
• newfs -F vxfs /dev/vg01/rlvol1
• vi /etc/fstab  to make sure that an entry is added for /dev/vg01/lvol1 /ora1 vxfs delaylog 0 2
• mount /ora1
• cd /ora1
• mkdir ORACLE
• chown oracle:dba ORACLE
• chmod 775 ORACLE

HOW TO EXTEND A FILESYSTEM

Increase/Extend file system size?
Yes: Are there enough free extents available in same VG?
Yes: Extend existing LV using available free extents.
See procedure below for extending a file system
No: Is there an available LV in the same VG?
Yes: Is it large enough?
Copy data to it and re-mount as desired file system
No: Remove it to free up space (normally, another 2GB file system) if it will
provide enough space. If not, you will need to locate another LV
No: Copy data to available LV of desired size in another VG.
Is there an LV of appropriate size available in another VG?
Yes: Copy data to it and use it to replace current undersized LV/file
system.
No: Do any other VG’s have enough space to create new LV
large enough?
Yes: Create a new LV
No: Can this filesystem be NFS-mounted from another
system in the same production complex?
Yes: Make the filesystem on the other server, and
NFS-mount it to this server
No: You can not extend this filesystem until new
drives are added.

Extending a filesystem (online vxfs):

  1. Make sure that the Online VxFS product is loaded on the system:
    swlist -l product | grep -i vxfs
  2. Ensure the filesystem is vxfs (Journaled):
    fstyp /dev/VGxx/lvxx
  3. Extend the logical volume:
    lvextend -L [new size in Mbytes] /dev/vg??/lvol?
    fsadm -F vxfs -b [new size in Kbytes] /

Example:

  1. Check the current filesystem size:

root@fred:/var/adm/diag> bdf /opt

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol5 315392 269678 42884 86% /opt

  1. Extend the logical volume to desired size:

Command: lvextend -L (size in Mbytes) /dev/vg??/lvol?

root@fred:/var/adm/diag> lvextend -L 400 /dev/vg00/lvol5
Logical volume “/dev/vg00/lvol5” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

  1. Extend the filesystem to desired size:

Command: fsadm -F vxfs -b (size in Kbytes) (filesystem mount point)

root@fred:/var/adm/diag> fsadm -F vxfs -b 408000 /usr opt
fsadm: /dev/vg00/rlvol5 is currently 315392 sectors – size will be increased

  1. Check the new filesystem size:

root@fred:/var/adm/diag> bdf /opt

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol5 408000 269702 129681 68% /opt

Extending a filesystem (non-online vxfs / hfs):

  1. If the server does not have Online VxFS loaded, or if the logical volume is hfs:
    fstyp /dev/VGxx/lvxx
  2. Extend the logical volume:
    lvextend -L [new size in Mbytes] /dev/vg??/lvol?
    /root_home/lsof /filesystem – make sure no one is accessing it
    umount /filesystem
    extendfs -F [vxfs/hfs] /dev/vg??/lvol?

Copy data to an another available logical volume:

This may be used in lieu of extending the current logical volume. Locate a larger available logical volume, and copy the data to it. The larger logical volume may or may not be in same VG as the old filesystem.

  1. Locate available logical volume
  2. Mount to a temp name for copying data:
    mkdir /temp_name
    mount /dev/VGxx/lvxx /temp_name
  3. Copy existing data to new logical volume. Be sure to comment your changes in /etc/fstab:
    cd /;find . -xdev -print | cpio -pxdlum /
  4. Make changes to the /etc/fstab:
    vi /etc/fstab – edit /filesys entry for new /dev/VGxx/lvxx LV
  5. Mount the filesystem on the new logical volume:
    umount /; umount /
    mount /

HOW TO ADD A NFS-MOUNTED FILESYSTEM

  1. A filesystem is built on the local host
  2. vi /etc/exports # Yank and put a line – changing the filesystem name and the system
    names where the filesystem will be NFS-mounted to
  3. exportfs -a # Look for any errors
  4. On the system where this filesystem needs to be NFS-mounted:
    • vi /etc/fstab # Yank and put a NFS entry – changing the filesystem name and the
    system where the filesystem is mounted locally
    • cd /
    • mkdir [mount point]
    • mount /[mount point] # Look for any errors

HOW TO REMOVE A FILESYSTEM

To remove a filesystem that is no longer needed:

  1. showmount -a # See if the filesystem is exported to another box
  2. umount /[filesystem] # Unmount the filesystem from the systems that it’s exported to
  3. vi /etc/exports # Remove the entry for the unneeded filesystem
  4. fuser -cu /[filesystem] # See if anyone is using the filesystem
  5. umount /[filesystem] # Unmount the filesystem
  6. vi /etc/fstab # Remove the entry for the unneeded filesystem
  7. cd /
  8. rm -r [mount point] # To make sure that no one uses the directory – could fill up /

ORACLE
Oracle problems

a) WHAT TO LOOK FOR IF ORACLE DOESN’T START

(These steps should be performed when a DBA and UNIX Admin team are working on the problem)

  1. Make sure ALL oracle filesystems are mounted.
  2. Make sure that /usr/local/oracle/7.2.3/dbs/init(instance).ora exists for each instance that the box normally has.
  3. ps -fu oracle
  4. Do you see any pmon or smon processes? If so, contact a DBA. The DBA will determine whether a “shutdown abort” should be performed. (note: A shutdown abort should be only used as a last resort)
  5. ipcs -s
  6. Do you see any remaining semaphores that belong to oracle? If so and if oracle has been shut down, and no processes exist at the OS level, do a ipcrm on each of the semaphores associated with oracle. If you don’t, ipcs/shared memory could become hosed.
  7. If oracle still does not start up, it is up to the DBA to make sure that the init.ora file has everything that it should in order to bring up the database. (Verify no changes have been made either)

b) Other useful information:

/usr/local/oracle/7.2.3/dbs/sgadef(instance).dbf is a file that exists ONLY when oracle is up and running. It points to a segment of memory. If you do not see this file, that means that the database is down.

c) Looking up oracle errors:

You can look to see what a specific oracle error means.
•su – oracle
•oerr ora #####

Example: User is receiving a ORA-12223 when running a program.
su – oracle
oerr ora 12223

12223, 00000, “TNS:internal limit restriction exceeded”
// *Cause: Too many TNS connections open simultaneously.
// *Action: Wait for connections to close and re-try.

HOW TO PATCH
General Information

To load a patch:
swinstall -s patchwrk.sbms.sbc.com:/depot/patch/stage11 PHCO_19550

“show_patches -s” is of marginal value. It was a somewhat usable tool
to aid in cleanup of superseded patches before “cleanup” was fixed. It
shows all patches on your system which have been superseded. With it you could
have figured out what to commit, but now cleanup looks like it will do it all.

“show_patches -a” shows what patches are currently active on your machine i.e.
not superseded.

check_patches is kind of cool. It will easily, and pretty quickly,
check that all of the patches which your system thinks are on your system are
correctly installed.

The main issue is back up before loading patches

on 11.0 machines…

make a make_recovery tape – (don’t fool around without this it’s too easy.)
shutdown -y 0
mount -a
swagentd
swinstall -x patch_match_target=true -x autoreboot=true -s patchwrk.sbms.sbc.com:/depot/patch/prod11_all
Patching

TROUBLESHOOTING FILESYSTEM PROBLEMS
Corrupted filesystem
• Unmount the filesystem
• Run fsck on the filesystem
• Sometimes it is necessary to run a full fsck:
• fsck -F [filesystem type] -o full /dev/vgXX/lvolX
Filesystem will not mount
• Make sure that you have specified the correct logical volume in /etc/fstab
• Make sure that you have specified the correct mount point in /etc/fstab
• Make sure that you have created the mount point on the system
• Make sure that you are not in the mount point directory
• Make sure that the logical volume has a filesystem on it (fstyp /dev/vgXX/lvolX)
• Make sure that the logical volume is not corrupted
Filesystem will not unmount
• fuser -cu /[filesystem mount point] # To see who is in the filesystem
• /root_home/lsof /[filesystem mount point] # To see what processes are tied to the filesystem
• Are there filesystems mounted underneath?
• Example:
• If you are trying to unmount /usr/local, be sure to unmount /usr/local/oracle, /usr/local/maestro, /usr/local/abars, /usr/local/dazel, /usr/local/g1, and /usr/local/vista
• Are you in the filesystem?

TROUBLESHOOTING MISC PROBLEMS
“POWERFAILED” ERRORS”
Power fail pages generated by the syslog can have several meanings. It can be an actual power failure or it can be the result of bus contention. The following is from an investigation of such messages by HP.

There is a timer that gets started when LVM starts a transaction to a disk. LVM expects that transaction to have either get started or completed before the counter runs down to 0. If the transaction does not get started in that time, LVM pauses the I/O’s on the bus, tells the bus to actually do a powerfail reset and then launches the I/O’s again. So what you are seeing is the Fiber Channel interface, which executes the SCSI protocol, returning the POWERFAILED message when it is back on line and says “OK, I’m ready to send the I/O’s again”.

Typically what we see cause this, is bus contention, and if you are doing a hot backup of a database, we have long sustained transfers on the bus that are going to contribute to that. So I believe that in the absence of any other symptoms or errors, what we are seeing here is nothing more than a little bus contention.

The pvchange command can be used to increase the window of time before this
transaction happens and we pause and do a reset.

pvchange -t 180 of all physical volumes.

Trouble shooting PRIORITY ONE CALLS

Good things to check for when you are on a priority one conference call:

• Check the following:
• uptime Look at load average
• swapinfo -t Look at swap utilization
• glance Look at CPU, Memory, and Swap Utilization
• top -d 1 Look at the top processes
• ipcs -qop Look in the third column from the right for
anything backed up in queue.
• lpstat -r Is the print scheduler running?
• ps -ef | grep LOC | wc -l How many oracle processes?
• ps -fu oracle | wc -l Is this close to kernel parameter maxuprc?
• bdf /var Is it 100% full?
• bdf /usr/local Is it 100% full?
• ping the printers in the market Is there slow / no response time?

DETERMINING DISK UTILIZATION USING SAR

Command:
sar -d [number of seconds] [number of iterations]

Output:

Output for each iteration will look like:

       device   %busy   avque   r+w/s  blks/s  avwait  avserv

21:32:53 c1t6d0 17.90 35.14 22 104 198.12 31.45
c13t6d0 11.90 47.60 17 79 245.86 34.87
c1t4d0 1.09 1.18 1 15 7.99 18.82
c13t4d0 2.00 0.90 2 25 7.73 17.17
c22t0d0 82.20 3.35 50 806 63.71 195.59
c22t0d1 29.25 0.56 50 793 5.43 15.27
c27t0d0 70.38 1.17 50 794 15.63 81.87
c28t0d0 27.41 0.54 50 802 5.53 12.36
c29t0d1 71.87 1.32 50 808 16.43 86.51
c22t1d0 7.18 0.50 6 91 4.92 14.98
c22t1d1 7.72 0.50 7 108 5.02 13.59
c27t1d0 6.70 0.50 6 99 5.16 12.72
c28t1d0 7.79 0.50 6 103 4.94 13.80
c29t1d1 8.00 0.50 6 100 4.94 15.30
c22t2d0 21.58 0.53 93 1489 5.22 7.06
c22t2d1 19.64 0.52 93 1491 5.18 6.05
c27t2d0 58.84 1.01 93 1491 10.80 40.93
c28t2d0 18.34 0.52 93 1493 5.36 4.96
c29t2d1 20.21 0.53 93 1493 5.25 6.26
c22t3d0 8.04 0.51 5 74 5.10 20.22
c22t3d1 5.71 0.50 4 68 4.94 14.58
c27t3d0 5.33 0.50 5 73 5.15 13.04
c28t3d0 6.01 0.50 4 69 5.09 15.61
c29t3d1 6.24 0.50 4 65 4.83 16.51
c22t4d0 8.19 0.50 8 128 4.98 13.00
c22t4d1 6.38 0.50 8 125 5.03 9.79
c27t4d0 6.86 0.50 8 130 5.08 10.84
c28t4d0 6.90 0.50 8 127 4.95 11.30
c29t4d1 6.70 0.50 8 129 4.95 10.98
c22t5d0 8.42 0.50 6 100 5.02 18.46
c22t5d1 6.14 0.50 6 104 4.93 11.85
c27t5d0 7.72 0.51 6 104 5.13 15.80
c28t5d0 7.01 0.50 7 106 4.90 13.41
c29t5d1 5.92 0.50 7 105 4.88 12.12
c22t8d0 9.66 0.50 14 259 4.92 7.56
c22t8d1 7.61 0.50 14 258 4.97 6.11
c27t8d0 9.31 0.50 15 257 4.94 7.48
c28t8d0 9.57 0.50 15 260 5.02 7.72
c29t8d1 7.03 0.50 15 274 4.98 5.32
c22t9d0 14.93 0.50 68 1082 5.06 2.72
c22t9d1 14.93 0.50 67 1070 5.06 2.75
c27t9d0 16.36 0.50 67 1078 5.06 3.19
c28t9d0 14.31 0.50 66 1062 5.00 2.67
c29t9d1 28.06 0.50 66 1058 5.05 6.56
c22t10d0 0.94 0.50 1 28 4.84 7.52
c22t10d1 1.07 0.50 1 27 5.11 8.46
c27t10d0 0.63 0.50 1 30 5.04 4.89
c28t10d0 0.63 0.50 1 28 5.26 5.26
c29t10d1 0.86 0.50 1 31 4.84 7.06
c22t11d0 15.83 0.50 14 223 4.94 13.63
c22t11d1 15.50 0.50 14 228 4.88 13.42
c27t11d0 14.67 0.50 14 222 4.93 12.72
c28t11d0 14.31 0.50 14 224 4.99 11.96
c29t11d1 14.70 0.50 14 222 4.94 12.37
c23t0d0 0.14 0.50 0 3 5.51 10.52
c23t0d1 0.18 0.50 0 4 4.99 11.17
c25t0d0 0.10 0.50 0 4 4.18 6.98
c25t0d1 0.16 0.50 0 3 5.07 10.62
c23t1d0 0.40 0.50 1 5 3.78 8.14
c23t1d1 0.34 0.50 1 5 4.08 5.78
c25t1d0 0.20 0.50 1 5 3.73 4.39
c25t1d1 0.20 0.50 1 6 4.16 4.50
c23t5d0 4.68 0.50 18 832 5.07 2.54
c23t5d1 8.38 0.50 22 1070 5.22 6.03
c25t5d0 5.13 0.50 22 1071 5.10 3.15
c25t5d1 1.96 0.50 5 238 5.16 7.60
c23t9d0 0.33 0.50 1 13 4.29 6.07
c23t9d1 0.43 0.50 1 12 4.55 9.12
c25t9d0 0.48 0.50 1 17 4.27 6.93
c25t9d1 0.31 0.50 0 11 4.75 7.44

At the bottom, sar will average the disk utilization for the time that you specified.

       device   %busy   avque   r+w/s  blks/s  avwait  avserv

Average c1t6d0 11.26 14.74 11 83 85.23 23.72
Average c13t6d0 6.72 23.64 7 62 124.25 27.54
Average c1t4d0 0.97 1.13 1 13 8.23 18.92
Average c13t4d0 1.76 0.90 2 21 7.99 17.96
Average c22t0d0 54.01 1.33 36 584 22.30 80.35
Average c22t0d1 29.56 0.53 36 579 5.16 15.81
Average c27t0d0 45.55 0.74 36 579 8.95 45.65
Average c28t0d0 28.67 0.52 37 587 5.21 14.42
Average c29t0d1 51.23 0.77 37 591 8.94 49.83
Average c22t1d0 4.45 0.50 4 67 4.91 13.58
Average c22t1d1 4.63 0.50 5 74 5.00 13.66
Average c27t1d0 4.10 0.50 5 72 5.03 11.72
Average c28t1d0 4.63 0.50 5 73 4.86 12.82
Average c29t1d1 4.68 0.50 5 73 4.94 12.96
Average c22t2d0 19.17 0.51 63 1013 5.01 8.07
Average c22t2d1 15.94 0.51 64 1016 4.97 6.18
Average c27t2d0 31.17 0.66 63 1014 6.89 22.16
Average c28t2d0 14.93 0.51 63 1013 4.99 5.31
Average c29t2d1 17.99 0.51 63 1015 5.00 6.98
Average c22t3d0 5.79 0.50 5 76 4.96 16.94
Average c22t3d1 3.95 0.51 4 71 4.87 11.48
Average c27t3d0 3.63 0.50 5 73 4.95 10.13
Average c28t3d0 4.14 0.50 4 69 4.98 12.05
Average c29t3d1 4.64 0.51 5 75 4.94 12.83
Average c22t4d0 6.89 0.50 7 111 4.95 12.52
Average c22t4d1 5.61 0.50 7 112 4.97 10.09
Average c27t4d0 6.68 0.50 7 111 5.02 12.82
Average c28t4d0 5.68 0.50 7 113 4.92 10.23
Average c29t4d1 5.01 0.50 7 111 4.92 9.12
Average c22t5d0 11.90 0.50 10 154 5.32 16.54
Average c22t5d1 8.50 0.50 10 155 4.94 10.48
Average c27t5d0 10.87 0.50 10 155 4.98 13.97
Average c28t5d0 10.18 0.50 10 157 4.96 12.63
Average c29t5d1 8.29 0.50 10 154 4.96 10.52
Average c22t8d0 7.74 0.50 13 232 4.95 7.35
Average c22t8d1 7.86 0.50 13 232 4.97 7.69
Average c27t8d0 7.70 0.50 13 230 4.89 7.56
Average c28t8d0 8.88 0.50 13 234 4.96 8.46
Average c29t8d1 7.37 0.50 13 238 4.91 6.89
Average c22t9d0 19.25 0.50 54 860 4.98 4.90
Average c22t9d1 14.76 0.50 54 857 4.97 3.42
Average c27t9d0 15.38 0.50 54 859 4.97 3.68
Average c28t9d0 14.39 0.50 53 848 4.96 3.39
Average c29t9d1 20.66 0.50 53 853 4.97 5.44
Average c22t10d0 1.08 0.50 2 37 4.94 5.91
Average c22t10d1 0.84 0.50 2 36 4.98 4.67
Average c27t10d0 0.82 0.50 2 38 4.93 4.39
Average c28t10d0 0.80 0.50 2 36 4.93 4.63
Average c29t10d1 0.97 0.50 2 38 4.79 5.38
Average c22t11d0 12.72 0.50 13 291 4.88 11.44
Average c22t11d1 12.63 0.50 13 296 4.85 11.15
Average c27t11d0 11.98 0.50 13 292 4.89 10.73
Average c28t11d0 11.93 0.50 13 293 4.94 10.50
Average c29t11d1 11.96 0.50 13 294 4.88 10.45
Average c23t0d0 0.18 0.50 0 5 4.82 7.19
Average c23t0d1 0.23 0.50 0 7 4.77 7.41
Average c25t0d0 0.22 0.50 0 7 4.83 7.09
Average c25t0d1 0.30 0.50 0 7 4.75 10.95
Average c23t1d0 0.24 0.50 1 4 3.86 5.82
Average c23t1d1 0.23 0.50 1 4 4.03 4.56
Average c25t1d0 0.14 0.50 0 4 4.08 3.24
Average c25t1d1 0.15 0.50 1 4 4.09 3.28
Average c23t5d1 2.25 0.51 6 293 5.21 6.62
Average c25t5d0 1.56 0.50 6 293 5.10 4.44
Average c25t5d1 0.96 0.51 2 125 5.18 8.31
Average c23t9d0 0.23 0.50 1 11 4.24 5.26
Average c23t9d1 0.38 0.50 1 10 4.35 9.26
Average c25t9d0 0.35 0.50 1 14 4.12 5.95
Average c25t9d1 0.29 0.50 0 10 4.53 7.29
Average c22t12d0 0.12 0.50 1 16 5.07 1.25
Average c22t12d1 0.13 0.50 1 17 5.00 1.23
Average c27t12d0 0.29 0.50 2 38 5.08 1.16
Average c28t12d0 0.29 0.50 2 38 5.08 1.19
Average c29t12d1 0.60 0.50 3 55 5.10 1.73
Average c23t5d0 0.99 0.50 4 167 5.06 2.65
Average c23t8d0 0.00 0.50 0 0 1.55 20.35
Average c23t8d1 0.00 0.50 0 0 5.49 30.62
Average c25t8d1 0.01 0.50 0 0 6.34 9.73

In the above example, disks /dev/dsk/c1t6d0 and /dev/dsk/c13t6d0 are getting hit very hard.

The solution for this example was:

  1. Find the logical volumes on each of these drives. In this case, swap, /usr/local (with oracle), /usr, and /opt were on these drives
  2. pvmove /usr to another drive in vg00. This required no downtime to complete.
  3. pvmove swap to another drive in vg00. This required no downtime to complete.
  4. Created a new filesystem on the EMC drives for /usr/local and /usr/local/oracle. In order to move both of these off downtime was necessary.

PERFORMANCE / MONITORING TOOLS
PERFORMANCE AND TUNING – CPU BOTTLENECKS

Symptoms:
• zero percent idle CPU
• high percent user CPU
• large run-queue size sustained over time
• processes blocked on priority
• slow response time
• high percent system CPU

Metrics:
• user CPU utilization
• system CPU utilization
• idle CPU
• run queue size
• load average
• system call rate
• context switch rate

Tunable kernel parameters:
• maxdsiz
• maxssiz
• maxtsiz
• maxuprc
• nproc
• semmap
• semmni
• semmns
• semmnu
• semume
• semvmx
• maxusers
• npty
• unlockable_mem

Hardware solutions:
• upgrade to a faster processor
• upgrade with larger data/instruction cache
• add a processor
• spread applications to multiple systems (client-server architecture)
• use diskless nodes
• add a floating point coprocessor

Software solutions:
• run long batch jobs during non-peak hours
• nice unimportant applications
• nasty i/o hogs
• use rtprio to help important processes
• use plock to help important processes
• turn off system accounting
• load balance software
• optimize the application
• use Process Resource Manager (PRM)

Tools:
• sar -u #seconds #intervals – For cpu utilization. Not good: %wio > 7 and %idle near 0
• sar -q #seconds #intervals – For queue lengths. Not good: runq-sz > 4 or %swapocc > 5
• sar -c #seconds #intervals – For system calls. Watch for scall/s > 1000 or # of fork/s and # of exec/s
• top – For top processes on the system. Also, system load average.
• uptime – For system load average. Also, how long system has been up and number of users
• uptime -w – For current activity on system for each user.
• ps -ealf – For long output of the ps command. Good for priority, user id, and run state
• ps -lt tty?? – For tracing processes on a specific tty
• glance
• gpm
PERFORMANCE AND TUNING – MEMORY BOTTLENECKS

Symptoms:
• Large run queue with idle CPU utilization
• Out of memory errors
• CPU time to vhand and swapper
• High global system CPU utilization
• High pageout rate
• Process deactivation activity
• Very small free memory and large active virtual memory
• High disk activity on swap devices

Metrics:
• Buffer cache size
• Page in/out rates
• Swap in/out rates
• Available memory size
• Free memory size
• Swap queue length
• Resident set size
• Virtual set size
• VM reads and writes

Tunable kernel parameters:
• shmmax
• shmmni
• shmseg

Hardware solutions:
• Add physical memory.
• Use diskless workstations rather than X-terminals

Software solutions:
• Reduce maxdsiz
• Reduce the use of memory locking in the application.
• Kill unnecessary windows.
• Identify programs with memory leaks.
• Redesign the application.
• Reduce the size of the kernel (limit drivers and subsystems).
• Reduce the size of system tables.
• Reduce the size of the file system buffer cache.

Tools:
• vmstat -d #seconds #intervals – For disk activity.
• vmstat -S #seconds #intervals – For swap in/out activity.
• ipcs -qop – For active message queues.
• ipcs -m – For shared memory.
• ipcs -s – For semaphores.
• glance
• gpm
PERFORMANCE AND TUNING – DISK BOTTLENECKS

Symptoms:
• High disk utilization
• Large disk queue length (over 4)
• Large percentage of time waiting for disk I/O
• Large physical I/O rates
• Low buffer cache hit ratio
• Large run queues with idle CPU

Metrics:
• Disk utilization
• Disk queue length
• Read/write rates per spindle/section
• Raw I/O
• Swap queue length
• Buffer cache hit ratio
• NFS and diskless rates (server)

Tunable kernel parameters:
• Increase buffer cache size
• Increase the kernel table sizes
• bufpages
• nbuf
• dbc_min_pct
• dbc_max_pct
• fs_async
• maxfiles
• maxfiles_lim
• nfile
• nflocks
• ninodes
• nswapdev
• nswapfs
• swchuck

Hardware solutions:
• Add disk drives
• Add disk channels
• Use faster disks
• Use disk striping – better performance
• Use disk mirroring – lower performance

Disk Tuning – Configuration Solutions:
• Use multiple swap areas on different spindles
• Balance disk I/O across multiple spindles
• Dedicate a disk section to an application
• Dedicate a disk section to a file access type
• Use raw disk I/O
• Use mkfs options

Disk Tuning – File System Solutions:
• Use a clean, empty file system.
• Keep the directory hierarchy flat.
• Use relative path names.
• Minimize symbolic links.
• Tune the file system.
• Tune the path variable.

Disk Tuning – File System Tuning:
• block size – smaller block sizes favor smaller file sizes.
• fragment size – smaller fragment sizes favor smaller files
• bytes per inode – with databases, you must have large number of inodes
• minfree
• maxbpg
• rotational delay

Tools:
• bdf -i – free inodes
• iostat #seconds #intervals – cpu utilization
• iostat -t #seconds #intervals – tty activity and cpu utilization
• vmstat -d #seconds #intervals – snapshot of paging activity
• sar -d #seconds #intervals – disk activity
• sar -b #seconds #intervals – buffer activity
• sar -w #seconds #intervals – swapping activity
• swapinfo -t – swap space utilization
• nfsstat -c – nfs statistics for the client
• nfsstat -s – nfs statistics for the server
• nfsstat -rc – rpc statistics for the client
• nfsstat -rs – rpc statistics for the server
• glance gpm
PERFORMANCE AND TUNING – NETWORKING AND I/O BOTTLENECKS
Symptoms:
• Slow application performance
• Time-out requests
• High utilization from LAN tool
• Retries
• Collisions
• Errors
• High I/O activity

Tunable kernel parameters:
• nproc
• ninode
• nfile
• nflocks

Tools:
• ping
• netstat -i – for interface analysis – not good: Ierrs > 5%
• netstat -a – for socket analysis
• netstat -m – for memory analysis
• netstat -r – for router analysis
• iostat -t #seconds #intervals – for terminal activity

PERFORMANCE MONITORING TOOL – MEMORY USAGE

memusg – A tool to compute the memory/IPC resources on a machine.

This utility will do the following :
a) Prints a status of all IPC configurable parameters status per machine.
b) Prints memory usage of a Unix user-id. This particular feature takes a few seconds to generate as it makes an expensive call to the process table. The usage is as follows :

memusg -i Prints a status of the IPC parameters
memusg -m Prints memory usage of a Unix user-id
memusg -h Prints a description of all IPC parameters

This should help us in determining the memory being used per user, there by plan on the memory requirements for a machine.

GLANCE / GPM

Uses /var/opt/perf/parm to assign application groups to each process. Uses midaemon to collect the real time data. Uses /var/opt/perf/alarmdef for the alarms (CPU Bottleneck)

Glance is the ASCII version. GPM is the GUI version. In order to use gpm, you must export your display.

Both of these performance tools, give you access to real-time data like: CPU Utilization, Disk Utilization, Network Utilization, Memory Utilization, System Tables, and it also give you insight into application utilization.

Useful Glance commands:
• glance Process List
• glance -t System Tables (nproc, nfile, ninode, shmmni, semmni, msgmni, nflocks, npty)
• glance -m Memory Report (page faults, paging requests, paged in, paged out,
deactivations, total memory, system memory, user memory, free memory,
physical memory, buffer cache)

Notes:

  1. Using gpm, you can narrow down on items such as narrowing down on a process to see what its wait state is.
  2. Only the system administrators should have permissions to run both glance and gpm. A few other users like the Oracle DBA’s are given permission to execute glance via inclusion to the sadba UNIX group.

PERFVIEW

This tool converts the log files that scopeux collects into a graphical output. This is a good tool to look back into time to see what affect a process has on the system, or what affect the new version of Telegence has on the system. It is also good for trending – CPU Utilization, Memory Utilization, Swap Utilization, and Run Queue.

Type “pv” to execute.

MEASUREWARE

Measureware is the basis for glance, glance plus, and perfview. It collects the data for real time analysis, and archives the data so that you can look at the past history. It also can send alarms to OpCenter when CPU Utilization reaches a specified threshold for longer than the specified timeframe.

Important files:
/var/opt/perf/alarmdef Alarm definitions which are sent to perfview or OpC
/var/opt/perf/parm The file that assigns processes into application groups

Important cronjobs:
/root_home/bin/monitor.scope If scopeux is down, the system restarts it – done every 10 or 20
minutes

Useful commands:

mwa stop all To stop all of measureware
mwa start all To start all of measureware
mwa stop scope To stop the data collection (scopeux)
mwa start scope To start the data collection (scopeux)
agsysdb -l Look at the alarm database
agsysdb -add [hostname] To add an analysis system to this system’s measureware database
agsysdb -del [hostname] To delete an analysis system from this systems’ measureware database
mwa restart server To restart the mwa server (done after adding/removing analysis systems)
mwa restart alarm To restart the alarms (done after tweaking the alarms)

Setting up Measureware alarms

Define alarms that you want to monitor:

  1. Define your alarm definitions in the following file: /var/opt/perf/alarmdef
  2. Check the syntax of the alarm definition file by typing as root:
    · utility
    · checkdef
    · Type the full path of the alarm definition file.
  3. To start alarming with the new definitions, type: “mwa restart alarm”

View the history of measureware alarms

This will show you the date, time, and length of alarms on a system that are defined in the alarm definition file.

Type the following as root:
· utility
· start mm/dd/yy HH:MM
· end mm/dd/yy HH:MM
· analyze
· Choose /var/opt/perf/alarmdef as the alarm definition file

Turning off Measureware alarms

The easiest way to turn off the measureware products before performing patch maintenance is to type “mwa stop all”. Once the system is rebooted, measureware should come up on its own.
PRM – Process Resource Manager.

This is a product which can reserve CPU and memory to specified processes when the system reaches 100% utilization.

Important Files:
/etc/prmconf PRM Configuration – current
/etc/prmconf.am PRM Configuration – for the daytime
/etc/prmconf.pm PRM Configuration – for the nighttime

Important Cronjobs:
/root_home/bin/monitor.prm If PRM is down, the system restarts it
/root_home/bin/PRM/move_operations Moves all processes into the Operations bucket – hourly
/root_home/bin/PRM/move_onlines Moves all processes into the Onlines bucket – hourly
/root_home/bin/PRM/move_oracle Moves all processes into the Oracle bucket – hourly
/root_home/bin/PRM/PRM_am_conf Puts the daytime PRM configuration into place
/root_home/bin/PRM/PRM_pm_conf Puts the nighttime PRM configuration into place

Important Commands:
prmmonitor Current status of prm
prmconfig -e Enables all of prm
prmconfig -e CPU Enables the CPU part of prm
prmconfig -e MEM Enables the memory part of prm
prmconfig -d Disables all of prm
prmconfig -d CPU Disables the CPU part of prm
prmconfig -d MEM Disables the memory part of prm
HP SYSTEM-SPECIFIC KNOWLEDGE

REBUILD A KERNEL

When you are generating a new kernel, there is a parameter that needs to be checked before you build the new kernel. You must go to /usr/conf/gen and vi config.sys. Search for SZLIMIT the value should be 2147483647. If it is not that, then change it so that the line reads:

SZLIMIT= -l 2137483647

That character after the = sign is a minus(-) l (the letter l ).

This change will allow you to generate a large kernel. Also, do not try to reboot a system if you get a message that the kernel is too large. Disregarding this message could corrupt the kernel.

  1. Copy the system file and the current kernel to a safe place:
    • cd /stand
    • cp system system.prev
    • cp vmunix vmunix.prev
  2. Make changes to the system file:
    • vi /stand/system Add the tunable parameters that you need
  3. Generate the new kernel:
    • mk_kernel -s /stand/system
  4. Move the new kernel into place:
    • mv /stand/build/vmunix_test /stand/vmunix
  5. Reboot

HOW TO BOOT WITH NO / BAD KERNEL IN PLACE
How to find an alternate kernel to boot off of

Problem:
Can not find /stand/vmunix. After you have rebooted a system.

Find an alternate kernel:
From the ISL> prompt, type “hpux ls /stand” for a listing in /stand

Boot off the alternate kernel:
From the ISL> prompt, type “hpux /stand/vmunix.[name]”
What to do when you mirrored vg00 wrong and system will not boot

What to do when you get the message, “Can not find /stand/vmunix”, when you have rebooted a machine.

This message means that this system is trying to locate /stand/vmunix, and can not find it because / and /stand are two different filesystems. You will need to fix the lvlnboot area and possibly how the lvols are kept on the boot drive.

  1. Boot into maintenance mode:
    At the ISL> prompt, type “hpux -lm”
  2. Once you receive the prompt, you will need to mount a few filesystems:
    • vgchange -a y vg00
    • mount /usr
    • mount /var
    • mount /tmp
  3. Check out is currently defined the boot definitions for the root volume group:
    • lvlnboot -v vg00
    • You should see the following if there is a filesystem for “/” and another one for “/stand”:
    • boot: lvol1 on: /dev/dsk/c?t?d0
    • root: lvol3 on: /dev/dsk/c?t?d0
    • swap lvol2 on: /dev/dsk/c?t?d0
    • dump lvol2 on: /dev/dsk/c?t?d0
  4. Since we did not see a definition for boot, we did the following steps:
    • pvdisplay -v /dev/dsk/c4t6d0 (the primary boot drive) | more
    • The logical volumes were in this order:
    • lvol1
    • lvol3
    • lvol4
    • lvol5
    • lvol6
    • lvol7
    • lvol8
    • lvol9
    • lvol10
  5. Look to see the order of the logical volumes on the mirrored boot drive
    • pvdisplay -v /dev/dsk/c4t5d0 (the mirror boot drive) | more
    • The logical volumes were in this order:
    • lvol3  This should not be the first lvol on this disk!!
    • lvol1
  6. Break the mirror to the lvols that on the /dev/dsk/c4t5d0 disk:
    for i in 1 3 4 5 6 7 8 9 10
    do
    lvreduce -m 0 /dev/vg00/lvol$i /dev/dsk/c4t5d0
    done
  7. Once the mirror is broken, fix the boot definitions for vg00:
    • Lvrmboot -r /dev/vg00
    • lvlnboot -v vg00 Make sure it is empty
    • lvlnboot -r /dev/vg00/lvol3 For the root logical volume
    • lvlnboot -s /dev/vg00/lvol2 For the swap logical volume
    • lvlnboot -d /dev/vg00/lvol2 For the dump logical volume
    • lvlnboot -b /dev/vg00/lvol1 For the boot logical volume
    • lvlnboot -v vg00 Make sure that root, boot, swap, and dump is right
    • lvlnboot -R To save the current definitions if it is correct
  8. Mirror the boot drive:
    for i in 1 3 4 5 6 7 8 9 10
    do
    lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c4t5d0
    done
  9. Boot off of the mirror to make sure that it will boot:
    • setboot -p 10/0.5 Set it to the correct path to the mirrored boot drive
    • cd
    • shutdown -r -y 0
  10. Boot off the primary boot drive:
    • setboot -p 10/0.6 Set it to the correct path to the mirrored boot drive
    • cd
    • shutdown -r -y 0

ADD / MONITOR SWAP SPACE

ADD TEMPORARY SWAP SPACE

  1. Determine if you can add swap without rebuilding a kernel:
    • swapinfo -t # find out how much swap is there currently
    • cat /stand/system | grep maxswap # kernel parameter – multiply it by 2Mb (32Gb is
    max)
    • cat /stand/system | grep nswap # kernel parameter – number of swap devices
  2. Determine where space is available
    for i in `strings /etc/lvmtab | grep vg | sort
    do
    echo $i
    vgdisplay $i | grep -e Mbyte -e Free
    done
  3. When space is located, create a new logical volume for the swap area:
    lvcreate -L /dev/vg??
  4. Once the logical volume has been created, enable swapping with swapon:
    swapon /dev/vg??lvol?
  5. To see the additional swap:
    • swapinfo -t

NOTE: The swap will go away the next time the system is rebooted.
ADD PERMANENT SWAP SPACE

  1. Determine if you can add swap without rebuilding a kernel:
    • swapinfo -t # find out how much swap is there currently
    • cat /stand/system | grep maxswap # kernel parameter – multiply it be 2MB (32Gb is
    max)
    • cat /stand/system | grep nswap # kernel parameter – number of swap devices
  2. Determine where space is available
    for i in `strings /etc/lvmtab | grep vg | sort
    do
    echo $i
    vgdisplay $i | grep -e Mbyte -e Free
    done
  3. When space is located, create a new logical volume for the swap area:
    lvcreate -L /dev/vg??
  4. Once the logical volume has been created, enable swapping with swapon:
    swapon /dev/vg??lvol?
  5. To see the additional swap:
    • swapinfo -t
  6. To make the swap permanent:
    • If the swap is permanent, modify /etc/fstab with the appropriate entry.

An excerpt from /etc/fstab is shown below. Note that lvol11 through 15 and lvol7 and 8 are listed and are secondary swap. Also note that lvol8 is commented out and subsequently will not be mounted at boot time. However, swapon /dev/vg21/lvol8 will enable this swap area for the duration of the current boot session if it becomes necessary to add swap on-the-fly. The command cat /etc/fstab produced the following partial listing.

/dev/vg00/lvol11 … swap pri=1 0 2
/dev/vg00/lvol12 … swap pri=1 0 2
/dev/vg00/lvol13 … swap pri=1 0 2
/dev/vg00/lvol14 … swap pri=1 0 2
/dev/vg00/lvol15 … swap pri=1 0 2
/dev/vg21/lvol7 … swap pri=1 0 2

/dev/vg21/lvol8 … swap pri=1 0 2 # can be used temporarily

Note that primary swap is not listed in /etc/fstab since it is created by default on the same disk (or volume group) as the root file system. Typing swapinfo -t will reveal the following listing of all swap area. Note that primary swap is located on /dev/vg00/lvol2, and, that /dev/vg00/lvol2 is not listed in /etc/fstab

root@chico:/root_home> swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 2072576 760 2071816 0% 0 – 1 /dev/vg00/lvol2
dev 2072576 928 2071648 0% 0 – 1 /dev/vg00/lvol11
dev 2072576 900 2071676 0% 0 – 1 /dev/vg00/lvol12
dev 1024000 1004 1022996 0% 0 – 1 /dev/vg00/lvol13
dev 1122304 928 1121376 0% 0 – 1 /dev/vg00/lvol14
dev 1048576 620 1047956 0% 0 – 1 /dev/vg00/lvol15
dev 1024000 952 1023048 0% 0 – 1 /dev/vg21/lvol7

Note that there are 6 secondary listings corresponding to the 6 active entries in /etc/fstab, one area that is commented out (/dev/vg21/lvol8) and one primary swap area, /dev/vg00/lvol2.

TROUBLES WITH THE SWAPON COMMAND

If you do the swapon command, sometimes it will not swap on a device that appears to have a filesystem on it.

If you are ABSOLUTELY sure that there is no filesystem on the logical volume that you are trying to use for swap:
• cat /stand/vmunix > /dev/vg??/lvol?
• swapon /dev/vg??/lvol?

HOW TO REDUCE PRIMARY SWAP

In order to have adequate space to mirror the OS, primary swap had to be reduced.

  1. Boot into maintenance mode.
  2. vgchange -a y vg00
  3. mount /usr, /var, and /tmp
  4. lvrmboot -s /dev/vg00 (removes swap from the boot configuration)
  5. lvrmboot -d lvol2 /dev/vg00 (Be careful! Removes dump from the boot configuration)
  6. lvremove /dev/vg00/lvol2 (blows away original swap device)
  7. lvcreate -L vg00
  8. lvchange -C y /dev/vg00/lvol2 (makes dump area contiguous)
  9. swapon /dev/vg00/lvol2
  10. lvlnboot -d /dev/vg00/lvol2 (adds dump to boot configuration)
  11. lvlnboot -s /dev/vg00/lvol2 (adds swap to boot configuration)
  12. init 4 (boots into multi-user mode)

HOW TO FIND PHYSICAL MEMORY

  1. To get the amount of physical memory, type dmesg

When the system boots, the status information is stored in the boot log file and may be recalled using the dmesg command. The following is an excerpt from that information and provides memory information (among other things). This particular system has 4 gigabytes of actual hardware memory.

Memory Information:
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 3932160 Kbytes, lockable: 2924480 Kbytes, available: 3357340 Kbytes

To get the amount of physical memory when dmesg no longer contains physical memory: glance -m

NETWORK COMMANDS

RESET THE FDDI

Check the status of the FDDI card:

  1. lanscan # check to make sure hardware state is up
  2. ifconfig lan? # check to make sure state is up
  3. fddistat lan? # see if it fails hardware check

To reset the fddi:

  1. lanscan # find out which device the fddi is on lan0 or lan1
  2. fddistop /dev/lan? # to stop the fddi
  3. fddiinit -s /dev/lan? # to initialize the fddi
  4. ifconfig lan? up # to enable the
  5. Check network accessibility

RESET THE ETHERNET

When you need to reset the ethernet card, try:

  1. lanscan # find out what the NM ID of the ethernet card.
  2. lanadmin
  3. Choose “lan” for the LAN interface administration menu
  4. Choose “nmid” from the menu to change the network management id of the lan interface
  5. Type in the number for the NM ID of the ethernet card from your lanscan
  6. Choose “reset” to reset lan interface to execute its selftest
  7. Quit

CHANGE THE DEFAULT GATEWAY

Example:

Change the default gateway all of the servers that attach to the “C” switched FDDI from 10.3.1.1 to 10.3.0.5.

• vi /etc/rc.config.d/netconf Change the default gateway value to 10.3.0.5 from
10.3.1.1
• vi /etc/hosts space If there is an entry for default being 10.3.1.1, change the
10.3.1.1 to 10.3.0.5
• netstat -r Look at the current routing configuration
• route add default 10.3.0.5 1 Add the new gateway BEFORE deleting the old one
• netstat -r Look at the current routing configuration to make sure
the new route is there
• route delete default 10.3.1.1 Delete the old gateway
• netstat -r Look at the current routing configuration to make sure
that the old route is gone

Note: The space in the address shown above is for the number of hops
Interesting UNIX problems:

Symptom: user unable to rlogin to problem host..

Error: /dev/null permission denied (/dev/null is a file instead of a special file)

Solution:
• rm /dev/null
• mknod /dev/null c 3 0x000002
• chmod 666 /dev/null
• chown bin:bin /dev/null
Interesting UNIX specific files:

Cron Access:

File: /var/adm/cron/cron.allow
Usage: User must be included in this file to have cron access

FTP Access:

File: /etc/ftpusers
Usage: User must be excluded from this file in order to have FTP access

FTP not working and user has FTP access, check:

File: /var/adm/syslog/syslog.log

Interesting UNIX commands:

Interesting tape commands:

mt -t /dev/[tape device] rew Rewinds the tape
mt -t /dev/[tape device] offl Rewinds and ejects the tape
Setting up NTP time synchronization

  1. Remove old time setting metholds (if present) from cron:
    • setime
    • ntpdate
  2. Edit the /etc/rc.config.d/netdaemons and set NTP startup variables as follows:
    • export NTPDATE_SERVER=”bambam dallascc pegasus”
    • XNTP=1
    • export XNTP_ARG=
  3. Copy standard client /etc/ntp.conf file from dallascc:/distfiles/template_root/ntp.conf
  4. Check to see if NTP process is already running. If it is, kill it
    • ps -ef | grep xntp | grep -v grep
    • kill -15
  5. Start the NTP process on the client machine.
    • /usr/sbin/xntpd
    LVM Overview
    How to create a mapfile without destroying the current volume groups

root@quartz:/root_home> for i in strings /etc/lvmtab | grep vg | awk -F"/dev/" '{print $NF}'
do
vgexport -s -p -m $i.mapfile /dev/$i
done

Volume group “/dev/vg00” is still active.
Volume group “/dev/vg02” is still active.
Volume group “/dev/vg03” is still active.

root@quartz:/root_home> ll *.mapfile
-rw-r–r– 1 root sys 94 Nov 17 18:54 vg00.mapfile
-rw-r–r– 1 root sys 134 Nov 17 18:54 vg02.mapfile
-rw-r–r– 1 root sys 78 Nov 17 18:54 vg03.mapfile

root@quartz:/root_home> cat vg00.mapfile
VGID 520d73ab2fbaf918
1 lvol1
2 lvol2
7 lvol7
4 lvol4
5 lvol5
3 lvol3
6 lvol6
8 lvol8
9 lvol9

How to remove a volume group

Deactivate the volume group:

root@jade:/dev> vgchange -a n /dev/vg00_old
Volume group “/dev/vg00_old” has been successfully changed.

Remove the volume group:

root@jade:/dev> vgexport -m vg00_old.map /dev/vg00 _old
root@jade:/dev> ll *.map
-rw-rw-rw- 1 root sys 102 Sep 14 18:26 vg00_old.map

Vgimport volume group with a mapfile

Make the volume group directory:
root@jade:/dev> mkdir vg01

Make the volume group control file:
root@jade:/dev> mknod /dev/vg01/group c 64 0x010000

Vgimport the volume group with the mapfile with the specified disks:
root@jade:/dev> vgimport -m /root_home/vg01.mapfile /dev/vg01 /dev/dsk/c0t0d0 /dev/dsk/c1t0d0 /dev/dsk/c2t0d0 /dev/dsk/c3t0d0 /dev/dsk/c4t0d0

Activate the volume group
root@jade:/dev> vgchange -a y /dev/vg01
Vgimport volume group with a mapfile that was created with the “-s” option

Make the volume group directory:
root@jade:/dev> mkdir vg01

Make the volume group control file:
root@jade:/dev> mknod /dev/vg01/group c 64 0x010000

Vgimport the volume group with the mapfile without the disks:
root@jade:/dev> vgimport -m /root_home/vg01.mapfile /dev/vg01

Activate the volume group
root@jade:/dev> vgchange -a y /dev/vg01

Vgimport volume groups without a mapfile

Make the volume group directories:

root@jade:/dev> mkdir vg01 vg02 vg03 vg04 vg05 vg06 vg07

Make the volume group control files:

root@jade:/dev> mknod /dev/vg01/group c 64 0x010000
root@jade:/dev> mknod /dev/vg02/group c 64 0x020000
root@jade:/dev> mknod /dev/vg03/group c 64 0x030000
root@jade:/dev> mknod /dev/vg04/group c 64 0x040000
root@jade:/dev> mknod /dev/vg05/group c 64 0x050000
root@jade:/dev> mknod /dev/vg06/group c 64 0x060000
root@jade:/dev> mknod /dev/vg07/group c 64 0x070000

Find out which disks were in which volume groups:

vgroot@jade:/dev> strings /etc/lvmtab.old* | grep vg
/dev/vg00
/dev/dsk/c4t6d0
/dev/dsk/c4t4d0
/dev/dsk/c4t5d0
/dev/vg01
/dev/dsk/c0t0d0
/dev/dsk/c0t1d0
/dev/dsk/c0t2d0
/dev/dsk/c0t3d0
/dev/vg02
/dev/dsk/c0t4d0
/dev/dsk/c0t5d0
/dev/dsk/c0t8d0
/dev/dsk/c0t9d0
/dev/vg03
/dev/dsk/c0t10d0
/dev/dsk/c0t11d0
/dev/dsk/c0t12d0
/dev/dsk/c0t13d0
/dev/vg04
/dev/dsk/c1t0d0
/dev/dsk/c1t1d0
/dev/dsk/c1t2d0
/dev/dsk/c1t3d0
/dev/vg05
/dev/dsk/c1t4d0
/dev/dsk/c1t5d0
/dev/dsk/c1t8d0
/dev/dsk/c1t9d0
/dev/vg06
/dev/dsk/c1t10d0
/dev/dsk/c1t11d0
/dev/dsk/c1t12d0
/dev/dsk/c1t13d0
/dev/vg07
/dev/dsk/c4t12d0
/dev/dsk/c4t13d0
/dev/dsk/c4t14d0
/dev/dsk/c4t15d0

vgimport the disks into the right volume groups:

root@jade:/dev> vgimport /dev/vg01 /dev/dsk/c0t0d0 /dev/dsk/c0t1d0 /dev/dsk/c0t2d0 /dev/dsk/c0t3d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg02 /dev/dsk/c0t4d0 /dev/dsk/c0t5d0 /dev/dsk/c0t8d0 /dev/dsk/c0t9d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg03 /dev/dsk/c0t10d0 /dev/dsk/c0t11d0 /dev/dsk/c0t12d0 /dev/dsk/c0t13d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg04 /dev/dsk/c1t0d0 /dev/dsk/c1t1d0 /dev/dsk/c1t2d0 /dev/dsk/c1t3d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg05 /dev/dsk/c1t4d0 /dev/dsk/c1t5d0 /dev/dsk/c1t8d0 /dev/dsk/c1t9d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg06 /dev/dsk/c1t10d0 /dev/dsk/c1t11d0 /dev/dsk/c1t12d0 /dev/dsk/c1t13d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

root@jade:/dev> vgimport /dev/vg07 /dev/dsk/c4t12d0 /dev/dsk/c4t13d0 /dev/dsk/c4t14d0 /dev/dsk/c4t15d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

Activate the volume groups:

root@jade:/dev> for i in 1 2 3 4 5 6 7

do
vgchange -a y /dev/vg0$i
done
Activated volume group
Volume group “/dev/vg01” has been successfully changed.
Activated volume group
Volume group “/dev/vg02” has been successfully changed.
Activated volume group
Volume group “/dev/vg03” has been successfully changed.
Activated volume group
Volume group “/dev/vg04” has been successfully changed.
Activated volume group
Volume group “/dev/vg05” has been successfully changed.
Activated volume group
Volume group “/dev/vg06” has been successfully changed.
Activated volume group
Volume group “/dev/vg07” has been successfully changed.

Find out what logical volumes are present and fsck them:

root@jade:/dev> vgdisplay -v /dev/vg01 | grep lvol
LV Name /dev/vg01/lvol1
LV Name /dev/vg01/lvol2
LV Name /dev/vg01/lvol3
LV Name /dev/vg01/lvol4

root@jade:/dev> for i in 1 2 3 4

do
fsck -F vxfs /dev/vg01/lvol$i
done
log replay in progress
replay complete – marking super-block as CLEAN
log replay in progress
replay complete – marking super-block as CLEAN
log replay in progress
replay complete – marking super-block as CLEAN
log replay in progress
replay complete – marking super-block as CLEAN

Vgimport a volume group (partial)

  1. Make the volume group directory:
    root@jade:/dev> mkdir vg00_old
  2. Create the group file for the volume group:
    root@jade:/dev> mknod /dev/vg00_old/group c 64 0x090000
  3. Vgimport some of the disks from a volume group:
    root@jade:/dev> vgimport -v -m /dev/vg00_old/vg00.map /dev/vg00_old /dev/dsk/c4t6d0 /dev/dsk/c4t4d0

Beginning the import process on Volume Group “/dev/vg00_old”.
vgimport: Warning: Volume Group contains “3” PVs, “2” specified. Continuing.
Logical volume “/dev/vg00_old/lvol1” has been successfully created with lv number 1.
Logical volume “/dev/vg00_old/lvol2” has been successfully created with lv number 2.
Logical volume “/dev/vg00_old/lvol3” has been successfully created with lv number 3.
Logical volume “/dev/vg00_old/lvol4” has been successfully created with lv number 4.
Logical volume “/dev/vg00_old/lvol5” has been successfully created with lv number 5.
Logical volume “/dev/vg00_old/lvol6” has been successfully created with lv number 6.
Logical volume “/dev/vg00_old/lvol7” has been successfully created with lv number 7.
Logical volume “/dev/vg00_old/lvol8” has been successfully created with lv number 8.
Logical volume “/dev/vg00_old/lvol9” has been successfully created ith lv number 9.
Logical volume “/dev/vg00_old/lvol10” has been successfully created wth lv number 10.
Logical volume “/dev/vg00_old/lvol11” has been successfully created wth lv number 11.
Logical volume “/dev/vg00_old/lvol12” has been successfully created with lv number 12.
Volume group “/dev/vg00_old” has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

  1. Check to see if the volume group is in /etc/lvmtab:
    root@jade:/dev> strings /etc/lvmtab | grep vg
    /dev/vg00
    /dev/vg00_old
  2. Activate the volume group:
    root@jade:/dev> vgchange -a y /dev/vg00_old
    Activated volume group
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    vgchange: Couldn’t re-synchronize stale partitions of the logical volume: I/O error
    Volume group “/dev/vg00_old” has been successfully changed.

What to do if vgimport does not work

  1. Find the volume group configuration files of the volume group:
    cd /etc/lvmconf
  2. Apply the volume group configuration to the disk drives in the volume group:
    vgcfgrestore -f /etc/lvmconf/vg01.conf /dev/rdsk/c4t2d0
  3. Then, try the vgimport again:
    vgimport -m vg01.mapfile /dev/vg01 /dev/dsk/c4t2d0 /dev/dsk/c5t2d0 /dev/dsk/c7t2d0 /dev/dsk/c8t2d0
  4. Activate the volume group:
    vgchange -a y /dev/vg01

Practical application of vgexport and vgimport:

Example:
Saturday Add (2) CPU’s and a power supply to system. All of the SCSI cables
needed to be moved to make room for the CPU’s.

• Print out an ioscan before the box is taken down to add the hardware. This will help you later on when the system comes back up:

ioscan -kfnC disk | lp -oc -dbell2q4

• Make the mapfiles of all of the volume groups:
for i in strings /etc/lvmtab | grep vg | grep -v vg00 | awk -F"/dev/" '{print $NF}'
do
echo $i
vgexport -s -p -m /root_home/$i.mapfile /dev/$i
done

• Check to make sure that the mapfiles were created.
• Halt the system when you are sure that you can use the mapfiles to recreate all of the volume groups.
• After the hardware work has been done, stop the reboot procedure.
• Bring the system to ODE
• When you are at the ODE prompt, type, “run mapper” to see if you see the same number of drives as you had before, using the ioscan.
• When you are able to see all of the drives, bring the system up to single-user mode: hpux -is
• Once you get the root prompt, type:
• vgchange -a y vg00
• mount /usr
• mount /var
• mount /tmp
• ioscan
• insf -e To create all of the new device files
• Make sure that you have the same number of drives by using the ioscan.
• Once you are sure that you have the same number of drives, type:
for i in strings /etc/lvmtab | grep vg | grep -v vg00 | awk -F"/dev/"'{print $NF}'
do
echo $i
vgimport -s -m /root_home/$i.mapfile /dev/$i
done
• Then you can type,
for i in strings /etc/lvmtab | grep vg
do
vgchange -a -y $i
done
• Once all of the volume groups are activated, you can mount all of the local filesystems to see if you need to run fsck on any filesystem.
• Once you are sure that everything has been successfully recreated, bring the system to multi-user mode, by typing, init 4
Return the system to normal operations.

LVM QUESTIONS AND ANSWERS

Question:
Vgexport must be run on a system that has the volume groups in the inactive state?
Can you do vgexport and create mapfiles on a system that has the volume groups active? If so what happens?

Answer:
vgexport with the -p option can be run on a system while the volume groups are still active without destroying the volume group information

Example:
You want to create a mapfile of /dev/vg10 while vg10 is active, you would use the following command:
vgexport -p -m [name of mapfile] /dev/vg10

Further example:
If you want to destroy a volume group (filesystems in that volume group aren’t needed anymore), the following needs to be done:
vgchange -a n /dev/vgXX
vgexport /dev/vgXX

Further information:
In order for you to get back information about that volume group, you would use vgimport.

Examples:

  1. You have lost a volume group vg99 on a system called spot for where you knew that the disk drives in that volume group contained: /dev/dsk/c1t6d0 /dev/dsk/c2t6d0 /dev/dsk/c3t6d0

vgimport /dev/vg99 /dev/dsk/c1t6d0 /dev/dsk/c2t6d0 /dev/dsk/c3t6d0

  1. You want to bring back the same volume group, but you don’t know the drives that were in that volume group:

vgcfgrestore -f /etc/lvmconf/vg99.conf -l <– this will list the disk drives that were in the volume group
vgimport /dev/vg99 /dev/dsk/c1t6d0 /dev/dsk/c2t6d0 /dev/dsk/c3t6d0

Advanced knowledge about vgimport/vgexport:

To create mapfiles so that you do not need to know the disk drives when you import the volume groups. (For example, you did a hardware upgrade and it will change all of the hardware addressing, where /dev/dsk/c1t6d0 turns into /dev/dsk/c17t6d0, etc.):

vgexport -s -p -m [name of mapfile] /dev/vg10
You would do your hardware upgrade.
To bring back that volume group with the correct drives:
cd /dev
mkdir vg10
mknod /dev/vg10/group c 64 0x0a0000
vgimport -s -m [name of mapfile] /dev/vg10

Question #1:

What happens when new boot drives are added to a system called spot (for example: when we use boot drives that were created elsewhere and stuck them into a different machine):

How do I know which ones I can add back as the boot disk since I forgot to create a map file:
This is a little more difficult, but can be overcome.

Boot up into single-user mode. At the ISL> prompt, type “hpux -is”
ioscan -kfnC disk
From the ioscan, you can find the /dev/dsk names if you know which slots.

Example:
You know that the hardware engineers put the drives in slots 0/28/28.6.0, 0/28/28/52.5, 0/28/28/4.0
Use ioscan -kfnC disk to find out what /dev/dsk/c?t?d0 matches with each slot
If you look at the ioscan for instance /dev/dsk/c2t6d0 /dev/dsk/c2t5d0 /dev/dsk/c2t4d0 were in those slots, you would import vg00 with the following command:
vgimport /dev/vg00 /dev/dsk/c2t6d0 /dev/dsk/c2t5d0 /dev/dsk/c2t4d0
vgchange -a y /dev/vg00
mount -a

Question #2:
New drives are added to spot, how do you access those drives?
Assumption: these are newly added drives that can not be imported

Answer:
You would need to do the following to put those newly added drives into a volume group:
You would need to reboot the system in order for the system to see those drives
You would need to know which slots these drives were added to
Use an ioscan without any options to see if you can see all of those drives
Use insf -e to recreate the device files
ioscan -kfnC disk | pg <— Now look for those newly added drives
When you find the /dev/dsk/c?t?d? names, you would need to format those drives by:
pvcreate -f /dev/rdsk/c?t?d?
Now, create your volume group:
cd /dev
mkdir vg??
mknod /dev/vg??/group c 64 0xHH0000 Where ?? is the number for your volume group
Where HH is the number in hex for your vg
vgcreate /dev/vg?? /dev/dsk/c?t?d? … /dev/dsk/c?t?d?

Note: If you have a problem creating a volume group, look at the kernel parameter “maxvgs”. The default out of the box is set to 10 volume groups.

Question #3:
I have been playing with the lvlnboot command telling the system where the boot logical volume is, the root logical volume, etc. What happens if I remove the information (lvrmboot -r /dev/vg00) and the system crashes before I get to tell it the correct lvlnboot -b logical volume? How do I get the system back working?

You will need to boot off of support media in order to get to a point where you can fix the lvlnboot stuff.

LVM EXAMPLE – EXTEND STRIPED FILESYSTEM

Scenario: Your team lead has instructed you to check if /usr/local/oracle can be extended 1.5 GB (striped). You must determine if there is enough disk space available and if the FS type can handle an extension online, i.e. on the fly.

First, we must find out if we can expand the FS online.

use bdf on the FS to find the VG info

bdf /usr/local/oracle

Filesystem kbytes used avail %used Mounted on
/dev/vg18/lvol4 1050624 614348 409042 60% /usr/local/oracle

use fstype on the VG to learn the FS type: vxfs or hfs

fstyp /dev/vg18/lvol4

vxfs

use swlist to show the product level of software on file system

swlist -l product | grep -i vxfs | grep -v PH

AdvJournalFS B.10.20 The Advanced VxFS File System
JournalFS B.10.20 The Base VxFS File System

In order to extend file systems online, the Advanced VxFS must be installed.

This HP File System can be extended on the fly! Next check the VG for disk space.

use vgdisplay to show the amount of disk space, number of disks, etc…

vgdisplay -v /dev/vg18

— Volume groups —
VG Name /dev/vg18
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 10
Open LV 10
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 4500
VGDA 6
PE Size (Mbytes) 1
Total PE 13203
Alloc PE 12758
Free PE 445
Total PVG 0

— Logical volumes —
LV Name /dev/vg18/lvol1
LV Status available/syncd
LV Size (Mbytes) 4065
Current LE 4065
Allocated PE 4065
Used PV 3

LV Name /dev/vg18/lvol2
LV Status available/syncd
LV Size (Mbytes) 4065
Current LE 4065
Allocated PE 4065
Used PV 3

< More Logical Volumes Here >

— Physical volumes —
PV Name /dev/dsk/c6t1d0
PV Status available
Total PE 4401
Free PE 0

PV Name /dev/dsk/c6t1d1
PV Status available
Total PE 4401
Free PE 445

PV Name /dev/dsk/c9t1d0
PV Status available
Total PE 4401
Free PE 0

The Physical volumes section is what you need to check. One disk has 445 MB, not enough to extend the /usr/local/oracle FS to 1.5 GB.

Since there is not enough disk space to extend the FS, check the VG for any other non-productive file systems, which can perhaps be moved to another VG.

use bdf to show all the file systems for the VG

bdf | grep vg18

/dev/vg18/lvol2 4162560 2400 4127672 0% /wtxbilling04

/wtxbilling04 looks like a good candidate to move from the VG.

/dev/vg18/lvol1 4162560 2400 4127672 0% /wtxbilling03
/dev/vg18/lvol10 102400 46753 52177 47% /usr/localcw
/dev/vg18/lvol3 1050624 891066 150834 86% /usr/local
/dev/vg18/lvol9 102400 85996 15426 85% /usr/local/vertex
/dev/vg18/lvol4 1050624 614348 409042 60% /usr/local/oracle
/dev/vg18/lvol8 750000 217860 504246 30% /usr/local/maestro
/dev/vg18/lvol5 1050624 564694 455562 55% /usr/local/g1
/dev/vg18/lvol6 204800 126187 73799 63% /usr/local/dazel

use fuser to check if the FS is being used

fuser -cu /wtxbilling04

/wtxbilling04:

No users are shown to be in the filesystem.

cd to the mount point and list the files

cd /wtxbilling04

ll

total 0
drwxr-xr-x 2 root root 96 Mar 27 1998 lost+found

The FS looks pretty empty at this point. A safe bet that you can unmount the FS and move it to another location.

cd to the previous directory and other mount point

cd –

/root_home

unmount the FS and comment out the mount point entry in /etc/fstab

umount /wtxbilling04

vi /etc/fstab

/dev/vg15/lvol6 /tlgvarwtx/wtx/projs/dc vxfs delaylog 0 2
/dev/vg16/lvol1 /wtxbilling01 vxfs delaylog 0 2
/dev/vg16/lvol2 /wtxbilling02 vxfs delaylog 0 2
/dev/vg16/lvol3 /wtxarchive01 vxfs delaylog 0 2
/dev/vg17/lvol1 /wtxarchive02 vxfs delaylog 0 2
/dev/vg17/lvol3 /ahbilling04 vxfs delaylog 0 2
/dev/vg18/lvol1 /wtxbilling03 vxfs delaylog 0 2

/dev/vg18/lvol2 /wtxbilling04 vxfs delaylog 0 2

This is the entry that must be commented out.

the LV can now be removed

lvremove /dev/vg18/lvol2

Current path “/dev/dsk/c9t1d1” is an alternate link, skip.
Current path “/dev/dsk/c12t1d0” is an alternate link, skip.
Current path “/dev/dsk/c12t1d1” is an alternate link, skip.
The logical volume “/dev/vg18/lvol2” is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume “/dev/vg18/lvol2” has been successfully removed.

Volume Group configuration for /dev/vg18 has been saved in /etc/lvmconf/vg18.conf

check the VG again

vgdisplay -v vg18

— Volume groups —
VG Name /dev/vg18
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 4500
VGDA 6
PE Size (Mbytes) 1
Total PE 13203
Alloc PE 8693
Free PE 4510
Total PVG 0

— Logical volumes —
LV name /dev/vg18/lvol1
LV Status available/syncd
LV Size (Mbytes) 4065
Current LE 4065
Allocated PE 4065
Used PV 3

Notice that /dev/vg18/lvol2 is no longer displayed.

LV Name /dev/vg18/lvol3
LV Status available/syncd
LV Size (Mbytes) 1026
Current LE 1026
Allocated PE 1026
Used PV 3

LV Name /dev/vg18/lvol4
LV Status available/syncd
LV Size (Mbytes) 1026
Current LE 1026
Allocated PE 1026
Used PV 3
LV Name /dev/vg18/lvol5
LV Status available/syncd
LV Size (Mbytes) 1026
Current LE 1026
Allocated PE 1026
Used PV 3
LV Name /dev/vg18/lvol6

— Physical volumes —
PV Name /dev/dsk/c6t1d0
PV Name /dev/dsk/c9t1d1 Alternate Link
PV Status available
Total PE 4401
Free PE 1355

PV Name /dev/dsk/c6t1d1
PV Name /dev/dsk/c12t1d0 Alternate Link
PV Status available
Total PE 4401
Free PE 1800

PV Name /dev/dsk/c9t1d0
PV Name /dev/dsk/c12t1d1 Alternate Link
PV Status available
Total PE 4401
Free PE 1355

Now each physical disk in the VG has enough space to extend /usr/local/oracle to 1.5 GB.

just a quick check at this point to find which LV oracle was on

bdf /usr/local/oracle

Filesystem kbytes used avail %used Mounted on
/dev/vg18/lvol4 1050624 614348 409042 60% /usr/local/oracle

use lvextend to extend the LV to 1.5 GB

lvextend -L 1500 /dev/vg18/lvol4

Logical volume “/dev/vg18/lvol4” has been successfully extended.
Volume Group configuration for /dev/vg18 has been saved in /etc/lvmconf/vg18.conf

a quick check of the LV

lvdisplay /dev/vg18/lvol4

— Logical volumes —
LV Name /dev/vg18/lvol4
VG Name /dev/vg18
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule striped
LV Size (Mbytes) 1500
Current LE 1500
Allocated PE 1500
Stripes 3
Stripe Size (Kbytes) 8
Bad block off
Allocation strict
IO Timeout (Seconds) default

Notice the new LV Size – 1500 MB

now check the number of free disk blocks

bdf /usr/local/oracle

Filesystem kbytes used avail %used Mounted on
/dev/vg18/lvol4 1050624 614348 409042 60% /usr/local/oracle

The LV size was moved to 1500 but the block size did not change. Why?

you must use the FS admin tool for vxfs to resize the blocks

fsadm -F vxfs -b 1500000 /dev/usr/local/oracle

fsadm: /dev/vg18/rlvol4 is currently 1050624 sectors – size will be increased

now check the block size again

bdf /usr/local/oracle

Filesystem kbytes used avail %used Mounted on
/dev/vg18/lvol4 1500000 614452 830234 43% /usr/local/oracle

Note the new blocksize in kilobytes.

Now that /usr/local/oracle has been extended, we must now build a replacement logical volume to mount wtxbilling04.

use this script to search for free space in all the VGs

for i in strings /etc/lvmtab | grep vg do

echo $i
vgdisplay $i | grep -e Free -e Mbyte
done

/dev/vg00
PE Size (Mbytes) 4
Free PE 1295

/dev/vg01
PE Size (Mbytes) 1
Free PE 108

/dev/vg12
PE Size (Mbytes) 1
Free PE 858

/dev/vg13
PE Size (Mbytes) 1
Free PE 6

/dev/vg18
PE Size (Mbytes) 1
Free PE 4036

VG18 looks like a good place to put the new 4GB FS.

create the new lv utilizing the entire free space on vg18

lvcreate -L 4036 /dev/vg18

Logical volume “/dev/vg18/lvol2” has been successfully created with
character device “/dev/vg18/rlvol2”.
Logical volume “/dev/vg18/lvol2” has been successfully extended.
Volume Group configuration for /dev/vg18 has been saved in /etc/lvmconf/vg18.conf

make the lv ready for a file system

newfs -F vxfs /dev/vg18/rlvol2

version 3 layout
4132864 sectors, 4132864 blocks of size 1024, log size 1024 blocks
unlimited inodes, 4132864 data blocks, 4130728 free data blocks
127 allocation units of 32768 blocks, 32768 data blocks
last allocation unit has 4096 data blocks
first allocation unit starts at block 0
overhead per allocation unit is 0 blocks

edit the fstab

vi /etc/fstab

/dev/vg17/lvol3 /ahbilling04 vxfs delaylog 0 2
/dev/vg18/lvol1 /wtxbilling03 vxfs delaylog 0 2
/dev/vg18/lvol2 /wtxbilling04 vxfs delaylog 0 2

This is the line you need to add to the fstab. Keep the LVs in order.

remount wtxbilling and check if it mounted on the correct lv

mount /wtxbilling04

bdf | grep wtx

/dev/vg18/lvol1 4162560 2400 4127672 0% /wtxbilling03
/dev/vg16/lvol2 4162560 1323261 2661918 33% /wtxbilling02
/dev/vg16/lvol1 4162560 2845407 1234931 70% /wtxbilling01
/dev/vg18/lvol2 4132864 2120 3872580 0% /wtxbilling04

mount

/stand on /dev/vg00/lvol1 defaults on Thu Jan 7 23:01:12 1999
/wtxbilling03 on /dev/vg18/lvol1 delaylog on Thu Jan 7 23:02:17 1999
/wtxbilling02 on /dev/vg16/lvol2 delaylog on Thu Jan 7 23:02:17 1999
/wtxbilling01 on /dev/vg16/lvol1 delaylog on Thu Jan 7 23:02:17 1999
/wtxbilling04 on /dev/vg18/lvol2 delaylog on Fri Jan 22 13:31:07 1999

Both the bdf and the mount displays show that wtxbilling has been correctly configured.

A summary of the commands are as follows:

bdf
ex: bdf /usr/local/oracle

fstyp
ex: fstyp /dev/vg18/lvol4

swlist -l product | grep -i vxfs | grep -v PH

vgdisplay -v
ex: vgdisplay -v /dev/vg18

fuser -cu
ex: fuser -cu /oracle

lvremove
ex: lvremove /dev/vg18/lvol2

lvdisplay -v
ex: lvdisplay -v vg18

lvremove
ex: lvremove /dev/vg18/lvol2

lvextend -L
ex: lvextend -L 1500 /dev/vg18/lvol2

fsadm -F -b
ex: fsadm -F vxfs -b 1500000 /dev/usr/local/oracle

lvcreate -L
ex: lvcreate -L 2500 /dev/vg08

newfs -F
ex: newfs -F vxfs /dev/vg18/rlvol4

MIRROR LOGICAL VOLUMES

If a filesystem is on HP internal disks, it needs to be mirrored for high availability.

Note: Be careful when you mirror the boot drives since the how the boot and root logical volumes are placed on the boot drives is very important!

Look to see which drives are in the volume group:

vgdisplay -v vg00 | grep dsk | awk ‘{print $NF}’

/dev/dsk/c0t5d0
/dev/dsk/c0t8d0
/dev/dsk/c0t9d0
/dev/dsk/c0t10d0

Look to see how much free space is on each disk in the volume group:

pvdisplay /dev/dsk/c0t5d0

— Physical volumes —
PV Name /dev/dsk/c0t5d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 11
PE Size (Mbytes) 4
Total PE 1023
Free PE 143
Allocated PE 880
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t8d0

— Physical volumes —
PV Name /dev/dsk/c0t8d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 4
PE Size (Mbytes) 4
Total PE 1023
Free PE 492
Allocated PE 531
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t9d0

— Physical volumes —
PV Name /dev/dsk/c0t9d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 4
Total PE 1023
Free PE 1023
Allocated PE 0
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t10d0

— Physical volumes —
PV Name /dev/dsk/c0t10d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 4
Total PE 1023
Free PE 698
Allocated PE 325
Stale PE 0
IO Timeout (Seconds) default

NOTE: The plan is to move off all of the logical volumes on /dev/dsk/c0t10d0 to either /dev/dsk/c0t5d0 or
/dev/dsk/c0t8d0. Once all of the logical volumes have been moved, then we can extend the
volume group by one disk. Once the volume group has enough drives, then we can mirror all of the logical volumes from the first two disks to the last two disks in the volume group.

Look to see which logical volumes are on the disk that we will be using for mirroring. This will tell us which logical volumes need to be moved off of this disk onto the first two disks.

pvdisplay -v /dev/dsk/c0t10d0 | pg

— Physical volumes —
PV Name /dev/dsk/c0t10d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 4
Total PE 1023
Free PE 698
Allocated PE 325
Stale PE 0
IO Timeout (Seconds) default

— Distribution of physical volume —

LV Name LE of LV PE for LV
/dev/vg00/lvol11 325 325  Notice there is only one logical volume on this disk drive.

— Physical extents —
PE Status LV LE

Move the logical volume from /dev/dsk/c0t10d0 to one that has space:

pvmove -n /dev/vg00/lvol11 /dev/dsk/c0t10d0 /dev/dsk/c0t8d0

Transferring logical extents of logical volume “/dev/vg00/lvol11″…
Physical volume “/dev/dsk/c0t10d0” has been successfully moved.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

vgdisplay -v vg00 | grep dsk

PV Name /dev/dsk/c0t5d0
PV Name /dev/dsk/c0t8d0
PV Name /dev/dsk/c0t9d0
PV Name /dev/dsk/c0t10d0

pvdisplay /dev/dsk/c0t5d0

— Physical volumes —
PV Name /dev/dsk/c0t5d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 11
PE Size (Mbytes) 4
Total PE 1023
Free PE 143
Allocated PE 880
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t8d0

— Physical volumes —
PV Name /dev/dsk/c0t8d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 5
PE Size (Mbytes) 4
Total PE 1023
Free PE 167
Allocated PE 856
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t9d0

— Physical volumes —
PV Name /dev/dsk/c0t9d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 4
Total PE 1023
Free PE 1023
Allocated PE 0
Stale PE 0
IO Timeout (Seconds) default

pvdisplay /dev/dsk/c0t10d0

— Physical volumes —
PV Name /dev/dsk/c0t10d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 4
Total PE 1023
Free PE 1023
 Notice all of the Physical Extents are free
Allocated PE 0
Stale PE 0
IO Timeout (Seconds) default

Plan: Mirror all of the logical volumes that exist on /dev/dsk/c0t5d0 to /dev/dsk/c0t9d0. Mirror all of the logical volumes on /dev/dsk/c0t8d0 to /dev/dsk/c0t10d0.

Find out which logical volumes are on the first disk (/dev/dsk/c0t5d0):

pvdisplay -v /dev/dsk/c0t5d0 | pg

— Physical volumes —
PV Name /dev/dsk/c0t5d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 11
PE Size (Mbytes) 4
Total PE 1023
Free PE 143
Allocated PE 880
Stale PE 0
IO Timeout (Seconds) default

— Distribution of physical volume —
LV Name LE of LV PE for LV
/dev/vg00/lvol3 50 50  Which logical volumes are on this disk
/dev/vg00/lvol1 50 50
/dev/vg00/lvol7 125 125
/dev/vg00/lvol5 77 77
/dev/vg00/lvol8 90 90
/dev/vg00/lvol6 38 38
/dev/vg00/lvol4 125 125
/dev/vg00/lvol10 75 75
/dev/vg00/lvol13 100 100
/dev/vg00/lvol16 125 125
/dev/vg00/lvol18 25 25

— Physical extents —
PE Status LV LE
0000 current /dev/vg00/lvol1 0000  The order of logical volumes on this disk
0001 current /dev/vg00/lvol1 0001
0002 current /dev/vg00/lvol1 0002
0003 current /dev/vg00/lvol1 0003

Mirror in the same order as what is on the first disk:

for i in 1 3 7 5 8 6 4 10 13 16 18

do
lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c0t9d0
done

The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ….
Logical volume “/dev/vg00/lvol1” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

Find out which logical volumes are on the other vg00 disk:

pvdisplay -v /dev/dsk/c0t8d0 | pg

— Physical volumes —
PV Name /dev/dsk/c0t8d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 5
PE Size (Mbytes) 4
Total PE 1023
Free PE 167
Allocated PE 856
Stale PE 0
IO Timeout (Seconds) default

— Distribution of physical volume —

LV Name LE of LV PE for LV

/dev/vg00/lvol2 256 256  Which logical volumes are on this disk
/dev/vg00/lvol12 325 325
/dev/vg00/lvol14 125 125
/dev/vg00/lvol5 100 100
/dev/vg00/lvol11 50 50

— Physical extents —

PE Status LV LE
0000 current /dev/vg00/lvol2 0000  The order of logical volumes on this disk
0001 current /dev/vg00/lvol2 0001
0002 current /dev/vg00/lvol2 0002
0003 current /dev/vg00/lvol2 0003

Mirror the logical volumes from /dev/dsk/c0t8d0 to /dev/dsk/c0t10d0:

for i in 2 12 14 15 11

do
lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c0t8d0 /dev/dsk/c0t10d0
done

The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ….
Logical volume “/dev/vg00/lvol2” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

Example: Extend vg00 by its mirrored drives

Look for the disks that should belong in the same group:

root@dewey:/root_home> ioscan -kfnC disk | grep c4

                     /dev/dsk/c4t3d0   /dev/rdsk/c4t3d0
                     /dev/dsk/c4t4d0   /dev/rdsk/c4t4d0
                     /dev/dsk/c4t5d0   /dev/rdsk/c4t5d0
                     /dev/dsk/c4t6d0   /dev/rdsk/c4t6d0

Look at the current lvlnboot:

root@dewey:/root_home> lvlnboot -v vg00

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t6d0 (10/0.6.0) — Boot Disk
/dev/dsk/c4t4d0 (10/0.4.0)
Boot: lvol1on: /dev/dsk/c4t6d0
Root: lvol3on: /dev/dsk/c4t6d0
Swap: lvol2on: /dev/dsk/c4t4d0
Dump: lvol2on: /dev/dsk/c4t4d0, 0

Format a bootable drive:

root@dewey:/root_home> pvcreate -fB /dev/rdsk/c4t5d0

Physical volume “/dev/rdsk/c4t5d0” has been successfully created.
root@dewey:/root_home> mkboot /dev/rdsk/c4t5d0
root@dewey:/root_home> mkboot -a “hpux” /dev/rdsk/c4t5d0

Format a non-bootable drive:

root@dewey:/root_home> pvcreate -f /dev/rdsk/c4t3d0

Physical volume “/dev/rdsk/c4t3d0” has been successfully created.

Extend the root volume group:

root@dewey:/root_home> vgextend /dev/vg00 /dev/dsk/c4t5d0 /dev/dsk/c4t3d0

Volume group “/dev/vg00” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

Check to see which logical volumes are on the primary boot drive:

root@dewey:/root_home> pvdisplay -v /dev/dsk/c4t6d0 | pg

— Physical volumes —
PV Name /dev/dsk/c4t6d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 11
PE Size (Mbytes) 4
Total PE 1023
Free PE 0
Allocated PE 1023
Stale PE 0
IO Timeout (Seconds) default

— Distribution of physical volume —
LV Name LE of LV PE for LV
/dev/vg00/lvol3 50 50
/dev/vg00/lvol1 12 12
/dev/vg00/lvol7 125 125
/dev/vg00/lvol5 100 100
/dev/vg00/lvol8 75 75
/dev/vg00/lvol6 38 38
/dev/vg00/lvol4 125 125
: /dev/vg00/lvol9 75 75
/dev/vg00/lvol10 125 125
/dev/vg00/lvol11 25 25
/dev/vg00/lvol12 273 273

— Physical extents —
PE Status LV LE
0000 current /dev/vg00/lvol1 0000
0001 current /dev/vg00/lvol1 0001
0002 current /dev/vg00/lvol1 0002
0003 current /dev/vg00/lvol1 0003

Mirror the primary boot drive to the other boot drive:

root@dewey:/root_home> for i in 3 1 7 5 8 6 4 9 10 11 12
do
lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c4t5d0
done

The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait ….
Logical volume “/dev/vg00/lvol3” has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

Look at the new lvlnboot -v area:

root@dewey:/root_home> lvlnboot -v vg00

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t6d0 (10/0.6.0) — Boot Disk
/dev/dsk/c4t4d0 (10/0.4.0)
/dev/dsk/c4t5d0 (10/0.5.0) — Boot Disk
/dev/dsk/c4t3d0 (10/0.3.0)
Boot: lvol1 on: /dev/dsk/c4t6d0
/dev/dsk/c4t5d0
Root: lvol3 on: /dev/dsk/c4t6d0
/dev/dsk/c4t5d0
Swap: lvol2 on: /dev/dsk/c4t4d0
Dump: lvol2 on: /dev/dsk/c4t4d0, 0

EXAMPLE: Rebuilding a system after the Operating System was corrupted

  1. The corrupted operating system was on one internal disk (/dev/dsk/c4t5d0).
  2. The other disks in vg00 were taken out of the vg00 volume group so that they could be mounted to determine if there was anything salvagable from the mirrored part of the operating system.
  3. Find out the paths of the boot drives. In this case, the internal drives are the drives that were in vg00 when the operating system became corrupted.

ioscan -kfnC disk

Class I H/W Path Driver S/W State H/W Type Description

disk 0 8/0.0.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 8/0.1.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t1d0 /dev/rdsk/c0t1d0
disk 2 8/0.2.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t2d0 /dev/rdsk/c0t2d0
disk 3 8/0.3.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t3d0 /dev/rdsk/c0t3d0
disk 4 8/0.4.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t4d0 /dev/rdsk/c0t4d0
disk 5 8/0.5.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t5d0 /dev/rdsk/c0t5d0
disk 6 8/0.8.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t8d0 /dev/rdsk/c0t8d0
disk 7 8/0.9.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t9d0 /dev/rdsk/c0t9d0
disk 8 8/0.10.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t10d0 /dev/rdsk/c0t10d0
disk 9 8/0.11.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t11d0 /dev/rdsk/c0t11d0
disk 10 8/0.12.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t12d0 /dev/rdsk/c0t12d0
disk 11 8/0.13.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t13d0 /dev/rdsk/c0t13d0
disk 12 8/0.15.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d0 /dev/rdsk/c0t15d0
disk 13 8/0.15.1 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d1 /dev/rdsk/c0t15d1
disk 14 8/0.15.2 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d2 /dev/rdsk/c0t15d2
disk 15 8/0.15.3 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d3 /dev/rdsk/c0t15d3
disk 16 8/0.15.4 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d4 /dev/rdsk/c0t15d4
disk 17 8/0.15.5 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c0t15d5 /dev/rdsk/c0t15d5
disk 18 8/4.0.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t0d0 /dev/rdsk/c1t0d0
disk 19 8/4.1.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t1d0 /dev/rdsk/c1t1d0
disk 20 8/4.2.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 21 8/4.3.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t3d0 /dev/rdsk/c1t3d0
disk 22 8/4.4.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t4d0 /dev/rdsk/c1t4d0
disk 23 8/4.5.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t5d0 /dev/rdsk/c1t5d0
disk 24 8/4.8.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t8d0 /dev/rdsk/c1t8d0
disk 25 8/4.9.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t9d0 /dev/rdsk/c1t9d0
disk 26 8/4.10.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t10d0 /dev/rdsk/c1t10d0
disk 27 8/4.11.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t11d0 /dev/rdsk/c1t11d0
disk 28 8/4.12.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t12d0 /dev/rdsk/c1t12d0
disk 29 8/4.13.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t13d0 /dev/rdsk/c1t13d0
disk 30 8/4.15.0 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 31 8/4.15.1 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d1 /dev/rdsk/c1t15d1
disk 32 8/4.15.2 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d2 /dev/rdsk/c1t15d2
disk 33 8/4.15.3 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d3 /dev/rdsk/c1t15d3
disk 34 8/4.15.4 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d4 /dev/rdsk/c1t15d4
disk 35 8/4.15.5 sdisk CLAIMED DEVICE EMC SYMMETRIX /dev/dsk/c1t15d5 /dev/rdsk/c1t15d5
disk 36 10/0.3.0 sdisk CLAIMED DEVICE SEAGATE ST19171W /dev/dsk/c4t3d0 /dev/rdsk/c4t3d0
disk 37 10/0.4.0 sdisk CLAIMED DEVICE SEAGATE ST19171W /dev/dsk/c4t4d0 /dev/rdsk/c4t4d0
disk 38 10/0.5.0 sdisk CLAIMED DEVICE Quantum XP34361WD /dev/dsk/c4t5d0 /dev/rdsk/c4t5d0
disk 39 10/0.6.0 sdisk CLAIMED DEVICE Quantum XP34361WD /dev/dsk/c4t6d0 /dev/rdsk/c4t6d0
disk 40 10/0.12.0 sdisk CLAIMED DEVICE SEAGATE ST15150W /dev/dsk/c4t12d0 /dev/rdsk/c4t12d0
disk 41 10/0.13.0 sdisk CLAIMED DEVICE SEAGATE ST15150W /dev/dsk/c4t13d0 /dev/rdsk/c4t13d0
disk 42 10/0.14.0 sdisk CLAIMED DEVICE SEAGATE ST15150W /dev/dsk/c4t14d0 /dev/rdsk/c4t14d0
disk 43 10/0.15.0 sdisk CLAIMED DEVICE SEAGATE ST15150W /dev/dsk/c4t15d0 /dev/rdsk/c4t15d0

  1. Find out if the internal drives (except the current vg00 drive – /dev/dsk/c4t5d0) are in a volume group:
    root@jade:/dev> for i in c4t6 c4t4 c3 4t3 c4t15 c4t14 c4t13 c4t12

do
strings /etc/lvmtab | grep $i
done

/dev/dsk/c4t15d0  This drive is in a volume group on the system
/dev/dsk/c4t14d0  This drive is in a volume group on the system
/dev/dsk/c4t13d0  This drive is in a volume group on the system
/dev/dsk/c4t12d0  This drive is in a volume group on the system

  1. Find out what is in the boot definition area:

root@jade:/dev> lvlnboot -v

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t5d0 (10/0.5.0) — Boot Disk
No Boot Logical Volume configured
Root: lvol3 on: /dev/dsk/c4t5d0
Swap: lvol2 on: /dev/dsk/c4t5d0
Dump: lvol2 on: /dev/dsk/c4t5d0, 0

  1. Format the internal drives (/dev/dsk/c4t6d0, /dev/dsk/c4t4d0, and /dev/dsk/c4t3d0)that are not in a volume group:

root@jade:/dev> pvcreate -fB /dev/rdsk/c4t6d0
Physical volume “/dev/rdsk/c4t6d0” has been successfully created.
root@jade:/dev> pvcreate -f /dev/rdsk/c4t4d0
pvPhysical volume “/dev/rdsk/c4t4d0” has been successfully created.
root@jade:/dev> pvcreate -f /dev/rdsk/c4t3d0
Physical volume “/dev/rdsk/c4t3d0” has been successfully created.
root@jade:/dev> diskinfo /dev/rdsk/c4t6d0 | grep -i size
size: 4194157 Kbytes
root@jade:/dev> diskinfo /dev/rdsk/c4t4d0 | grep -i size
size: 8886762 Kbytes
root@jade:/dev> diskinfo /dev/rdsk/c4t3d0 | grep -i size
size: 8886762 Kbytes
root@jade:/dev> mkboot /dev/dsk/c4t6d0
root@jade:/dev> mkboot -a “hpux -lq” /dev/dsk/c4t6d0
root@jade:/dev> mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p HPUX -p AUTO -p LABEL /dev/dsk/c4t5d0

  1. Make a new volume to hold vg00 information:

root@jade:/dev> mkdir vg00_new
root@jade:/dev> mknod /dev/vg00_new/group c 64 0x090000
root@jade:/dev> vgcreate -s 3000 -e 4
root@jade:/dev> mknod /dev/vg00 _new/group c 64 0x090000
root@jade:/dev> vgcreate -e 3000 -s 4 /dev/vg00_new /dev/dsk/c4t6d0 /dev/dsk/c4t4d0 /dev/dsk/c4t3d0
Volume group “/dev/vg00_new” has been successfully created.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/dev> vgdisplay -v vg00_new

— Volume groups —
VG Name /dev/vg00_new
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 3000
VGDA 6
PE Size (Mbytes) 4
Total PE 5361
Alloc PE 0
Free PE 5361
Total PVG 0

— Physical volumes —
PV Name /dev/dsk/c4t6d0
PV Status available
Total PE 1023
Free PE 1023

PV Name /dev/dsk/c4t4d0
PV Status available
Total PE 2169
Free PE 2169

PV Name /dev/dsk/c4t3d0
PV Status available
Total PE 2169
Free PE 2169

root@jade:/dev> cd /
root@jade:/> mkdir new_root
root@jade:/> lvdisplay /dev/vg00/lvol1
— Logical volumes —
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 48
Current LE 12
Allocated PE 12
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

  1. Make logical volumes for /dev/vg_new look like /dev/vg00:
    root@jade:/> lvcreate -L 48 -s y -C y -r n /dev/vg00_new
    Logical volume “/dev/vg00_new/lvol1” has been successfully created with character device “/dev/vg00_new/rlvol1”.
    Logical volume “/dev/vg00_new/lvol1” has been successfully extended.
    Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf

root@jade:/> fstyp /dev/vg00/lvol1
hfs
root@jade:/> newfs -F hfs /dev/vg00_new/rlvol1

root@jade:/> lvdisplay /dev/vg00/lvol2
— Logical volumes —
LV Name /dev/vg00/lvol2
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 512
Current LE 128
Allocated PE 128
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

root@jade:/> lvcreate -L 512 -s y -C y -r n /dev/vg00_new
Logical volume “/dev/vg00_new/lvol2” has been successfully created with character device “/dev/vg00_new/rlvol2”.
Logical volume “/dev/vg00_new/lvol2” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf

root@jade:/> lvdisplay /dev/vg00 _new/lvol2
— Logical volumes —
LV Name /dev/vg00_new/lvol2
VG Name /dev/vg00_new
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 512
Current LE 128
Allocated PE 128
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict/contiguous
IO Timeout (Seconds) default

root@jade:/> lvdisplay /dev/vg00/lvol3
— Logical volumes —
LV Name /dev/vg00/lvol3
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 200
Current LE 50
Allocated PE 50
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

root@jade:/> lvcreate -L 200 -s y -C y -r n /dev/vg00_new
Logical volume “/dev/vg00_new/lvol3” has been successfully created with character device “/dev/vg00_new/rlvol3”.
Logical volume “/dev/vg00_new/lvol3” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf

root@jade:/> fstyp /dev/vg00/ lvol3
vxfs

root@jade:/> newfs -F vxfs /dev/vg00_new/rlvol3

  1. Start mounting the filesystems for /dev/vg00_new
    root@jade:/> mkdir new_root
    root@jade:/> mount /dev/vg00_new/lvol3 /new_root
    root@jade:/> cd /new_root
    root@jade:/new_root> mkdir stand
    root@jade:/root_home> mount /dev/vg00_new/lvol1 /new_root/stand
    root@jade:/root_home> bdf
    Filesystem kbytes used avail %used Mounted on
    /dev/vg00/lvol3 204800 20908 172453 11% /
    /dev/vg00/lvol8 409600 84460 305555 22% /var
    /dev/vg00/lvol9 716800 470348 231092 67% /var/adm/sw
    /dev/vg00/lvol7 491520 341294 140936 71% /usr
    /dev/vg00/lvol6 155648 22586 124869 15% /tmp
    /dev/vg00/lvol5 491520 294705 184590 61% /opt
    /dev/vg00/lvol4 798720 642684 146328 81% /home
    /dev/vg00/lvol1 47829 25246 17800 59% /stand
    /dev/vg00/lvol10 307200 237986 64949 79% /var/adm/diag
    /dev/vg00_new/lvol3 204800 1157 190923 1% /new_root
    /dev/vg00_new/lvol1 47829 9 43037 0% /new_root/stand

root@jade:/root_home> lvdisplay /dev/vg00/lvol4 | grep Mbyte
LV Size (Mbytes) 780

root@jade:/root_home> lvcreate -L 780 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol4” has been successfully created with character device “/dev/vg00_new/rlvol4”.
Logical volume “/dev/vg00_new/lvol4” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/root_home> newfs -F vxfs /dev/vg00_new/rlvol4

root@jade:/root_home> cd /new_root
root@jade:/new_root> mkdir home
root@jade:/new_root> mount /dev/vg00_new/lvol4 /new_root/home

root@jade:/new_root> lvdisplay /dev/vg00/lvol5 | grep Mbyte
LV Size (Mbytes) 480

root@jade:/new_root> lvcreate -L 480 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol5” has been successfully created with character device “/dev/vg00_new/rlvol5”.
Logical volume “/dev/vg00_new/lvol5” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/new_root> fstyp /dev/vg00_new/lvol5
vxfs
root@jade:/new_root> mkdir opt
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/rlvol5
root@jade:/new_root> mount /dev/vg00_new/lvol5 /new_root/opt

root@jade:/new_root> lvdisplay /dev/vg00/lvol6 | grep Mbyte
LV Size (Mbytes) 152

root@jade:/new_root> lvcreate -L 152 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol6” has been successfully created with character device “/dev/vg00_new/rlvol6”.
Logical volume “/dev/vg00_new/lvol6” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/rlvol6
root@jade:/new_root> mkdir tmp
root@jade:/new_root> mount /dev/vg00_new/lvol6 /new_root/tmp

root@jade:/new_root> lvdisplay /dev/vg00/lvol7 | grep Mbyte
LV Size (Mbytes) 480

root@jade:/new_root> lvcreate -L 480 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol7” has been successfully created with
character device “/dev/vg00_new/rlvol7”.
Logical volume “/dev/vg00_new/lvol7” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/rlvol7
root@jade:/new_root> mkdir usr

root@jade:/new_root> lvdisplay /dev/vg00/lvol8 | grep Mbyte
LV Size (Mbytes) 400

root@jade:/new_root> lvcreate -L 400 /dev/vg00/ _new
Logical volume “/dev/vg00_new/lvol8” has been successfully created with
character device “/dev/vg00_new/rlvol8”.
Logical volume “/dev/vg00_new/lvol8” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00
_new.conf
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/rlvol8
root@jade:/new_root> mkdir var
root@jade:/new_root> mount /dev/vg00_new/lvol8 new_root/var
root@jade:/new_root> cd var
root@jade:/new_root/var> mkdir adm
root@jade:/new_root/var> cd adm
root@jade:/new_root/var/adm> mkdir sw diag
root@jade:/new_root/var/adm> cd … . /..

root@jade:/new_root> lvdisplay /dev/vg00/lvol9 | grep Mbyte
LV Size (Mbytes) 700

root@jade:/new_root> lvcreate -L 700 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol9” has been successfully created with
character device “/dev/vg00_new/rlvol9”.
Logical volume “/dev/vg00_new/lvol9” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00
_new.conf
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/rlvol9
root@jade:/new_root> mount /dev/vg00_new/lvol9 /new_root/var/adm/sw
root@jade:/new_root> lvdisplay /dev/vg00/lvol10 | grep Mbyte
LV Size (Mbytes) 300

root@jade:/new_root> lvcreate -L 300 /dev/vg00_new
Logical volume “/dev/vg00_new/lvol10” has been successfully created with character device “/dev/vg00_new/rlvol10”.
Logical volume “/dev/vg00_new/lvol10” has been successfully extended.
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
root@jade:/new_root> newfs -F vxfs /dev/vg00_new/r rlvol10
root@jade:/new_root> mount /dev/vg00_new/lvol10 /new_root/var/adm/diag

root@jade:/new_root> bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 20925 172433 11% /
/dev/vg00/lvol8 409600 84468 305547 22% /var
/dev/vg00/lvol9 716800 470348 231092 67% /var/adm/sw
/dev/vg00/lvol7 491520 341294 140936 71% /usr
/dev/vg00/lvol6 155648 22586 124869 15% /tmp
/dev/vg00/lvol5 491520 294705 184590 61% /opt
/dev/vg00/lvol4 798720 642684 146328 81% /home
/dev/vg00/lvol1 47829 25246 17800 59% /stand
/dev/vg00/lvol10 307200 237986 64949 79% /var/adm/diag
/dev/vg00_new/lvol3 204800 1158 190920 1% /new_root
/dev/vg00_new/lvol1 47829 9 43037 0% /new_root/stand
/dev/vg00_new/lvol4 798720 1301 747588 0% /new_root/home
/dev/vg00_new/lvol5 491520 1221 459663 0% /new_root/opt
/dev/vg00_new/lvol6 155648 1141 144858 1% /new_root/tmp
/dev/vg00_new/lvol7 491520 1221 459663 0% /new_root/usr
/dev/vg00_new/lvol8 409600 1205 382877 0% /new_root/var
/dev/vg00_new/lvol9 716800 1277 670810 0% /new_root/var/adm/sw
/dev/vg00_new/lvol10 307200 1181 286900 0% /new_root/var/adm/diag

  1. Copy everything from /dev/vg00 to /dev/vg00_new:

root@jade:/var/adm/diag> find . -xdev -print | cpio -pxdlum /new_root/var/adm/diag &
root@jade:/home> cd /home; find . -xdev -print | cpio -pxdlum /new_root/home &
root@jade:/var> cd /var; find . -xdev -print | cpio -pxdlum /new_root/var &
root@jade:/var/adm/sw> cd /var/adm/sw; find . -xdev -print | cpio -pxdlum /new_root/var/adm/sw &
root@jade:/usr> find . -xdev -print | cpio -pxdlum /new_root/usr &
root@jade:/usr> cd /stand; find . -print | cpio -pxdlum /new_root/stand &
root@jade:/> cd /;find . -xdev -print | cpio -pxdlum /new_root &
root@jade:/tmp> cd /tmp; find . -print | cpio -pxdlum /new_root/tmp &
root@jade:/opt> cd /opt; find . -print | cpio -pxdlum /new_root/opt &

  1. Fix the boot definition area:

root@jade:/opt> lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t5d0 (10/0.5.0) — Boot Disk
No Boot Logical Volume configured
Root: lvol3on: /dev/dsk/c4t5d0
Swap: lvol2on: /dev/dsk/c4t5d0
Dump: lvol2on: /dev/dsk/c4t5d0, 0

lvlnboot: The Boot Data Area is empty.
Boot Definitions for Volume Group /dev/vg00_new:
The Boot Data Area is empty.

root@jade:/opt> lvlnboot -b /dev/vg00_new/lvol1
root@jade:/opt> lvlnboot -r /dev/vg00_new/lvol3
root@jade:/opt> lvlnboot -s /dev/vg00_new/lvol2
root@jade:/opt> lvlnboot -d /dev/vg00_new/lvol2

root@jade:/opt> lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t5d0 (10/0.5.0) — Boot Disk
No Boot Logical Volume configured
Root: lvol3on: /dev/dsk/c4t5d0
Swap: lvol2on: /dev/dsk/c4t5d0
Dump: lvol2on: /dev/dsk/c4t5d0, 0

Boot Definitions for Volume Group /dev/vg00_new:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c4t6d0 (10/0.6.0) — Boot Disk
/dev/dsk/c4t4d0 (10/0.4.0)
/dev/dsk/c4t3d0 (10/0.3.0)
Root: lvol1on: /dev/dsk/c4t6d0
Root: lvol3on: /dev/dsk/c4t6d0
Swap: lvol2on: /dev/dsk/c4t6d0
Dump: lvol2on: /dev/dsk/c4t6d0, 0

Standard inputroot@jade:/dev> lvlnboot -R
Volume Group configuration for /dev/vg00_new has been saved in /etc/lvmconf/vg00_new.conf
Volume Group configuration for /dev/vg05 has been saved in /etc/lvmconf/vg05.conf
Volume Group configuration for /dev/vg07 has been saved in /etc/lvmconf/vg07.conf
Volume Group configuration for /dev/vg06 has been saved in /etc/lvmconf/vg06.conf
Volume Group configuration for /dev/vg04 has been saved in /etc/lvmconf/vg04.conf
Volume Group configuration for /dev/vg03 has been saved in /etc/lvmconf/vg03.conf
Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg02.conf
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

  1. Create mapfiles
    root@jade:/dev> vgexport -p -m vg00.old /dev/vg00
    Volume group “/dev/vg00” is still active.
    root@jade:/dev> vgexport -p -m vg00.new /dev/vg00_new
    Volume group “/dev/vg00_new” is still active.
  2. Shut the system down into maintenance mode or single-user mode
  3. Import the /dev/vg_new drives as vg00
    • vgimport /dev/vg00 /dev/dsk/c46d0 /dev/dsk/c4t4d0 /dev/dsk/c4t3d0
  4. Bring the system up to multi-user mode:
    • init 4

BOOTING OFF OF SUPPORT MEDIA

HP-UX Recovery Media (Cd-rom)

  1. Find the cd-rom that is labeled “HP-UX Recovery Media” for the version of HP-UX that you need. For 11.0, it is the Core/OS cd-rom.
  2. Press Ctrl-B to get to the “CM” prompt
  3. Type “rs” to reset the box
  4. When you see the message “Press any key in 10 seconds to discontinue boot”, press the space bar.
  5. Type “pa” to check your paths
  6. If the path to the cd-rom is not the primary boot path or the alternate boot path, type “pa alt X/X/X.X.X”
    • For example: If the path to the cd-rom is 10/12/5.2.0, type pa alt 10/12/5.2.0
  7. Once the cd-rom path has been entered as the alternate boot path, type bo alt
  8. When you see the message, “Interact with IPL [Y/N]?”, type y
  9. Once you see the “IPL>” prompt, type S800support
  10. This will take you to the recovery media main menu

Ignite tape

  1. On the system, put the ignite tape into the tape drive
  2. Boot the system off of its tape drive
  3. From the Main Menu, choose:
    • Root Disk Make sure that you change the Root disk to the correct boot path
  4. From the System Menu, choose:
    • Confirm the system name
    • Confirm the system’s IP Address
  5. From the File System Menu, choose:
    • Choose Add/Remove Disks
    • Make sure that you choose LVM for the disks should be in vg00
    • Make sure that you choose NONE for the disks that should NOT be in vg00
  6. From the File System Menu, choose:
    • /stand 200 MB HFS Root disk
    • SWAP+DUMP 48 MB Root disk
    • / 200 MB VxFS Root disk
    • /home 1024 MB VxFS Any disk
    • /opt 500 MB VxFS Any disk
    • /tmp 155 MB VxFS Any disk
    • /usr 700 MB VxFS Any disk
    • /var 500 MB VxFS Any disk
    • /var/adm/diag 300 MB VxFS Any disk
    • /var/adm/sw 500 MB VxFS Any disk
    • NOTE: To choose whether the filesystem is on Any disk, choose Additional Information / Logical Volumes / Any Disk
  7. When all of the above information has been changed, then press GO!
  8. It will take anywhere from 2 to 4 hours to restore the system to what is on the ignite tape. larry moe curly shemp
    bilbo frodo pippin hobbit
    chico groucho harpo zeppo
    bowie crockett alamo
    ferguson massey kabota

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.