Linux · 2023-12-04

Ubuntu开机卡在 A start job is runing for wait for Network to be configured (1min 23s / no limit)

在【service】代码快最末尾加上TimeoutStartSec=2sec

root@k8s-master1:~# cd /etc/systemd/system/network-online.target.wants/
root@k8s-master1:/etc/systemd/system/network-online.target.wants# ll
total 8
drwxr-xr-x 2 root root 4096 Aug 24 2021 ./
drwxr-xr-x 19 root root 4096 Mar 24 08:11 ../
lrwxrwxrwx 1 root root 56 Aug 16 2021 systemd-networkd-wait-online.service -> /lib/systemd/system/systemd-networkd-wait-online.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.

[Unit]
Description=Wait for Network to be Configured
Documentation=man:systemd-networkd-wait-online.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
Requires=systemd-networkd.service
After=systemd-networkd.service
Before=network-online.target shutdown.target

[Service]
Type=oneshot
ExecStart=/lib/systemd/systemd-networkd-wait-online
RemainAfterExit=yes
TimeoutStartSec=2sec
[Install]
WantedBy=network-online.target

调整vg大小:

vgdisplay
lvdisplay

扩容:
lvcreate -L 300G -n data-lv vgname
mkfs.ext4 /dev/vgname/data-lv
lvextend -l +100%FREE /dev/vgname/data-lv
resize2fs /dev/vgname/data-lv 480M
e2fsck -fy /dev/vgname/data-lv

缩容:
umount /home
e2fsck /dev/vg_powerpd/lv_home
resize2fs -f /dev/vg_powerpd/lv_home 15g
lvreduce -L15g /dev/vg_powerpd/lv_home
mount /dev/vg_powerpd/lv_home