Linux的增加空間

我們有一台Centos7,要增加 / 的掛載點空間,有一顆硬碟是80GB,使用LVM,目前給 / 50GB。

我們關機調整虛擬機空間從80GB到200GB。

重新開機之後發現真的看到一個 /dev/sda 200GB的硬碟。

由於要增加空間到現有的LVM,所以我們建立一個120GB的 /dev/sda3 ,並且設定type為8e,然後重新開機。

果真出現一個 /dev/sda3 的磁碟區。

把/dev/sda3加入到pv裡。

目前有一個vg名稱為cl,但是沒有多的空間了。

我們把 /dev/sda3這個pv加入到cl的vg裡,果真free變成120GB。

再來我們有一個lv /dev/cl/root 掛載在 / 上,目前LV Size為50GB,我們把多的120GB pv空間加入之後,最後為170GB。

但是實際去看還是只有50GB,原因是因為雖然容量變大了,但是沒格式化,因為他的格式為xfs,所以我們用xfs_growfs指令把他變大,最後 / 的空間變成50+120=170GB。
留言
張貼留言