HP-UX 11i v3 Persistent DSF Migration Guide

Appendix
Examples of using iofind
Example 1 - Find files containing the DSF names (/dev/dsk/c0t0d0 and /dev/dsk/c2t0d0) starting at
the directory /opt, and preview the replacement with persistent DSFs. This example assumes that there is a
user file, /opt/myconfig, containing DSF /dev/dsk/c2t0d0.
A. Create a file /var/adm/mydsf containing two lines:
/dev/dsk/c0t0d0
/dev/dsk/c2t0d0
B. Run: iofind –n –f /var/adm/mydsf –d /opt –R –p
C. The utility displays files found and asks if you want to change the DSF name in all occurrences
found. Since this is a preview, the changes are not done on the original file but put into a preview
directory. The following is the output from the iofind command:
The following occurrences of /dev/dsk/c2t0d0 was found in file /opt/myconfig:
FileName:Line Number: Matching Pattern
______________________________________
/opt/myconfig:425:# my device name (e.g. /dev/dsk/c2t0d0)
Do you want iofind to replace /dev/dsk/c2t0d0 with /dev/disk/disk3 :(Y)Yes;(N)No;Q(Quit)
? Y
Replaced /dev/dsk/c2t0d0 with /dev/disk/disk3 in file
/var/adm/iofind/logs/013007_142244/preview/opt/myconfig
D. Review the logging files under /var/adm/iofind/logs/mmddyy
_hhmmss (the exact location is
provided by the tool). You can view all the files with matching instances found.
When the tool is run the first time, the iofind command creates an exclusion list at
/var/adm/iofind/cfg/iofind_exclude.cfg. This file includes directories that do not likely contain
ASCII configuration files with legacy information. Searching files in these directories may slow down the tool
execution.
Review the contents of this exclusion file to make sure that there is no file or directory that should be searched. If
there is any, remove the file or directory name from the exclusion file and run iofind again.
Example 2 – Run the same command as above, but without the preview option. If you are satisfied with the
preview results, you may run the tool again and go ahead with the real changes (do not specify –p for
preview):
# iofind –n –f /var/adm/mydsf –d /opt –R
The following are output from the iofind command:
Matching instances will be displayed as follows:
The following occurrences of /dev/dsk/c2t0d0 was found in file /opt/myconfig:
FileName:Line Number: Matching Pattern
______________________________________
/opt/myconfig:425:# my device name (e.g. /dev/dsk/c2t0d0)
Do you want iofind to replace /dev/dsk/c2t0d0 with /dev/disk/disk3 :(Y)Yes;(N)No;Q(Quit)
? Y
Replaced /dev/dsk/c2t0d0 with /dev/disk/disk3 in file /opt/myconfig
17