Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

问题起源:

cannot create temp file for here-document: No space left on device

search之后的解决方法:sda容量不够,就要拓容

拓容的方法如下:

一、在虚拟机设置上设置拓展容量

/dev/sda1拓容

1、拓容之前,查看/dev/sda*

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

2、关机,虚拟机设置->硬盘->拓展

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

稍等一两分钟,拓容完了之后会提示,要从可惠及操作系统内部重新分区。

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

3、开启虚拟机,执行【sudo fdisk -l】,可以看到

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

 

二、拓容之后重新分区

1、安装Gparted

方法一,在终端执行【sudo apt-get install gparted】,这种方法是行不通,因为内存已经满了,提示

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

方法二:下载Gparted镜像,从虚拟机加载

GParted下载地址:https://sourceforge.net/projects/gparted/postdownload

1、将Gparted镜像加载到虚拟机启动时连接

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

2、打开电源时进入固件(关机之后,再开机直接按ESC是进不去的,用我这种方法一下子就进入BIOS了)

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

3、进入BIOS之后设置优先启动项,将CD-ROM设置为第一启动选项

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(1)进入如下界面后直接回车

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(2)继续回车

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(3)选择26,即中文简体

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(4)选择0,继续启动并自动启动Gparted

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

4、进入Gparted分区

(1)合并分区到sda1,按顺序删除linux-swap和extended,最后剩下sda1和未分配

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(2)右键sda1,并选择调整大小,我这里调整大小为40G

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(3)在右键“未分配”新建拓展分区,电机“新建”

 

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(4)点击Apply,使其生效

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

(5)拓展分区之后的效果如下

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

 

三、进入终端验证拓容是否成功

1、移除Gparted镜像

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

2、开机,在终端执行【df -hl】,检测刚才拓展的容量是否成功

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之

3、查看sda分区

Ubuntu 1604报错cannot create temp file for here-document: No space left on device,拓展sda容量解决之