LLVM编译需要较大的磁盘空间,几十个G也不够,会有下面的错误。
clang: error: unable to execute command: Killed
博客说是swap大小的原因,先将这个问题解决了,然后是磁盘空间的问题。
以下在VMare Ubuntu 16.04 下LVM的过程中截了几张图,有些没有截下来,以下总结一下流程,有图的贴图。
- 首先是现象,前几次编译,基于LLVM最新版本总是编译到一半就失败,有一次切换到3.8版本反而成功了。这次找到原因是磁盘空间不够。
df -h
查看剩余磁盘大小。 - VMWare 调整磁盘空间。增加了30G磁盘空间。这个关闭虚拟机,设置磁盘空间,扩展即可。
- 但是我按照的Ubuntu使用的是逻辑卷存储,需要扩容一下分区,命令行不熟,找了一个使用gparted图形界面的设置方法。
下载gparted镜像:gparted.org/download.ph…
-
VMWare设置虚拟机使用ISO镜像
虚拟机记得连接IOS CD。
-
VMWare开机,立即按F2,设置BIOS从CD进入。
-
进入gparted ISO引导的系统,一些语言设置
-
进入gparted的图形界面了,但是网上的扩容教程并不适用。 直接更改大小,并不适用。
gparted的lvm扩容方法,参考的这篇链接。记得APPLY。
- Backup your data in case anything should happen to go wrong.
- Boot VM using GParted Live.
- Select /dev/sda5 LVM2 PV partition
- Choose Partition -> Deactivate
- Select /dev/sda2 Extended partition
- Choose Partition -> Resize/Move
- Grow the partition to the end of the drive.
- Select /dev/sda5 LVM2 PV partition
- Choose Partition -> Resize/Move
- Grow the partition to butt up against the end of the sda2 Extended partition.
- Apply the operation Exit GParted, and boot into the VM OS. In a terminal window, with root privilege (su or sudo), use the appropriate lvresize command line options to grow the logical volume(s) you wish to increase in size.
-
扩容后效果。不知道为什么要留1M。
-
卸载掉ISO镜像。
-
进入Linux系统,通过lvm命令行管理,
df -h
扩容需要的分区,如/dev/mapper/dev--vg-root
:lvresize -L +30G /dev/mapper/dev--vg-root resize2fs /dev/mapper/dev--vg-root