Chinaunix首页 | 论坛 | 博客
  • 博客访问: 268154
  • 博文数量: 107
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 74
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-18 09:57
文章分类

全部博文(107)

文章存档

2023年(2)

2021年(1)

2017年(1)

2015年(4)

2014年(9)

2013年(4)

2012年(14)

2011年(49)

2010年(23)

分类:

2011-01-12 22:13:40

# ioscan -funC disk
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      4  0/0/3/0.0.0.0  sdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                           /dev/dsk/c4t0d0   /dev/rdsk/c4t0d0
disk      6  0/1/1/0.0.0    sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC
                           /dev/dsk/c2t0d0   /dev/rdsk/c2t0d0
disk      0  0/1/1/0.1.0    sdisk   CLAIMED     DEVICE       HP 73.4GST373453LC
                           /dev/dsk/c2t1d0   /dev/rdsk/c2t1d0   (当前系统所在)

# pvcreate -f -B /dev/rdsk/c2t0d0      (-B  creates bootable PV)
Physical volume "/dev/rdsk/c2t0d0" has been successfully created.

# vgextend vg00 /dev/dsk/c2t0d0
vgextend: Warning: Max_PE_per_PV for the volume group (4384) too small for this PV (8750).
         Using only 4384 PEs from this physical volume.
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

# vgdisplay -v |tail -20
   Allocated PE                512        
   Used PV                     1      

   --- Physical volumes ---
   PV Name                     /dev/dsk/c2t1d0
   PV Status                   available               
   Total PE                    4375   
   Free PE                     2097   
   Autoswitch                  On       
   Proactive Polling           On              
   PV Name                     /dev/dsk/c2t0d0
   PV Status                   available               
   Total PE                    4384   
   Free PE                     4384   
   Autoswitch                  On       
   Proactive Polling           On              

#mkboot /dev/rdsk/c2t0d0                    (将LIF引导文件加入c2t0d0)
#mkboot -a "hpux -lq" /dev/rdsk/c2t1d0       
#mkboot -a "hpux -lq" /dev/rdsk/c2t0d0                 
 
这两步关闭vg激活时的quorum检查。不会在因为50%的PV丢失而导致vg00不能激活。如果忽略这步,
坏一块盘后,用另一块也无法启动系统。因为vg00将因quorum的报错而无法激活。

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t0d0
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
# for i in lvol{2,3,4,5,6,7,8}; do lvextend -m 1 /dev/vg00/$i /dev/dsk/c2t0d0; done
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
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
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
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
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
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
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
#
#
# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/dsk/c2t1d0 -- Boot Disk
        /dev/dsk/c2t0d0 -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Root: lvol3     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Swap: lvol2     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Dump: lvol2     on:     /dev/dsk/c2t1d0, 0
 
 
           
# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  345784  697352   33% /
/dev/vg00/lvol1    1776056   71664 1526784    4% /stand
/dev/vg00/lvol8    8912896  364720 8481664    4% /var
/dev/vg00/lvol7    3031040 2160936  863384   71% /usr
/dev/vg00/lvol4     524288   21384  499040    4% /tmp
/dev/vg00/lvol6    5079040 3492576 1574136   69% /opt
/dev/vg00/lvol5     114688    5792  108056    5% /home
DevFS                    3       3       0  100% /dev/deviceFileSystem

# lvlnboot -r /dev/vg00/lvol3           (指定root boot)
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -s /dev/vg00/lvol2             (指定swap)
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -d /dev/vg00/lvol2              (dump)
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -b /dev/vg00/lvol1             (boot vmunix所在)
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -R                             (-R 连接...看后面的lvlnboot MAN吧)
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

# ioscan -funC disk
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      4  0/0/3/0.0.0.0  sdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                           /dev/dsk/c4t0d0   /dev/rdsk/c4t0d0
disk      6  0/1/1/0.0.0    sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC
                           /dev/dsk/c2t0d0   /dev/rdsk/c2t0d0
disk      0  0/1/1/0.1.0    sdisk   CLAIMED     DEVICE       HP 73.4GST373453LC
                           /dev/dsk/c2t1d0   /dev/rdsk/c2t1d0
# setboot -a 0/1/1/0.0.0          (设置alternate boot disk 即:c2t0d0)
# shutdown -ry 0
 
 
重启后:
 
# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/dsk/c2t1d0 -- Boot Disk
        /dev/dsk/c2t0d0 -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Root: lvol3     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Swap: lvol2     on:     /dev/dsk/c2t1d0
                        /dev/dsk/c2t0d0
