Operating System - HP-UX
1855860 Members
1839 Online
104107 Solutions
New Discussion

Re: create a spare bootable harddisk on 2nd drive?

 
SOLVED
Go to solution
TC_3
Advisor

create a spare bootable harddisk on 2nd drive?

Hi,
Please help me :
I have a system disk : (hp-ux 10.20 on 735)
2/0/1.6.0 HFS/swap
and 2nd drive 2/0/1.4.0 LVM vg00 :c0t4d0

All I want to do is: make 2nd drive bootable and inherit all the system drive if system disk is bad.
That is: I have a spare bootable disk.
Thanks
TC
tc
20 REPLIES 20
Victor BERRIDGE
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
You havent said if your second drive is in use for anything...
If not, the easiest would be to use Ignite's make_recovery (good practice) and restore on your second disk for that you would have to choose the interractive mode: Once your system is in ISL choose to boot from the tape=>type SEA and choose the correct device to boot from (sequential...)
The system will display something like
: tape (10/12/5.0.0...;0):INSTALL
" ... Welcome to IgniteUX...

Press enter to stop Batch install (Or something like)
Here you enter a menu driven display, choose the disk on which you want to install...

Good Luck
Victor
TC_3
Advisor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
I did not use tape drive to do it.
I want to use system to make another bootable for 2nd drive and possible to use 2nd drive as a bootable if first drive failed.
thanks, any tricks
tc
tc
Paula J Frazer-Campbell
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi TC
If I understand you correctly you want the second drive to be a bootable copy of the operating system and that copy to match your main bootable drive.

If that is so then Victor?s solution is the best and easiest.

1. Download and install ignite ?
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90677/B2355-90677_top.html&con=/hpux/onlinedocs/B2355-90677/00/00/12-con.html&toc=/hpux/onlinedocs/B2355-90677/00/00/12-toc.html&searchterms=ignite&queryid=20001210-101246

2. Use the make_recovery command (see man make_recovery to make a system recovery tape).
3. Reboot you server at go to ISL ? enter SEA and make a note of the path of your spare drive and the tape drive.
4. Select the tape drive to recover from and as it starts stop it and choose the path of the spare disk to install to.
5. One this is complete reboot as normal.

Note that if you make any changes to the configuration of your system you will have to ensure that this process is again carried out so that the second drive remains a viable copy of your main system.

Using Ignite and the make_recovery command is highly recommended.

Paula
If you can spell SysAdmin then you is one - anon
Devbinder Singh Marway
Valued Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi,

Do you have mirroring software installed , if so you can mirror the root disk to the other disk ( thats if you have mirror/ux installed to allow mirroring),

1. pvcreate -B /dev/rdsk/ ( mirror copy disk)
2. Add disk to root VG vgextend /dev/vg?? /dev/dsk/3. place boot utils on boot area of disk
mkboot /dev/rdsk/(disk)
mkboot -a "hpux -lq" /dev/rdsk/(disk)
4.on original disk updat the auto file
mkboot -a "hpux -lq" /dev/rdsk(original disk)

5. Mirror th logivsl volumes including swap onto the mirror copy
lvxtend -m 1 /dev/vg??/lvol1 /dev/dskDo all the root lvols ie.e usr,var etc..

