Posts tagged disk

Tru64 boot disk cloning

0

Последовательность действий для клонирования бутового диска.

Текущий загрузочный диск:
#consvar -l
auto_action = HALT
boot_dev = dsk0
bootdef_dev = dsk0
booted_dev = dsk0

dsk4 - новый бутовый диск
#disklabel -r -w -t advfs dsk4

#disklabel -e -r dsk4

1048576 - root 512M
134217728 - swap 64G
24617856 - usr+var 11G

8 partitions:
# size offset fstype fsize bsize cpg # ~Cyl values
a: 1048576 0 AdvFS # 0 - 136*
b: 134217728 1048576 swap # 136*- 17612*
c: 159884160 0 unused 0 0 # 0 - 20818*
d: 0 0 unused 0 0 # 0 - 0
e: 0 0 unused 0 0 # 0 - 0
f: 0 0 unused 0 0 # 0 - 0
g: 24617856 135266304 AdvFS # 17612*- 20818*
h: 0 0 unused 0 0 # 0 - 0

#swapon /dev/disk/dsk4b
#mkfdmn /dev/disk/dsk4a root_local
#mkfdmn /dev/disk/dsk4g usr_local
#mkfset -o nofrag root_local root
#mkfset -o nofrag usr_local usr
#mkfset -o nofrag usr_local var
#mkdir /t_root
#mount root_local#root /t_root/
#cd /t_root/
#vdump -0 -f - / | vrestore -xf -
#mount usr_local#usr /t_root/usr
#mount usr_local#var /t_root/var
#cd usr
#vdump -0 -f - /usr | vrestore -xf -
#cd ../var
#vdump -0 -f - /var | vrestore -xf -

#vi /t_root/etc/fstab
root_local#root / advfs rw 0 1
usr_local#usr /usr advfs rw 0 2
usr_local#var /var advfs rw 0 2

#vi /t_root/etc/sysconfigtab
swapdevice = /dev/disk/dsk4b

#shutdown -h now

P00>>>show dev d
dga4.1001.0.1.16 $1$DGA4 HP OPEN-V 5007
dga4.1002.0.1.16 $1$DGA4 HP OPEN-V 5007
dgb4.1003.0.1.24 $1$DGA4 HP OPEN-V 5007
dgb4.1004.0.1.24 $1$DGA4 HP OPEN-V 5007
dka0.0.0.1.2 DKA0 COMPAQ BF07289BC4 HPB1
dkb0.0.0.1.10 DKB0 COMPAQ BF07289BC4 HPB1
dkc0.0.0.1.18 DKC0 COMPAQ BF07289BC4 HPB1
dkd0.0.0.1.26 DKD0 COMPAQ BF07289BC4 HPB1
dqa0.0.0.2.2 DQA0 DW-224E- R C.AB

>>> b dka0

#consvar -s bootdef_dev dsk4
set bootdef_dev = dsk4

#consvar -l
auto_action = HALT
boot_dev = dsk4
bootdef_dev = dsk4(4 paths)
booted_dev = dsk4

#consvar -a
Console environment variables saved

mirror boot disk in HP-UX 11.x PA-RISC

Say /dev/dsk/c0t6d0 is the root disk and /dev/dsk/c3t6d0 is the disk you want to make a mirror of.

1. Create a bootable LVM disk to be used for the mirror.
pvcreate -B /dev/rdsk/c3t6d0
2. Add this disk to the current root volume group.
vgextend /dev/vg00 /dev/dsk/c3t6d0
3. Make the new disk a boot disk.
mkboot -l /dev/rdsk/c3t6d0
4. Copy the correct AUTO file into the new LIF area.
mkboot -a "hpux -lq (;0)/vmunix" /dev/rdsk/c3t6d0
5. Mirror the boot, root and primary swap logical volumes to the new
bootable disk. Ensure that all devices in vg00, such as /usr, /swap,
etc., are mirrored.
The following is an example of mirroring the boot logical volume:
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c3t6d0
The following is an example of mirroring the primary swap logical
volume:
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c3t6d0
The following is an example of mirroring the root logical volume:
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c3t6d0
6. Update the boot information contained in the BDRA for the mirror
copies of boot, primary swap and root.
/usr/sbin/lvlnboot -b /dev/vg00/lvol1
/usr/sbin/lvlnboot -s /dev/vg00/lvol2
/usr/sbin/lvlnboot -r /dev/vg00/lvol3
7. Check if the BDRA is correct.
/usr/sbin/lvlnboot -R /dev/vg00
8. Verify that the mirrors were properly created.
lvlnboot -v /dev/vg00
The output of this command is shown in a display like the following:
Boot Definitions for Volume Group /dev/vg00:
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c0t6d0 (1/0/0/3/0.6.0) -- Boot Disk
/dev/dsk/c3t6d0 (1/0/1/0/0/1/1.6.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Root: lvol3 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Swap: lvol2 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Dump: lvol2 on: /dev/dsk/c0t6d0, 0

vgdisplay -v vg00

Then lvextend for all other lvols:

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol9 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol10 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol11 /dev/dsk/c3t6d0

Go to Top