Chinaunix首页 | 论坛 | 博客
  • 博客访问: 227810
  • 博文数量: 51
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 211
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-05 23:07
文章分类

全部博文(51)

文章存档

2016年(11)

2015年(14)

2014年(4)

2013年(22)

我的朋友

分类: 系统运维

2013-08-22 22:45:01

一、知识准备
HPUX 11.23与11.22版本配置根盘镜像的最大的不同:
1. 新增加了HPSP分区;
11.22系统根盘只划分了两个分区EFI/HP-UX,在11.23系统中,划分了3个分区,分别为EFI/HP-UX/HPSP.相应在使用idisk命令划分硬盘分区时使用的/tmp/partitionfile 文件中的内容也做了相应调整.
2. EFI分区大小从原先的100M,增加到500M
二、实验目的
对一台HP rx8640机器的2号分区根盘(146GB)镜像;
三、操作过程
1. From HPUX, use vgdisplay to identify the disk that is in vg00. Use ioscan to find the spare disk.
# vgdisplay -v  --> vg00 is on /dev/dsk/c0t6d0s2 vg00卷组中只有一个盘分区c0t6d0s2
# ioscan -efunC disk  --> c2t6d0       可以看到另一个磁盘和光驱
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
========================================================================
disk      1  0/0/0/2/0.6.0   sdisk    CLAIMED     DEVICE       HP 146 GST3146855LC
                            /dev/dsk/c0t6d0     /dev/rdsk/c0t6d0  
                            /dev/dsk/c0t6d0s1   /dev/rdsk/c0t6d0s1
                            /dev/dsk/c0t6d0s2   /dev/rdsk/c0t6d0s2
                            /dev/dsk/c0t6d0s3   /dev/rdsk/c0t6d0s3
Acpi(HWP0002,PNP0A03,0)/Pci(2|0)/Scsi(Pun6,Lun0)/HD(Part1,Sig0E481F42-F04C-11DC-8002-D6217B60E588)/\EFI\HPUX\HPUX.EFI
disk      0  0/0/0/2/1.2.0   sdisk    CLAIMED     DEVICE       Optiarc DVD RW AD-5170A
                            /dev/dsk/c1t2d0   /dev/rdsk/c1t2d0
disk      2  0/0/0/3/0.6.0   sdisk    CLAIMED     DEVICE       HP 146 GST3146855LC
                            /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0
2. Create the system, OS, and service partitions.
# vi /tmp/partitionfile       建一个临时文件输入以下内容,名字随便
   3                          分3个区
   EFI 500MB                  最上面讲到了11.23的默认大小
   HPUX 100%                  
剩余所有空间
   HPSP 400MB                 应该是预留替换坏扇区的空间吧!
# idisk -wf /tmp/partitionfile /dev/rdsk/c2t6d0   -w写(默认只读)-f来自于文件
idisk version: 1.31
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes

3. Create device files needed for the new partitions.
# insf -eC disk            创建磁盘分区表文件(重启自动创建)
insf: Installing special files for sdisk instance 1 address 0/0/0/2/0.6.0
insf: Installing special files for sdisk instance 0 address 0/0/0/2/1.2.0
insf: Installing special files for sdisk instance 2 address 0/0/0/3/0.6.0
insf: Installing special files for sdisk instance 3 address 0/0/12/1/0/4/1.0.0
insf: Installing special files for sdisk instance 4 address 0/0/12/1/0/4/1.1.0
insf: Installing special files for sdisk instance 5 address 0/0/12/1/0/4/1.2.0
insf: Installing special files for sdisk instance 6 address 0/0/12/1/0/4/1.3.0
insf: Installing special files for sdisk instance 7 address 0/0/14/1/0/4/1.0.0
insf: Installing special files for sdisk instance 8 address 0/0/14/1/0/4/1.1.0
insf: Installing special files for sdisk instance 9 address 0/0/14/1/0/4/1.2.0
insf: Installing special files for sdisk instance 10 address 0/0/14/1/0/4/1.3.0
4. Verify the partition table.
# idisk /dev/rdsk/c2t6d0       查看硬盘c2t6d0信息
idisk version: 1.32
EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xe51d545d
        MyLbaLo                   = 0x1
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x1117732f
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x22
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x1117730c
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 711f04da-2190-11dd-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x280b786c
  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 711f066a-2190-11dd-8002-d6217b60e588
        Starting Lba Lo            = 0x22
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xfa021
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 711f0688-2190-11dd-8003-d6217b60e588
        Starting Lba Lo            = 0xfa022
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x110af30b
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 711f06a6-2190-11dd-8004-d6217b60e588
        Starting Lba Lo            = 0x110af30c
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x1117730b
        Ending Lba Hi              = 0x0
EFI Alternate Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xac871e6f
        MyLbaLo                   = 0x1117732f
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x1
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x22
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x1117730c
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 711f04da-2190-11dd-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x1117730e
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x280b786c
  Alternate Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 711f066a-2190-11dd-8002-d6217b60e588
        Starting Lba Lo            = 0x22
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xfa021
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 711f0688-2190-11dd-8003-d6217b60e588
        Starting Lba Lo            = 0xfa022
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x110af30b
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 711f06a6-2190-11dd-8004-d6217b60e588
        Starting Lba Lo            = 0x110af30c
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x1117730b
        Ending Lba Hi              = 0x0
Legacy MBR (MBR Signatures in little endian):
   MBR Signature = 0x6c041f71
Protective MBR

5. Verify that the device files were created properly.
# ioscan -efnC disk --> c2t6d0 is 0/0/0/3/0.6.0     

6. Populate the /efi/hpux/ directory in the new EFI system partition.
# mkboot -e -l /dev/rdsk/c2t6d0

