ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 扩大lv

扩大lv

原创 Linux操作系统 作者:whyun1984 时间:2013-10-28 13:38:44 0 删除 编辑
[root@ovm ~]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000de73c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26         281     2048000   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             281        6528    50174976   8e  Linux LVM

Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_ovm-LogVol00: 51.4 GB, 51376029696 bytes
255 heads, 63 sectors/track, 6246 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@ovm ~]# pvcreate /dev/sdb 
  Writing physical volume data to disk "/dev/sdb"
  Physical volume "/dev/sdb" successfully created

[root@ovm ~]# vgextend -h
  vgextend: Add physical volumes to a volume group

vgextend
[-A|--autobackup y|n]
[--restoremissing]
[-d|--debug]
[-f|--force]
[-h|--help]
[-t|--test]
[-v|--verbose]
[--version]
[ PHYSICAL DEVICE OPTIONS ] 
VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]

[root@ovm ~]# vgextend vg_ovm /dev/sdb 
  Volume group "vg_ovm" successfully extended
[root@ovm ~]# lvextend -h
  lvextend: Add space to a logical volume

lvextend
[-A|--autobackup y|n]
[--alloc AllocationPolicy]
[-d|--debug]
[-f|--force]
[-h|--help]
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
{-l|--extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}] |
-L|--size [+]LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
[-m|--mirrors Mirrors]
[--nosync]
[--use-policies]
[-n|--nofsck]
[--noudevsync]
[-r|--resizefs]
[-t|--test]
[--type VolumeType]
[-v|--verbose]
[--version]
LogicalVolume[Path] [ PhysicalVolumePath... ]

[root@ovm ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_ovm-LogVol00
              ext4     48G  9.5G   36G  22% /
tmpfs        tmpfs    812M  260K  812M   1% /dev/shm
/dev/sda1     ext4    194M   50M  135M  27% /boot
/dev/sr0   iso9660    2.5G  2.5G     0 100% /media/OVMManagerInstaller3.2.2_b520
[root@ovm ~]# lvscan
  ACTIVE            '/dev/vg_ovm/LogVol00' [47.85 GiB] inherit
[root@ovm ~]# lvextend -L +20G /dev/vg_ovm/LogVol00 
  Extending logical volume LogVol00 to 67.85 GiB
  Insufficient free space: 5120 extents needed, but only 5119 available
[root@ovm ~]# lvextend -L +19G /dev/vg_ovm/LogVol00 
  Extending logical volume LogVol00 to 66.85 GiB
  Logical volume LogVol00 successfully resized
[root@ovm ~]# lvscan 
  ACTIVE            '/dev/vg_ovm/LogVol00' [66.85 GiB] inherit
[root@ovm ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_ovm-LogVol00
              ext4     48G  9.5G   36G  22% /
tmpfs        tmpfs    812M  260K  812M   1% /dev/shm
/dev/sda1     ext4    194M   50M  135M  27% /boot
/dev/sr0   iso9660    2.5G  2.5G     0 100% /media/OVMManagerInstaller3.2.2_b520
[root@ovm ~]# resize2fs /dev/vg_ovm/LogVol00 
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_ovm/LogVol00 is mounted on /; on-line resizing required
old desc_blocks = 3, new_desc_blocks = 5
Performing an on-line resize of /dev/vg_ovm/LogVol00 to 17523712 (4k) blocks.
The filesystem on /dev/vg_ovm/LogVol00 is now 17523712 blocks long.

[root@ovm ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_ovm-LogVol00
              ext4     66G  9.5G   54G  16% /
tmpfs        tmpfs    812M  260K  812M   1% /dev/shm
/dev/sda1     ext4    194M   50M  135M  27% /boot
/dev/sr0   iso9660    2.5G  2.5G     0 100% /media/OVMManagerInstaller3.2.2_b520
[root@ovm ~]# 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26972107/viewspace-775142/,如需转载,请注明出处,否则将追究法律责任。

下一篇: ovm搭建注意事项
请登录后发表评论 登录
全部评论

注册时间:2013-10-11

  • 博文量
    21
  • 访问量
    83700