Ubantu启动失败,提示“Started GNOME Display Manager”之后起不来了

我是在搭建DPDK环境时,为了尝试下多网卡多列配置,将虚拟机的网卡类型由e1000改成了vxnet3类型。之后修改了下内存大小和CPU核数。然后启动ubantu虚拟机,结果无法成功启动,显示结果如下:

经过一通废操作,没有任何效果。经过多次百度,查询博客,最终找到了问题的原因。下面进行说明:

1. 使用命令行进入ubantu系统

在上面那个页面,直接使用组合键:Ctrl + Alt + F3 便可以进入命令行模式。如果可以成功进入,则说明ubantu系统确实起来了,只是界面相关的模块没有成功启动而已。

如果是这样的话,也不怎么影响使用。但是这个问题的原因还是要查一下滴。

输入用户名和密码之后,成功进入系统中:

2. 查看磁盘空间

可以看出:/dev/sda1 共计20G空间使用完了,磁盘不足导致系统无法完全启动成功。因此我们需要适当删除占空间的文件应该便可以解决。

 

3. 使用命令行清空snapd相关内容

当然,我这里效果不好使。然后我就一个一个去找哪些文件比较占内存,然后delete掉

4. du查找占空间的文件、目录

适当的卸载部分snap功能,删除个人感觉没有用的大文件,然后重新查看下磁盘使用情况:

有一点点改观,现在重新启动,应该可以正常启动了。

5. 重新启动

重新启动虚拟机,发现现在确实可以成功启动了

 

6. 后续

既然上述原因是由于磁盘空间不足导致的,那么最根本的版本还是对虚拟机进行扩容。so我对ubantu虚拟机进行了扩容处理(详细步骤可以参考:虚拟机磁盘扩容)

直接另外分配了40G的硬盘空间,以后使用虚拟机时尽量将文件放到该磁盘中,这样便可以比较彻底解决上述问题。

当然,现在磁盘已经分配挂在成功,为了以后每次启动自动挂在此硬盘,需要将挂在命令添加到启动脚本中。

由于Ubantu18.04没有/etc/rc.local文件,因此需要做一点点配置,然后手动创建rc.local才可以。我这里参考了几篇文章:

http://www.r9it.com/20180613/ubuntu-18.04-auto-start.html

https://blog.csdn.net/weicao1990/article/details/101121085

然后成功了添加了/etc/rc.local启动脚本

我修改的文件如下:

  • /lib/systemd/system/rc.local.service
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no


[Install]
WantedBy=multi-user.target
Alias=rc-local.service

  • /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
mount /dev/sdb1 /home/disk
exit 0
 
 
  • 9
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

叨陪鲤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值