7. Change the auto file for the mirror to boot without quorum.
NOTE: Using "s1"
# echo "boot vmunix -lq" > /tmp/AUTO.lq
# efi_cp -d /dev/rdsk/c0t6d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO -->原作者漏写了
# efi_cp -d /dev/rdsk/c2t6d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO
NOTE: We assume that if we boot from the primary, the mirror is fully
functional and therefore we don't need to override quorum. Your site might
require that both disks override quorum.

8. Verify the contents of the auto file on the primary and the mirror.
NOTE: Using "s1"
# efi_cp -d /dev/rdsk/c0t6d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.pri
# efi_cp -d /dev/rdsk/c2t6d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.alt
# cat /tmp/AUTO.pri
boot vmunix -lq  -------------------->修改后
# cat /tmp/AUTO.alt
boot vmunix -lq

9. Add the new partition to vg00.
NOTE: Using "s2"
# pvcreate -fB /dev/rdsk/c2t6d0s2            格式化
Physical volume "/dev/rdsk/c2t6d0s2" has been successfully created.
# vgextend vg00 /dev/dsk/c2t6d0s2            添加盘到vg00卷
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
10. Mirror all logical volumes in vg00.
NOTE: Using "s2"
 
#for I in 1 2 3 4 5 6 7 8
>do
>lvextend -m l /dev/vg00/lvol$I /dev/dsk/c2t6d0s2
>done

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t6d0s2   镜像(数据拷贝)
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol4" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol5" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol6" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol7" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t6d0s2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
11. Add the new disk to /stand/bootconf.
NOTE: Using "s2"
# vi /stand/bootconf                        
l /dev/dsk/c0t6d0s2
l /dev/dsk/c2t6d0s2
12. Verify that the new disk was added to vg00, and the lv's are in sync.
# vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write     
VG Status                   available                 
Max LV                      255   
Cur LV                      8      
Open LV                     8      
Max PV                      16     
Cur PV                      2      
Act PV                      2      
Max PE per PV               4356         
VGDA                        4   
PE Size (Mbytes)            32              
Total PE                    8692   
Alloc PE                    2330   
Free PE                     6362   
Total PVG                   0        
Total Spare PVs             0              
Total Spare PVs in use      0                     
   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd           
   LV Size (Mbytes)            1792            
   Current LE                  56        
   Allocated PE                112         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd           
   LV Size (Mbytes)            8192            
   Current LE                  256      
   Allocated PE                512         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd           
   LV Size (Mbytes)            992            
   Current LE                  31        
   Allocated PE                62         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd           
   LV Size (Mbytes)            512            
   Current LE                  16        
   Allocated PE                32         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd           
   LV Size (Mbytes)            128            
   Current LE                  4         
   Allocated PE                8           
   Used PV                     2      
   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd           
   LV Size (Mbytes)            9184            
   Current LE                  287      
   Allocated PE                574         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd           
   LV Size (Mbytes)            7776            
   Current LE                  243      
   Allocated PE                486         
   Used PV                     2      
   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd           
   LV Size (Mbytes)            8704            
   Current LE                  272      
   Allocated PE                544         
   Used PV                     2      
   --- Physical volumes ---
   PV Name                     /dev/dsk/c0t6d0s2
   PV Status                   available               
   Total PE                    4346   
   Free PE                     3181   
   Autoswitch                  On        
   Proactive Polling           On               
   PV Name                     /dev/dsk/c2t6d0s2
   PV Status                   available               
   Total PE                    4346   
   Free PE                     3181   
   Autoswitch                  On        
   Proactive Polling           On               
13. Verify that the BDRA was updated properly. Take note of the HW paths for
step 14.
# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/dsk/c0t6d0s2 (0/0/0/2/0.6.0) -- Boot Disk
        /dev/dsk/c2t6d0s2 (0/0/0/3/0.6.0) -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c0t6d0s2
                        /dev/dsk/c2t6d0s2
Root: lvol3     on:     /dev/dsk/c0t6d0s2
                        /dev/dsk/c2t6d0s2
Swap: lvol2     on:     /dev/dsk/c0t6d0s2
                        /dev/dsk/c2t6d0s2
Dump: lvol2     on:     /dev/dsk/c0t6d0s2, 0
14. Add EFI primary and high availability boot path menu entries.
# setboot -p 0/0/0/2/0.6.0
# setboot -h 0/0/0/3/0.6.0
# setboot -b on
15. Verify that the primary and mirror boot paths are configured properly.
# setboot
Primary bootpath : 0/0/0/2/0.6.0
HA Alternate bootpath : 0/0/0/3/0.6.0
Alternate bootpath : 0/0/0/1/0
Autoboot is ON (enabled)
16. Test the new mirror by booting off of it.
# cd /
# shutdown -ry 0
SHUTDOWN PROGRAM
05/14/08 17:19:51 EAT
Broadcast Message from root (console) Wed May 14 17:19:51...SYSTEM BEING BROUGHT DOWN NOW ! ! !
# grep "Boot device" /var/adm/syslog/syslog.log
vmunix: Boot device's HP-UX HW path is: 0/0/0/2/0.6.0
17. Change the boot sequence in order to boot from mirror disk /dev/dsk/c2t6d0:
# setboot -p 0/0/0/3/0.6.0
# setboot -h 0/0/0/2/0.6.0
# setboot -b on
# setboot
Primary bootpath : 0/0/0/3/0.6.0
HA Alternate bootpath : 0/0/0/2/0.6.0
Alternate bootpath : 0/0/0/1/0
# cd /
# shutdown -ry 0
18. Verify which disk/kernel you booted from.
# grep "Boot device" /var/adm/syslog/syslog.log
vmunix: Boot device's HP-UX HW path is: 0/0/0/3/0.6.0
over
阅读(2256) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~