LVM管理磁盤實錄
[root@kvm01 ~]# lvextend -L +30G /dev/mapper/vg_kvm03-lv_root
Extending logical volume lv_root to 80.00 GiB
Logical volume lv_root successfully resized
[root@kvm01 ~]# e2fsck -f /dev/mapper/vg_kvm03-lv_root
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg_kvm03-lv_root is mounted.
e2fsck: Cannot continue, aborting.
[root@kvm01 ~]# resize2fs /dev/mapper/vg_kvm03-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_kvm03-lv_root is mounted on /; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 5
Performing an on-line resize of /dev/mapper/vg_kvm03-lv_root to 20971520 (4k) blocks.
The filesystem on /dev/mapper/vg_kvm03-lv_root is now 20971520 blocks long.
[root@kvm01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_kvm03-lv_root
79G 46G 29G 62% /
tmpfs 5.9G 0 5.9G 0% /dev/shm
/dev/sda1 485M 148M 312M 33% /boot
10.10.10.103:/opt/nfs
50G 20G 27G 43% /cloud/nfs
[root@kvm01 ~]# vgdisplay
--- Volume group ---
VG Name vg_kvm03
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 114.00 GiB
PE Size 4.00 MiB
Total PE 29185
Alloc PE / Size 27106 / 105.88 GiB
Free PE / Size 2079 / 8.12 GiB
VG UUID VOXTxP-311D-4Ogf-VW3U-ngrL-mQjf-NzkyfH
[root@kvm01 ~]# fdisk -l
Disk /dev/sda: 122.9 GB, 122941242880 bytes
255 heads, 63 sectors/track, 14946 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: 0x0001e60a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 14947 119545856 8e Linux LVM
Disk /dev/mapper/vg_kvm03-lv_root: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 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_kvm03-lv_swap: 6316 MB, 6316621824 bytes
255 heads, 63 sectors/track, 767 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_kvm03-lv_home: 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
[root@kvm01 ~]# lvreduce -L -20G /dev/mapper/vg_kvm03-lv_home
Unable to reduce lv_home below 1 extent
Run `lvreduce --help' for more information.
[root@kvm01 ~]# lvreduce -L -10G /dev/mapper/vg_kvm03-lv_home
WARNING: Reducing active logical volume to 10.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_home? [y/n]: y
Reducing logical volume lv_home to 10.00 GiB
Logical volume lv_home successfully resized
[root@kvm01 ~]# vgdisplay
--- Volume group ---
VG Name vg_kvm03
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 114.00 GiB
PE Size 4.00 MiB
Total PE 29185
Alloc PE / Size 24546 / 95.88 GiB
Free PE / Size 4639 / 18.12 GiB
VG UUID VOXTxP-311D-4Ogf-VW3U-ngrL-mQjf-NzkyfH
[root@kvm01 ~]# lvextend -L +18G /dev/mapper/vg_kvm03-lv_root
Extending logical volume lv_root to 98.00 GiB
Logical volume lv_root successfully resized
[root@kvm01 ~]# vgdisplay
--- Volume group ---
VG Name vg_kvm03
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 114.00 GiB
PE Size 4.00 MiB
Total PE 29185
Alloc PE / Size 29154 / 113.88 GiB
Free PE / Size 31 / 124.00 MiB
VG UUID VOXTxP-311D-4Ogf-VW3U-ngrL-mQjf-NzkyfH
[root@kvm01 ~]# e2fsck -f /dev/mapper/vg_kvm03-lv_root
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg_kvm03-lv_root is mounted.
e2fsck: Cannot continue, aborting.
[root@kvm01 ~]# resize2fs /dev/mapper/vg_kvm03-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_kvm03-lv_root is mounted on /; on-line resizing required
old desc_blocks = 5, new_desc_blocks = 7
Performing an on-line resize of /dev/mapper/vg_kvm03-lv_root to 25690112 (4k) blocks.
The filesystem on /dev/mapper/vg_kvm03-lv_root is now 25690112 blocks long.
[root@kvm01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_kvm03-lv_root
97G 46G 46G 51% /
tmpfs 5.9G 0 5.9G 0% /dev/shm
/dev/sda1 485M 148M 312M 33% /boot
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.