linux – 在Ubuntu 10.04上扩展磁盘空间(VMWare Guest)

前端之家收集整理的这篇文章主要介绍了linux – 在Ubuntu 10.04上扩展磁盘空间(VMWare Guest)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要调整VMWare Workstation中ubuntu guest虚拟机的磁盘空间大小.在vmware工作站中使用扩展磁盘实用程序后,我需要做一些 linux魔术来调整parition的大小.我搜索过并发现了很多关于调整大小的帖子.不幸的是,我并没有真正理解这一切.任何人都可以帮我解决这个问题吗?
  1. jclawson@ubuntu:~$df
  2.  
  3. Filesystem 1K-blocks Used Available Use% Mounted on
  4. /dev/mapper/ubuntu-root
  5. 7583436 5678136 1520072 79% /
  6. udev 1030884 152 1030732 1% /dev
  7. none 1030884 0 1030884 0% /dev/shm
  8. none 1030884 72 1030812 1% /var/run
  9. none 1030884 0 1030884 0% /var/lock
  10. none 1030884 0 1030884 0% /lib/init/rw
  11. /dev/sda5 233335 39274 181613 18% /boot
  12. .host:/ 244035580 96519316 147516264 40% /mnt/hgfs
  13.  
  14.  
  15. root@ubuntu:~# lvs
  16. LV VG Attr LSize Origin Snap% Move Log Copy% Convert
  17. root ubuntu -wi-ao 7.35G
  18. swap_1 ubuntu -wi-ao 388.00M
  19.  
  20.  
  21. root@ubuntu:~# fdisk -l
  22.  
  23. Disk /dev/sda: 8589 MB,8589934592 bytes
  24. 255 heads,63 sectors/track,1044 cylinders
  25. Units = cylinders of 16065 * 512 = 8225280 bytes
  26. Disk identifier: 0x0009bea5
  27.  
  28. Device Boot Start End Blocks Id System
  29. /dev/sda1 * 1 1013 8136891 8e Linux LVM
  30. /dev/sda2 1014 1044 249007+ 5 Extended
  31. /dev/sda5 1014 1044 248976 83 Linux

我非常感谢你的帮助.

解决方法

好吧,经过多次劳累,我终于弄明白了怎么做.再一次,gparted不能使用.首先,您应该在VMWare Workstation中扩展磁盘的大小.启动到livecd并打开根终端:

我们需要从空闲的未使用空间中创建一个LVM类型的新主分区.

  1. #fdisk /dev/sda
  2. #Command (m for help): n
  3. #Command (m for help): p
  4. #Command (m for help): 3
  5. #Command (m for help): w

重新将vm重新启动到live cd

创建物理卷:

  1. #pvcreate /dev/sda3

将新卷添加到组:

  1. #vgextend ubuntu /dev/sda3

找出您想要扩展到的可用空间量

  1. #vgdisplay

检查“自由PE /大小”等于什么,并在下一个命令中使用该值

扩展lvm并将文件系统扩展到新空间

  1. #e2fsck -f /dev/ubuntu/root
  2. #lvextend -L +12.6G /dev/ubuntu/root
  3. #resize2fs /dev/ubuntu/root

完成!

猜你在找的Linux相关文章