VM下增加centos6.5磁碟容量

來源:互聯網
上載者:User

VM下增加centos6.5磁碟容量

參考博文:http://www.cnblogs.com/sixiweb/p/3360008.html

編輯設定,修改硬碟大小

[root@localhost~]#fdisk-l#查看磁碟分割情況Disk/dev/sda:59.1GB,59055800320bytes#現有的磁碟容量255heads,63sectors/track,7179cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x000efc13DeviceBootStartEndBlocksIdSystem#現有磁碟的分配情況/dev/sda1*16451200083Linux#主要磁碟分割Partition1doesnotendoncylinderboundary./dev/sda264104578755848eLinuxLVM#擴充分區/dev/sda31045652744039519+8eLinuxLVM#擴充分區Disk/dev/mapper/VolGroup-lv_root:51.2GB,51229229056bytes255heads,63sectors/track,6228cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x00000000Disk/dev/mapper/VolGroup-lv_swap:855MB,855638016bytes255heads,63sectors/track,104cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x00000000

關閉VMWARE的linux系統,設定原有硬碟容量後開機。

#添加新分區,在原容量基礎上載入新容量

[root@localhost~]#fdisk/dev/sdaWARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedtoswitchoffthemode(command'c')andchangedisplayunitstosectors(command'u').Command(mforhelp):

輸入n,斷行符號。新增一個分區

Command(mforhelp):nCommandactioneextendedpprimarypartition(1-4)

輸入P,斷行符號 選擇主要磁碟分割

輸入4,斷行符號 選擇分區4,因為上面查詢到sda1,sda2,sda3都已經被使用

輸入8e,斷行符號 更改為lvm

輸入w,斷行符號 儲存設定,然後重啟電腦

開機後格式化剛才的新分區

[root@localhost~]#

#實現擴容

[root@localhost~]#lvm#進入lvm模式lvm>pvcreate/dev/sda3         這是初始化剛才的分區,必須的lvm>vgextendVolGroup/dev/sda3   將初始化過的分區加入到虛擬卷組vg_dc01lvm>lvextend-L+29.9G/dev/vg_dc01/lv_root  擴充已有卷的容量(29.9G這個數字在後面解釋)lvm>pvdisplay              查看卷容量,這時你會看到一個很大的卷了lvm>quit                 退出

[root@localhost~]#resize2fs/dev/mapper/VolGroup-lv_root

再輸入df -h 查看一下硬碟容量

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.