next up previous contents
Next: 單一指令放大縮小 LV Up: 邏輯捲軸管理 Previous: 縮小 LV 標準作法   Contents

放大 LV 標準作法

  1. 查看要放大 LV vg_kvm7home-vo 掛載在 /home,大小為 24M ( 30M )。
    [root@kvm7 ~]# df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    /dev/mapper/vg_kvm7usb-root  3.1G  1.1G  1.8G  37% /
    devtmpfs                     487M     0  487M   0% /dev
    tmpfs                        497M     0  497M   0% /dev/shm
    tmpfs                        497M  6.6M  491M   2% /run
    tmpfs                        497M     0  497M   0% /sys/fs/cgroup
    /dev/vda1                    197M  107M   90M  55% /boot
    /dev/mapper/vg_mnt-pub        24M     0   24M   0% /mnt/pub
    /dev/mapper/vg_kvm7home-vo    25M  784K   23M   4% /home
    
  2. 先 resize LV vg_kvm7home-vo 為 100M, 放大時此命令一定要在 resize2fs 命令之前執行,縮小時則順序相反。
    [root@kvm7 ~]# lvextend -L 100M /dev/vg_kvm7home/vo 
      Size of logical volume vg_kvm7home/vo changed from 30.00 MiB (15 extents) to 100.00 MiB (50 extents).
      Logical volume vo successfully resized
    
  3. 再 resize LV vg_kvm7home-vo 檔案系統,不必輸入大小,檔案系統會依已 extend 的 LV resize。
    [root@kvm7 ~]# resize2fs -f /dev/vg_kvm7home/vo
    resize2fs 1.42.9 (28-Dec-2013)
    Filesystem at /dev/vg_kvm7home/vo is mounted on /home; on-line resizing required
    old_desc_blocks = 1, new_desc_blocks = 1
    The filesystem on /dev/vg_kvm7home/vo is now 102400 blocks long.
    
  4. 再檢查 LV vg_kvm7home-vo 大小為 93M ( 100M )。
    [root@kvm7 ~]# df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    /dev/mapper/vg_kvm7usb-root  3.1G  1.1G  1.8G  37% /
    devtmpfs                     487M     0  487M   0% /dev
    tmpfs                        497M     0  497M   0% /dev/shm
    tmpfs                        497M  6.6M  491M   2% /run
    tmpfs                        497M     0  497M   0% /sys/fs/cgroup
    /dev/vda1                    197M  107M   90M  55% /boot
    /dev/mapper/vg_mnt-pub        24M     0   24M   0% /mnt/pub
    /dev/mapper/vg_kvm7home-vo    93M  1.6M   87M   2% /home
    



2018-04-11