旃麒雅 发表于 2015-4-8 08:51:47

【转】如何扩大VMware虚拟机中Linux硬盘大小- VM7.1.2 & FC6

起因:编译Qt,提示No space left on device。

  磁盘空间使用情况:/dev/sda3 主分区14G 已全部用完。
  环境说明:
  虚拟机版本:VMware® Workstation 7.1.2 build-301548
  Linux版本:Linux version 2.6.18-1.2798.fc6
  分区工具   :gparted-live-0.6.4-1.iso   
  GParted http://gparted.sourceforge.net/
  目标:将Linux 虚拟硬盘大小从15.6G 扩大到19G,主要是为/dev/sda3 扩容。
  扩容前磁盘使用情况:
# df -lh Filesystem            Size   Used Avail Use% Mounted on /dev/sda3            14G   14G   0 100% / /dev/sda1            190M   11M   171M   6% /boot tmpfs               252M   0   252M   0% /dev/shm  
  第一步:使用VM Expand 工具扩容。(扩容前提条件见虚拟机帮助文档 Expand a Virtual Disk项)
http://hi.iyunv.com/attachment/201011/3/1624339_1288783846C3S8.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288783921p26D.png
  第二步:设置启动进入GParted。
  1)设置CD/DVD 加载GParted镜像,勾选Connect at power on。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783921TtO0.png
  2)启动到BIOS界面。旧版本VMware 可以直接启动时按F2进BIOS。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783924GL7M.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288783925i8CA.png
  3)按“+”将CD-ROM Drive 调为第一启动项,按F10保存并重启。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783927M55n.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288783930ypP0.png
  (待分区调整结束后需改回原样,或将Hard Drive调作第一启动项)
  
4)按默认选择GParted Live (Default settings),直接Enter。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783932iJY6.png
  
5)默认不更改keymap,直接Enter。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783932P65F.png
  
6)系统语言设置,输入26,回车。注:26 表示简体中文。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783933kukK.png
  
7)选择图形系统模式,按默认的(0),直接回车。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783938IZY4.png
  第三步:调整分区大小。
  1)选择 /dev/sda3,选择“更改大小/移动”。
  (若有多出的已经格式化的分区,可以选择删除/Delete,使之合并到未分配空间中,方便扩容)
http://hi.iyunv.com/attachment/201011/3/1624339_1288783940J4Ir.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288783943hGHo.png
  2)拖动箭头扩大分区,再点“更改大小/移动”。
http://hi.iyunv.com/attachment/201011/3/1624339_1288783945EL06.png
http://hi.iyunv.com/attachment/201011/3/1624339_128878405515w2.png
  
3)选择 Apply (应用,使刚刚的扩容操作生效),确认Apply。
http://hi.iyunv.com/attachment/201011/3/1624339_1288784056Yz38.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288784058QPT4.png
  
4)等待扩容操作结束。
http://hi.iyunv.com/attachment/201011/3/1624339_12887840606nHN.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288784060P3gX.png
  
http://hi.iyunv.com/attachment/201011/3/1624339_1288784061UP3x.png
http://hi.iyunv.com/attachment/201011/3/1624339_1288784062sf4w.png
  第四步:退出系统,双击Exit,选择shutdown,OK。提示取出CD再Continue时,直接回车即可。
http://hi.iyunv.com/attachment/201011/3/1624339_12887840645ay3.png
  
http://hi.iyunv.com/attachment/201011/3/1624339_1288784064CIfB.png
  扩容后使用df命令查看磁盘使用情况如下:
# df -lh
Filesystem            SizeUsed Avail Use% Mounted on
/dev/sda3            18G   14G3.1G82% /
/dev/sda1          190M   11M171M   6% /boot
tmpfs               252M   0252M   0% /dev/shm
  别忘了恢复VMware Workstation BIOS 第一启动项。
  
页: [1]
查看完整版本: 【转】如何扩大VMware虚拟机中Linux硬盘大小- VM7.1.2 & FC6