2016年7月4日 星期一

[Linux] LVM介紹 (2)

如何改變LVM的大小??
假設要加入一個5G的/dec/hdb3
1.將原本的LVM分割區卸載
# umount /mnt/lvm

2.將/dev/hdb3建立8e的LVM磁區
fdisk /dev/hdb
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!

3.建立PV
# partprobe
# pvcreate /dev/hdb3
Physical volume "/dev/hdb3" successfully created

4.將新的PV增加加VG去
#vgextend testvg /dev/hdb3

5.增加LV的大小,並再次掛載
# lvextend -L +5G /dev/vbirdvg/vbirdlv
# mount -t ext3 /dev/testvg/testlv /mnt/lvm
因為第一次規劃LVM時所有ext3的資訊都已經寫入super block
node和block數量又是固定的,所以容量大小當然不會有變化

6.先umount原來的掛載點
# umount /mnt/lvm

7.利用resize2fs來修改分割區大
# resize2fs -f /dev/testvg/testlv
done!!

沒有留言:

張貼留言

kubernets service 介紹

kubernets (簡稱k8s)中的容器如果要對外服務,需要透過server元件來進行 service元件有以下幾種類型可供選擇 : clusterip : 預設類型,只在k8s cluster內部IP中提供服務,外部無法訪問 nodeport : 在每個n...