1832489 Members
4219 Online
110043 Solutions
New Discussion

Re: Mirroring with cpio

 
SOLVED
Go to solution
Warren griggs
Frequent Advisor

Mirroring with cpio

Hi All,

Does anybody know of any way you can mirror the system disk's using cpio.

Also what impact doing this would have on the system?

Thanks for any help in Advance,

Colin.
3 REPLIES 3
JACQUET
Frequent Advisor

Re: Mirroring with cpio

Hello,

I suppose you want a system mirror without using mirror-UX. What i could advise, in order to avoid problems with boot area or whatever, is to use the tool Ignite-UX for such an operation:
- Do a backup of your system by "make_recovery"
- Select a complete free disk and note the Hardware Path
- Boot from the tape containing data from Ignite
- Reinstall your OS on this free disk with right HW Path

You won't see the original disk, but you can boot from both of them on the ISL prompt if once the disk fails.

When the system is in Mutli-user mode,
try to reimport the old "vg00" renaming it and choosing a different major number. (hoping it keeps boot area, and so on)
Then remount all FS with a different root mount point as /save/stand, /save/opt, ...
then do cpio from /opt to /save/opt
...

I don't warrant at all this way of mirroring, but you can try on a test machine if you've got it ! Maybe it works !!!

Regards.

PJA


PJA
Robin Wakefield
Honored Contributor

Re: Mirroring with cpio

Colin,

If I assume you want a mirrored, bootable, system disk, and you have a spare disk for which you know the h/w path and device name, assume 0/4.1.0 and c1t0d0 respectively:

pvcreate -B /dev/rdsk/c1t0d0
mkdir /dev/vgaltboot
mknod /dev/vgaltboot/group c 64 0x020000
vgcreate /dev/vgaltboot /dev/dsk/c1t0d0
lvcreate -C y -L 48 -r n -n lvol1 /dev/vgaltboot
lvcreate -C y -L 800 -r n -n lvol2 /dev/vgaltboot
lvcreate -C y -L 84 -r n -n lvol3 /dev/vgaltboot
lvcreate -L 600 -r -n n lvol4 /dev/vgaltboot
lvcreate -L 512 -r n -n lvol5 /dev/vgaltboot
lvcreate -L 1024 -r n -n lvol6 /dev/vgaltboot
lvcreate -L 1024 -r n -n lvol7 /dev/vgaltboot
mkboot -l -a "hpux (0/4.1.0;0)/stand/vmunix /dev/rdsk/c1t0d0
lvlnboot -b lvol1 /dev/vgaltboot
lvlnboot -s lvol2 /dev/vgaltboot
lvlnboot -d lvol2 /dev/vgaltboot
lvlnboot -r lvol3 /dev/vgaltboot

mkdir /alt_root
mkdir /alt_var
mkdir /alt_opt
mkdir /alt_usr
mkdir /alt_stand
mkdir /alt_tmp
newfs -F hfs /dev/vgaltboot/rlvol1
newfs -F vxfs /dev/vgaltboot/rlvol3
newfs -F vxfs /dev/vgaltboot/rlvol4
newfs -F vxfs /dev/vgaltboot/rlvol5
newfs -F vxfs /dev/vgaltboot/rlvol6
newfs -F vxfs /dev/vgaltboot/rlvol7

add to /etc/fstab:

/dev/vgaltboot /alt_stand hfs defaults 0 1
/dev/vgaltboot /alt_root vxfs delaylog 0 1
/dev/vgaltboot /alt_opt vxfs delaylog 0 2
/dev/vgaltboot /alt_tmp vxfs delaylog 0 2
/dev/vgaltboot /alt_usr vxfs delaylog 0 2
/dev/vgaltboot /alt_var vxfs delaylog 0 2

copy the data:

mountall

cd /;find . -xdev -depth -print | cpio -puxdm /alt_root
cd /stand;find . -xdev -depth -print | cpio -puxdm /alt_stand
cd /var;find . -xdev -depth -print | cpio -puxdm /alt_var
cd /usr;find . -xdev -depth -print | cpio -puxdm /alt_usr
cd /opt;find . -xdev -depth -print | cpio -puxdm /alt_opt

Create an alternative fstab file:

sed "s/vg00/dummy/" alt_root/etc/fstab | sed "s/vgaltboot/vg00/" | sed "s/dummy/vgaltboot/" > alt_root/etc/fstab/altboot

cp /alt_root/etc/fstab/altboot /alt_root/etc/fstab

You should now be able to boot from the alternative device. Hope I haven't missed anything!!

Rgds, Robin
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Mirroring with cpio

Hi Colin:

The best method (and I do it every weekend as a lifeboat) is to copy everything on the disk(s) to identical disk(s) using dd. I do this in addition to mirroring. Mirroring protects me from disk/controller failures but dd'ing to a lifeboat disk protects me from my own stupidity and really bad patches. I have a cron job set to run on each of my machines during the weekend. It's best to do this when the system in relatively quiet. If I need to use the lifeboat, I simply remove the boot disk(s) and replace them with the lifeboat disk(s). The machine comes up and does an fsck (since none of the filesystems were cleanly unmounted) and you're back in business.

You will need to set the SRC and DEST values (in the attached script there are 2 SRC and 2 DEST disks but you can reduce then to 1 each if that is your configuration.)

The beauty of this method is that it gets everything.

Regards, Clay
If it ain't broke, I can fix that.