Dump: lvol2     on:     /dev/dsk/c2t1d0, 0
#
 
已经成功。 有两块boot disk,boot设备都有镜像。
 
# for i in lvol{4,5,6,7,8}; do lvdisplay /dev/vg00/$i; done
--- Logical volumes ---
LV Name                     /dev/vg00/lvol4
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel     
LV Size (Mbytes)            512            
Current LE                  32       
Allocated PE                64         
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            
--- Logical volumes ---
LV Name                     /dev/vg00/lvol5
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel     
LV Size (Mbytes)            112            
Current LE                  7        
Allocated PE                14         
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            
--- Logical volumes ---
LV Name                     /dev/vg00/lvol6
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel     
LV Size (Mbytes)            4960           
Current LE                  310      
Allocated PE                620        
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            
--- Logical volumes ---
LV Name                     /dev/vg00/lvol7
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel     
LV Size (Mbytes)            2960           
Current LE                  185      
Allocated PE                370        
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            
--- Logical volumes ---
LV Name                     /dev/vg00/lvol8
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel     
LV Size (Mbytes)            8704           
Current LE                  544      
Allocated PE                1088       
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            
#
 
成功。都拥有了mirror copy, 而且PE都是LE的2倍。
 
 
AT Last.... This is not easy, but I enjoy it. : )/.
 
 
附录: lvlnboot MAN:
 
 NAME 
      lvlnboot - prepare LVM logical volume to be root, boot, primary swap,
      or dump volume
 
         -r root_lv          Define root_lv to be the root volume the next
                               time the system is booted on this volume
                               group.  root_lv must be a contiguous logical
                               volume and cannot have bad block relocation
                               enabled.

                               If root_lv is the first logical volume on the
                               physical volume, then it is configured as the
                               combined root-boot volume. Otherwise, root_lv
                               is configured as the separate root volume in
                               which case a separate boot volume needs to be
                               configured using the lvlnboot -b option.

                               Either the separate root or the separate boot
                               volume can be configured first.
                               The command updates the Boot Data Reserved
                               Area of each bootable physical volume (see
                               ) to enable the volume group to
                               be used to locate the root file system.
                               root_lv is also used as the root volume
                               during a maintenance-mode boot (see
                               ).

                               The physical volumes containing root_lv must
                               have been created using the pvcreate -B
                               option (see ), indicating that
                               that physical volume is to be used as a
                               bootable physical volume.  Also, the mkboot
                               command (see ) must have been run
                               on the physical volume to create the LIF area
                               at the top of the physical volume (see
                               ).
          -s swap_lv          Define swap_lv to be the primary swap volume
                               the next time the system is booted on the
                               volume group.  swap_lv must be a contiguous
                               logical volume, and a root logical volume
                               must have been previously defined with this
                               command.

                               The command updates the Boot Data Reserved
                               Area of each bootable physical volume in the
                               volume group (see ).  Any
                               existing swap area previously defined must be
                               removed via .
           -b boot_lv          Define boot_lv to be the boot volume the next
                               time the system is booted on the volume
                               group.  boot_lv must be the first logical
                               volume on the physical volume.  boot_lv must
                               be contiguous, and must not allow bad block
                               relocation.

                               boot_lv is used to locate the boot file
                               system during the boot process.  The boot
                               file system has the kernel which is read by
                               the boot loader .

           -d dump_lv          Define dump_lv to be one of the dump volumes
                               the next time the system is booted on the
                               volume group.  dump_lv must be a contiguous
                               logical volume and cannot have Bad Block
                               Relocation enabled.

                               The command updates the Boot Data Reserved
                               Area of each bootable physical volume in the
                               volume group (see ).

                               The combined size of all the dump volumes
                               should be at least 2048 bytes larger than the
                               total memory of the system.  The additional 2
                               KB is used to safeguard against a dump to the
                               bottom of the disk.

                               Multiple dump devices can be configured, but
                               each dump_lv must be entered with a separate
                               lvlnboot command line.
          -R                  Recover any missing links to all of the
                               logical volumes specified in the Boot Data
                               Reserved Area and update the Boot Data
                               Reserved Area of each bootable physical
                               volume in the volume group (see
                               ).


 
 
 
 
 
 
 
 
 
 
阅读(2269) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-09 12:03:40

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com

chinaunix网友2011-03-09 12:03:22

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com