dd cloning device file cleanup

 
SOLVED
Go to solution
Gerard Demers
Occasional Contributor

dd cloning device file cleanup

I'm trying to clone an image from one partition to another. The resultant image builds new device definitions for I/O devices. So I end up with things like lan15 as my primary network interface. How would I remove the old hardware path information and rebuild it + device files to match so my system is reasonably standard? Any suggestions would be appreciated.
4 REPLIES 4
Robert-Jan Goossens
Honored Contributor

Re: dd cloning device file cleanup

Hi,

Hpux version 11.X

# insf -e

With the -e option, insf reinstalls the special files for pseudo-
drivers and existing devices. This is useful for restoring special
files when one or more have been removed.

Regards,
Robert-Jan
Sridhar Bhaskarla
Honored Contributor
Solution

Re: dd cloning device file cleanup

Hi Gerard,

Look at 'ioinit' command. It can be used to manipulate the instances. You can use the following procedure to re-map your instance numbers. But use atmost caution as it may hinder your existing volume groups and other configurations. Have a make_tape_recovery tape done before doing so. Create map files for your volume groups just incase you have to import.

vgexport -p -s -m /tmp/vgxx.map vgxx

1. Shutdown the application and make the system ready-to-be-booted.
2. mkdir /maintenance. ioscan -f /maintenance/ioscan.out. Prepare an 'infile' with the format "HW path class instance". For ex.,

0/8/0/0 lan 1
1/2/0/0 lan 2

you can add other classes too in that file. But make sure you add atleast the disks of your vg00 so they won't get changed.

Test this file using the command 'ioinit -f infile' if it doesn't return any errors like "Instance number is already in kernel", then you can skip the following. Else you need to.


3. Move /sbin/ioconfig and /etc/ioconfig.
mv /stand/ioconfig /stand/ioconfig.old
mv /etc/ioconfig /etc/ioconfig.old

4. Reboot the server. You should be put into ioinitrc# prompt

Create a default ioconfig file

ioinitrc#/sbin/ioinitrc -c

Now use your 'infile' to make changes to ioconfig

ioinit#/sbin/ioinit -f /maintenance/infile -r

This will reboot the server and come up with new instance numbers for the devices you specified in your infile. Also, it may change the instance numbers for other devices such as disks etc., So if things don't work, then you can

1. Either fix them. For VGs, you can simply do a vgexport and vgimport.
2. Or backout the changes. Move /stand/ioconfig and /etc/ioconfig as ioconfig.bad and reboot the box. It will put you back into ioinitrc#. Move the old files and reboot the box again. mv /stand/ioconfig.old /stand/ioconfig and /etc/ioconfig.old /etc/ioconfig.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Gerard Demers
Occasional Contributor

Re: dd cloning device file cleanup

Sri,

Your suggestion worked very well thank you. I noticed one unusual thing however. The symbolic link /dev/lan -> /dev/dlpi was removed somewhere along the line. Is there anything in the instructions you provided that would cause this?

Thanks again..
Sridhar Bhaskarla
Honored Contributor

Re: dd cloning device file cleanup

Hi Gerard,

Not that I know of. ioinit only builds your ioconfig file and no where in the procedure would touch this link. It never happened to me atleast.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try