Ubuntu20.04 TLS 开机卡在“A start job is running for wait for network to be Configured”解决

问题:

安装ubuntu20.04 TLS系统后,开机卡在“A start job is running for wait for network to be Configured”等待连接两分多钟。(启动作业正在运行,等待配置网络)

解决办法:

1、进入该目录下,修改配置文件。

kuaibang@face:~$ cd /etc/systemd/system/network-online.target.wants/

2、在[Service]下添加 TimeoutStartSec=2sec,(设置超时时间为2秒)如下:

kuaibang@face:/etc/systemd/system/network-online.target.wants$ sudo nano systemd-networkd-wait-online.service 
[Service]
Type=oneshot
ExecStart=/lib/systemd/systemd-networkd-wait-online
RemainAfterExit=yes
TimeoutStartSec=2sec

3、重启验证

sudo reboot

 附加:

swap相关报错,启动必须等1分30秒。

a start job is running for /dev/disk/by-uuid/xxxxx.(20s / 1 min 30 s )

1、解决1

1.1 查看交换分区挂载情况:

swapon --show

1.2 查看交换分区情况:

sudo blkid

1.3 然后再查看/etc/fstab文件中swap分区的UUID。

sudo cat /etc/fstab

两个UUID不同,正好解释了为什么swap分区会挂载失败。

解决方法是删除/etc/fstab文件中swap分区的UUID,

再用sudo blkid命令得出的swap分区UUID替换。保存文件,重启系统后a start job is running for

dev-disk-by这个错误就消失了。

2、解决2

2.1 修改/etc/fstab文件,注掉swap那一行

yang@ubuntu:/path$ sudo cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/cxxxx06-xxxxc-4xxxx0-xxxxx80-xxxxxxxaac / ext4 defaults 0 1
#/swap.img      none    swap    sw      0       0

2.2 重启不然加载swap分区,即可解决此报错

sudo reboot

 

posted @ 2022-04-21 11:13  西瓜君~  阅读(15119)  评论(1编辑  收藏  举报