6. Update THE BDRA to say wgere root filesystem is to be found since it is mirrored
lvlnboot -r /dev/vg00/lvol ( doo all LVs mirrored and use -s for swap ( lvlnboot -s (swap vol)

7. Use setboot command to add the mirror copy to the alernate boot path . So if primary disk fails the system will still be up.

OR as suggested uses ignite to create a bootable tape and select the aletrnate disk to restore to OR , you can install HP-UX onto the alternate disk i.e. insert the HP-UX installation CD into drive and when installing :-
1. Select another volume group name i.e. if you already have /dev/vg00 then select /dev/vg01 and use the alternate disk to install OS to. Once installed load necesary patches , setup hosts files etc.. and you have an alternate boot disk, so if the primary disk crashes , you can boot from the alternate disk.

later ..
Seek and you shall find
TC_3
Advisor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
I do not have a tape drive or mirroring software installed.
I just want to make a second copy of system drive in 2nd drive in case I need to use 2nd drive as primary to boot.
Thanks
TC
tc
Victor BERRIDGE
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Well you can always do a dd if your second disk is of same size or bigger you know, something like:
dd if=/dev/dsk/c0t2d0 of=/dev/dsk/c1t4d0 bs=1024

Good luck
Victor
TC_3
Advisor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
should I make 2nd drive bootable first?
Thanks
TC
tc
Victor BERRIDGE
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
If the dd succeeded, there is no need to do anything else but to try to boot from it...

Have I answered your question or were you asking something else?

Best regards
Victor
TC_3
Advisor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
dd is not good for this
It did not finish for 3 hours, have to kill it
something wrong?
how long it take?
Is mkboot then copy files : is better this way?
TC
tc
Paula J Frazer-Campbell
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi

The length of the copy from one drive to another is dependant up on the amount of data that you are transferring.

Stick with the dd command and let it finish then do a diff ?r from one drive to another. The only difference you should see are on the volatile files on your machine.

Files like:-
Syslog
Btmp
Wtmp
Utmp
Database files
Etc.


Paula
If you can spell SysAdmin then you is one - anon
Patrick Wallek
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Paula is right. The time it takes for dd to copy is dependent on many things, one of them being the size of your disks. Others are the speed of your system, the type of disks (ie. SE or FWD SCSI), whether or not the disks are on the same SCSI bus, the speed of the disks themselves, etc.

Like Paula said, start the dd and just let it run. If you happen to go to your system and look at the activity lights on the disks while the dd is running, you will probably see them blinking like crazy indicating a lot of activity.
TC_3
Advisor

Re: create a spare bootable harddisk on 2nd drive?

Hi,
Thanks all.
dd scares me for 4-5 hours without writing anything to destination.

I have only about 500M on first drive c0t6d0 (1G disk)
and 9G 2nd Disk c0t4d0 on the same bus.
The 2nd drive is on vg00/mpd1 as a group for one disk only. and I use dd if=/dev/dsk/c0t6d0 of=/dev/dsk/c0t4d0 bs=1024

I think it should not take so much time.
Any comments? I will try to use dd again sometime later. First I will try to set up my tape drive first. (I really hate to use tape at this IT age).
Thanks all for your input.

TC
tc
Paula J Frazer-Campbell
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

TC
How much memory you have on your system can greatly affect dd, if you can start another telnet session and look at top and swapinfo whilst the dd is running.
Start top with a -q (top -q) and you should see the dd command high on the list.

Swapinfo will give an output like this:-

Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1703936 25180 1678756 1% 0 - 1 /dev/vg00/swap
dev 450560 26540 424020 6% 0 - 1 /dev/vg00/swap1
dev 4190208 0 4190208 0% 0 - 2 /dev/vg04/swap2
reserve - 296136 -296136
memory 2278752 1689844 588908 74%

Pay attention to Kb free you should see some free space, if not that increase your swap size.

Paula
If you can spell SysAdmin then you is one - anon
Rainer_1
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

the dd was slow because you haven't used raw devices and also the blocksize was not efficient.
Here my suggestion:

dd if=/dev/rdsk/c0t6d0 of=/dev/rdsk/c0t4d0 bs=64k

You must not have the second disk within a volume group (use vgreduce before dd)
nnf97
Regular Advisor

Re: create a spare bootable harddisk on 2nd drive?

If all you want is peace of mind.
a) Create a make_recovery -A tape.
b) Pull out your primary harddisk.
c) Plug in the second harddisk.
d) Restore the recovery tape on to this drive.
e) Pull out this back up disk.
f) Plug in the original disk.
g) In case your primary fails, interrupt boot and specify the path of your backup disk to boot from.

But I assume you do not want it for just this, since you would want to restore more than just your OS. So you have to go with mirroring.

Regards,
Nabeel
Live Free or Die (New Hampshire)
Peggy Fong
Respected Contributor
Solution

Re: create a spare bootable harddisk on 2nd drive?

**warning this is a little long- my first post and my apologies - hope someone finds it useful**

