時間:2015-01-15 17:30:28 作者:qipeng 來源:系統之家 1. 掃描二維碼隨時看資訊 2. 請使用手機瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150115/34987.html 手機查看 評論 反饋
重新查看:
E:\Program Files\Oracle\VirtualBox》VBoxManage.exe list hdds UUID: e8e2c341-b3b1-49db-ad2d-ab4e6b08bc5a Parent UUID: base State: locked write Type: normal (base) Location: F:\VM\CentOS-64.vdi Storage format: VDI Capacity: 15000 MBytes
UUID: 707d45b6-380d-4e51-96bd-8c9508bfd313 Parent UUID: base State: created Type: normal (base) Location: F:\VM\CentOS-64-ext.vdi Storage format: VDI Capacity: 21273 MBytes
UUID: aca81637-fbc0-4826-be66-847ecc96d83b Parent UUID: base State: created Type: normal (base) Location: C:\Users\Edward.Wu\VirtualBox VMs\WinXP\WinXP.vdi Storage format: VDI Capacity: 10240 MBytes
4.查看新的磁盤空間
重新啟動虛擬機,查看磁盤情況。
。踨oot@aimin ~]# fdisk -l /dev/sda
Disk /dev/sda: 15.7 GB, 15728640000 bytes 255 heads, 63 sectors/track, 1912 cylinders
可以看到磁盤空間已經擴展到15G,但這時還不可以使用。
5.Enable新增加的空間
使用 fdisk 將虛擬磁盤的空閑空間創(chuàng)建為一個新的分區(qū)。注意要使用代表 Linux LVM 的分區(qū)號 8e 來作為 ID。
# fdisk /dev/sda
n {new partition}
p {primary partition}
3 {partition number}
。圻@時會提示修改大小,選擇默認直接回車即可]
t {change partition id}
3 {partition number}
8e {Linux LVM partition}
w
------
如果中間有設置大小之類的提示,就直接回車。
完成后,如果提示:
WARNING: Re-reading the partition table failed with error 16: 設備或資源忙。 The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8)
就重啟一下系統。
6.查看新增加的sda3是否標記為LVM,如果沒有需要reboot
#fdisk -l /dev/sda
7.調整LVM大小
先看一下Volume Group名稱
。踨oot@aimin ~]# vgdisplay --- Volume group --- VG Name vg_aimin
。。.。
vg_aimin是我的VolumeGroup的名稱,實際操作時,需要使用實際顯示的名稱。
8.把新分配的空間創(chuàng)建一個新的物理卷
#pvcreate /dev/sda3
9.然后使用新的物理卷來擴展 LVM 的 VolGroup,
# vgextend vg_aimin /dev/sda3
No physical volume label read from /dev/sda3
Writing physical volume data to disk “/dev/sda3”
Physical volume “/dev/sda3” successfully created
Volume group “vg_aimin” successfully extended
10.然后擴展 LVM 的邏輯卷 vg_aimin-lv_root,
# lvextend /dev/vg_aimin/lv_root /dev/sda3
11.調整邏輯卷的大小
#resize2fs /dev/vg_aimin/lv_root
到這里就完成了空間的擴展。
12.查看效果
。踨oot@aimin ~]# df -h文件系統 容量 已用 可用 已用%% 掛載點/dev/mapper/vg_aimin-lv_root 12G 5.2G 6.2G 46% /tmpfs 499M 80K 499M 1% /dev/shm/dev/sda1 485M 33M 427M 8% /boot
成功擴展。!
上面就是Linux修改VirtualBox虛擬機磁盤容量的方法介紹了,首先使用命令行進入VirtualBox虛擬機的安裝目錄,在找到相應文件進行磁盤大小的修改。
發(fā)表評論
共0條
評論就這些咯,讓大家也知道你的獨特見解
立即評論以上留言僅代表用戶個人觀點,不代表系統之家立場