Operating System - HP-UX
1836483 Members
1962 Online
110101 Solutions
New Discussion

Making exact replica of the boot disk

 
Girish_15
Occasional Contributor

Making exact replica of the boot disk

Hi,
I want to make exact replica of boot disk to another disk.
Boot disk - c1t2d0
Replica - c1t0d0
I don't want the second disk to be mirrored (though it will be exact replica ), but want it to be bootable, so that in case the primary fails, I can boot thru' the second disk.


Till now I have done is:-
pvcreate -f /dev/rdsk/c1t0d0 ( I forgot the -B option )
pvextend /dev/vg00 /dev/dsk/c1t0d0
dd if=/dev/dsk/c1t2d0 of=/dev/dsk/c1t0d0

Please advise as to how should I proceed.

Thanks,
Girish



11 REPLIES 11
Uday_S_Ankolekar
Honored Contributor

Re: Making exact replica of the boot disk

Here is the process

pvcreate -B /dev/rdsk/c1t0d0
vgextend /dev/vg00 /dev/dsk/c1t0d0

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux" /dev/rdsk/c1t0d0
mkboot -a"hpux" -lq" /dev/rdsk/c1t0d0
setboot -a hardware path ( get output from ioscan command)

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0
continue to all the lvols on vg00 (for ex: /,var,tmp,usr,stand etc..)
lvlnboot -r /dev/vg00/lvol3 /dev/vg00
lvlnboot -s /dev/vg00/lvol2 /dev/vg00
lvlnboot -b /dev/vg00/lvol1 /dev/vg00
lvlnboot -d /dev/vg00/lvol2 /dev/vg00

lvlnboot -v now will show disk boot information

Goodluck
-USA..
Good Luck..
Girish_15
Occasional Contributor

Re: Making exact replica of the boot disk

Hi,
Thanks for your reply.
However, I have one doubt with the lvextend -m 1 command. This will create a mirror of lvol's on the second disk????
If so, then I don't need a mirror copy but an exact bootable replica of the boot disk.

Thanks,
Girish
Tim D Fulford
Honored Contributor

Re: Making exact replica of the boot disk

Best if this is done on a quiesent system

dd if=/dev/rdsk/c1t2d0 bs=4096k of=/dev/rdsk/c1t0d0

However, mirroring is really the best way, you might think you dont want a mirror but when you get to using it... oops that was updated after I too the image.

ALTERNATIVELY.. Use ignite-UX to make a boot tape.
make_tape_recovery -vI -x inc_entire=vg00 -a /dev/rmt/0mn
(or similar, from memory)

Tim
-
Uday_S_Ankolekar
Honored Contributor

Re: Making exact replica of the boot disk

-m will sure create mirror on your second disk
I feel during disaster that will mirror copy will come in handy , I am not sure why you don't need it.

-USA..
Good Luck..
Tim D Fulford
Honored Contributor

Re: Making exact replica of the boot disk

oops, I forgot, you do not need to pvcreate the disk or include it in vg00 etc, you blow it all away when you do the dd.

Also TEST you new root disk, you dont know 'till ypu try!

Tim
-
PIYUSH D. PATEL
Honored Contributor

Re: Making exact replica of the boot disk

Girish,

the -m 1 option will create the mirror copy on the second disk and I have done this several times and it has always worked fine. The mirror data will always be useful during the disaster. Whats the use if the system boots but you do not have any data on the root filesystem.

Cheers,
Piyush
Girish_15
Occasional Contributor

Re: Making exact replica of the boot disk

Hi Tim,
I don't want to do mirroring is because, if I want to upgrade my OS and something goes bad ( or let's say I deleted the /stand directory ), I always have the second boot disk from which I can boot and get the system up.
On your reply does it mean that the first 2 steps I have taken are correct. Then I need to boot the machine in single user mode, and then execute the command you gave me.
To test,
I boot up the machine and interrupt and specify Boot alternate option.

Please advise.

Thanks,
Girish
Bill Hassell
Honored Contributor

Re: Making exact replica of the boot disk

You don't need to create any LVM information on the second disk as you'll be copying the first disk as is. In your dd command, ALWAYS use the raw volume:

dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c1t0d0 bs=64k

Also specify a large blocksize (64k is a good size). The default is 512 bytes and dd will take a VERY long time to complete. The dd will significantly faster than mirroring (and the only choice if you did not buy the mirroring software)

Now you have an exact copy but it won't boot properly since the boot string specifies the original disk. Now if you remove both disks and change the addresses, it will work but that is a bit painful. Instead, use the mkboot commands as shown above to customize the second disk. As always, test the results.

Using this technique is a good way to backup a single disk VG00 before patching or upgrading. The alternative is to use make_tape_recovery (I would do both on a production machine).


Bill Hassell, sysadmin
Tim D Fulford
Honored Contributor

Re: Making exact replica of the boot disk

Hi

Boot into single user mode (shutdown -r -y now). Interupt boot sequence.

Main menu: boot
do you want to interact with ISL y/n > y
ISL> hpux -is

Wait for system to come up.

# vgchange -a y vg00
# mountall
# dd if=/dev/rdsk/c1t2d0 bs=4096k of=/dev/rdsk/c1t0d0

This will replicate your disks. NOTE HW path of new disk replica (say 0/2/0/0.0)

To test re-boot & interupt boot sequence
Main menu: boot 0/2/0/0.0
do you want to interact with ISL y/n> n
wait.

There are a couple of things.
1 - Ignite-UX image is by far the best method for doing this, what you are trying to do will probably work, but is not so flexable. Besides DLT/DDS tapes are cheap, disks are expensive
2 - If you use a proper mirroring (if you have mirror-UX) & install new OS on ONE DISK ONLY you can recover straight back to the original, no problems. Simply follow the boot sequence on the mirror disk and interact with ISL, then type "hpux -lq". You will be back where you were before the install. Furthur to this when I do this I usually run on one upgraded root disk for a few days & import the OLD disk as "vgold", mount it appropriately under /oldroot. This way If I have forgotten to migrate anything I can simply copy the files straight back.

I hope the above helps out. As you are no doubt realising there are many ways to skin this HP-UX cat!!

Tim
-
Sunil Sharma_1
Honored Contributor

Re: Making exact replica of the boot disk

Hi,

best way is either use
dd command
or use ignite ux for same.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Alexander M. Ermes
Honored Contributor

Re: Making exact replica of the boot disk

Hi there.
We already had these problems before.
Pls look at this URL :

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x542331ec5e34d711abdc0090277a778c,00.html

The answer of Clay is the best idea in this.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"