I've made a backup root device hundreds of times.

Here is the manual way to create a secondary bootable device as a copy of the primary root disk (not a mirror).

Example:
primary disk= /dev/dsk/c0t6d0
seconday disk= /dev/dsk/c4t6d0

mkdir /dev/vgbroot
mknod /dev/vgbroot group c 64 0x020000
Note: make sure minor node is unique - your choice.

pvcreate -fB /dev/rdsk/c4t6d0
mkboot /dev/rdsk/c4t6d0
mkboot -a "hpux -lq" /dev/rdsk/c4t6d0
lifcp /dev/rdsk/c4t6d0:AUTO -
Note: this is to confirm your AUTO file is ok.

vgcreate /dev/vgbroot /dev/dsk/c4t6d0

lvcreate -L {sizeofstand} -s y -C y -r n -n \ bstand /dev/vgbroot

lvcreate -L {sizeofswap} -s y -C y -c n -r n\ -M n -n bswap /dev/vgbroot

lvcreate -L {sizeofroot} -s y -C y -r n -n broot /dev/vgbroot

lvcreate -L {sizeofusr} -s y -n busr \ /dev/vgbroot

lvcreate -L {sizeoftmp} -s y -n btmp \ /dev/vgbroot

Continue in this manner for every lvol on your primary root disk matching the order on the disk, the size and using any naming convention you want (e.g. blvol1, blvol2, etc) I like broot, bswap, etc. Likewise the volume group can be any name (vgbroot, vg02, vgaltboot, etc)

***Next steps are important or you won't boot from the new disk.
lvlnboot -b /dev/vgbroot/bstand
lvlnboot -r /dev/vgbroot/broot
lvlnboot -s /dev/vgbroot/bswap
lvlnboot -d /dev/vgbroot/bswap

lvlnboot -v
check the output should have vg00 and vgbroot as bootable volume groups.

dd all the lvols on the primary disk to the lvols on the second disk. You can also mount and use cpio if you wish.
Example:

dd if=/dev/vg00/rlvol1 of=/dev/vgbroot/rbstand bs=64k (or whatever bs you want to use)

After your dd's or cpio's are complete, then fsck your filesystems.

Need to edit the fstab on the 2d disk so that it will properly mount file systems.

mkdir /mnt
mount /dev/vgbroot/broot /mnt
cd /mnt/etc
cp fstab Ofstab
edit /mnt/etc/fstab
change the "vg00" to "vgbroot" for all the file systems you put on the second bootable device. Save the file. Also copy the file to /mnt/etc/Bfstab.

umount /dev/vgbroot/broot

You should now be able to boot to the second bootable device (either use setboot -p to change you boot path or interrupt the boot and select the second disk boot path). After that the system should come up and run and include all your other mount points, applications, etc.

This process can be automated and changed, etc.
It has saved us many times and shortened what could have been major outages to a simple reboot.
Hope this helps.
Peggy Fong
Respected Contributor

Re: create a spare bootable harddisk on 2nd drive?

Oops! I forgot to mention the reason I like to do it this way is because it can be scripted, can be done online, backups to the drive can be done online (during slower times), etc. No need to reboot the system until you are ready to test booting from you new alternate boot device.
Regards,
pfong
Paula J Frazer-Campbell
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi to Peggy

Wow for a first post that was a cracker ---

Welcome to the forum

;^)

Paula
If you can spell SysAdmin then you is one - anon
Peggy Fong
Respected Contributor

Re: create a spare bootable harddisk on 2nd drive?

Paula

Thanks for the welcome and the positive feedback. I guess you could say I've been a lurker for the last few weeks. These forums have been extremely helpful - more so than the technical knowledge data base - which has its time and place. :)

Peg
Paula J Frazer-Campbell
Honored Contributor

Re: create a spare bootable harddisk on 2nd drive?

Hi Peggy

I find the forums very very helpful and even though a question might not at this time be pertinent to my current job I like to watch and learn and at times I am truly astonished at the knowledge of some of the Top forumers.

Once again welcome

Paula
If you can spell SysAdmin then you is one - anon