解决方法是:ext2online -v /dev/VolGroup00/LogVol00
LVM扩容全步骤如下:
一、首先查看新加的硬盘,我这边加了一个30G的硬盘,/dev/hdb
[root@as4-dev ~]# fdisk  -l
 
Disk /dev/hda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14       10443    83778975   8e  Linux LVM
 
Disk /dev/hdb: 32.2 GB, 32212254720 bytes
15 heads, 63 sectors/track, 66576 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
 
Disk /dev/hdb doesn't contain a valid partition table

二、给/dev/hdb分区

[root@as4-dev ~]# fdisk /dev/hdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
 
 
The number of cylinders for this disk is set to 66576.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-66576, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-66576, default 66576): 
Using default value 66576
 
Command (m for help): p
 
Disk /dev/hdb: 32.2 GB, 32212254720 bytes
15 heads, 63 sectors/track, 66576 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       66576    31457128+  83  Linux
 
三、按m查看帮助,t是更改分区类型,输入t,输入L查看类型,8e是LVM的类型,w保存,partprobe /dev/hdb刷新分区
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
 
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
 
 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       c1  DRDOS/sec (FAT-
 1  FAT12           24  NEC DOS         81  Minix / old Lin c4  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          82  Linux swap      c6  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c7  Syrinx         
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  da  Non-FS data    
 5  Extended        41  PPC PReP Boot   85  Linux extended  db  CP/M / CTOS / .
 6  FAT16           42  SFS             86  NTFS volume set de  Dell Utility   
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set df  BootIt         
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       e1  DOS access     
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e3  DOS R/O        
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e4  SpeedStor      
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          eb  BeOS fs        
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi ee  EFI GPT        
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ef  EFI (FAT-12/16/
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         f0  Linux/PA-RISC b
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f1  SpeedStor      
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f4  SpeedStor      
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f2  DOS secondary  
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     fb  VMware VMFS    
16  Hidden FAT16    63  GNU HURD or Sys b7  BSDI fs         fc  VMware VMKCORE 
17  Hidden HPFS/NTF 64  Novell Netware  b8  BSDI swap       fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  bb  Boot Wizard hid fe  LANstep        
1b  Hidden W95 FAT3 70  DiskSecure Mult be  Solaris boot    ff  BBT            
1c  Hidden W95 FAT3 75  PC/IX           bf  Solaris        
Hex code (type L to list codes): 1
Changed system type of partition 1 to 1 (FAT12)
 
Command (m for help): 8e
8: unknown command
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
 
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l
 
 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       c1  DRDOS/sec (FAT-
 1  FAT12           24  NEC DOS         81  Minix / old Lin c4  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          82  Linux swap      c6  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c7  Syrinx         
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  da  Non-FS data    
 5  Extended        41  PPC PReP Boot   85  Linux extended  db  CP/M / CTOS / .
 6  FAT16           42  SFS             86  NTFS volume set de  Dell Utility   
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set df  BootIt         
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       e1  DOS access     
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e3  DOS R/O        
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e4  SpeedStor      
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          eb  BeOS fs        
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi ee  EFI GPT        
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ef  EFI (FAT-12/16/
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         f0  Linux/PA-RISC b
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f1  SpeedStor      
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f4  SpeedStor      
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f2  DOS secondary  
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     fb  VMware VMFS    
16  Hidden FAT16    63  GNU HURD or Sys b7  BSDI fs         fc  VMware VMKCORE 
17  Hidden HPFS/NTF 64  Novell Netware  b8  BSDI swap       fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  bb  Boot Wizard hid fe  LANstep        
1b  Hidden W95 FAT3 70  DiskSecure Mult be  Solaris boot    ff  BBT            
1c  Hidden W95 FAT3 75  PC/IX           bf  Solaris        
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
 
Command (m for help): w
The partition table has been altered!
[root@as4-dev ~]# partprobe /dev/hdb
创建PV,VG扩展、LV扩容如下三步,但是发现问题是
[root@as4-dev ~]# pvcreate /dev/hdb1“/dev/VolGroup00/LogVol00 is mounted; can't resize a mounted filesystem!” 根分区是挂载状态,解决方法可以是进单用户模式操作,不过麻烦要再重启,发现有个命令在线扩容,ext2online -v /dev/VolGroup00/LogVol00,写出来分享下
  Physical volume "/dev/hdb1" successfully created
[root@as4-dev ~]# vgextend VolGroup00 /dev/hdb1
  Volume group "VolGroup00" successfully extended
[root@as4-dev ~]# lvextend -L +28G /dev/VolGroup00/LogVol00
  Extending logical volume LogVol00 to 106.88 GB
  Logical volume LogVol00 successfully resized
 
[root@as4-dev ~]# resize2fs /dev/VolGroup00/LogVol00 
resize2fs 1.35 (28-Feb-2004)
/dev/VolGroup00/LogVol00 is mounted; can't resize a mounted filesystem!
 
[root@as4-dev ~]# ext2online -v /dev/VolGroup00/LogVol00