hyper虚拟机下对centos进行动态扩容
生活随笔
收集整理的這篇文章主要介紹了
hyper虚拟机下对centos进行动态扩容
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在關機狀態下,可增加centos的磁盤空間,但是增加的這部分空間,還需在centos完成以下操作,才能使用 1.查看現有的硬盤分區(現在空間沒有變大) #df -h 2.對新增的硬盤空間做新增分區(硬盤數沒有增加,增加的是空間) #fdisk /dev/sda The number of cylinders for this disk is set to 7832. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help):?n?說明:新增分區 Command action e ??extended p ??primary partition (1-4) p Partition number (1-4):?3?說明:新增分區號(1,2默認已經用了) First cylinder (2611-7832, default 2611):?默認回車(最小) Using default value 2611 Last cylinder or +size or +sizeM or +sizeK (2611-7832, default 7832):默認回車(最大) Using default value 7832 Command (m for help):?t?說明:修改分區類型 Partition number (1-4):?3?說明:修改分區類型對應的分區號 Hex code (type L to list codes):?8e?說明:8e是lvm磁盤類型 Changed system type of partition 3 to 8e (Linux LVM) Command (m for help):?p?說明:打印分區表 Disk /dev/sda: 64.4 GB, 64424509440 bytes 255 heads, 63 sectors/track, 7832 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot ?????Start ????????End ?????Blocks ??Id ?System /dev/sda1 ??* ??????????1 ?????????13 ?????104391 ??83 ?Linux /dev/sda2 ?????????????14 ???????2610 ???20860402+ ?8e ?Linux LVM /dev/sda3 ???????????2611 ???????7832 ???41945715 ??8e ?Linux LVM Command (m for help):?w?說明:保存退出 The partition table has been altered! 3.重啟系統 #reboot 4.查看硬盤情況(核對剛才所做的分區操作是否保存成功) #fdisk -l 5.查看當前分區的類型 #df -T /dev/sda1?說明:查看當前的主分區類型 6.創建文件系統在新的磁盤上 #mkfs.ext4?/dev/sda3?說明:ext4為你查看到的文件系統類型(ext2、ext3、ext4等) 7.創建PV(pv組成vg,vg組成lv) #pvcreate /dev/sda3 查看pv狀態 #pvdisplay 查看vg狀態 #vgdisplay ? 8.剛創建的PV加入相應的VG #vgextend?vg_centos?/dev/sda3?說明:vg_centos是我的服務器vg名稱,請通過查看vg狀態得到名稱VG name ? 9.查看LV狀態,把VG加入到LV #lvdisplay
10.lvextend -l +2559 /dev/VolGroup00/LogVol00?說明:2559為上面pvdisplay查看到的free的PE數量 11.用 resize2fs 調整文件系統大小 resize2fs /dev/mapper/VolGroup00-LogVol00
10.lvextend -l +2559 /dev/VolGroup00/LogVol00?說明:2559為上面pvdisplay查看到的free的PE數量 11.用 resize2fs 調整文件系統大小 resize2fs /dev/mapper/VolGroup00-LogVol00
轉載于:https://www.cnblogs.com/theluther/p/4055593.html
總結
以上是生活随笔為你收集整理的hyper虚拟机下对centos进行动态扩容的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux 关机命令详解 转自脚本之家
- 下一篇: 阿里云部署Docker(5)----管理