You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16 LTS重启或关机时出现挂起问题求助

解决Ubuntu 16.04 LTS关机/重启挂起的问题

Hey there! Let's work through this annoying shutdown/reboot hang issue you're having with Ubuntu 16.04 LTS. It's such a pain when things that used to work suddenly break—let's break down some fixes to get your system shutting down cleanly again.

1. 先检查磁盘状态与挂载情况

Since your Ubuntu is installed on a partition of that 1GB HDD (quick note: that seems really small—1GB is barely enough for a basic Ubuntu install, so if that's a typo for 1TB, just adjust the steps below accordingly), disk issues are a common culprit here.

  • Run a filesystem check on your Ubuntu partition:
    Open a terminal first, then identify your Ubuntu partition with:
    sudo fdisk -l
    
    Look for the partition labeled as / (root) for Ubuntu. Then unmount it if it's mounted (skip this if it's your root partition—boot from a live USB instead to run the check):
    sudo umount /dev/sdXn
    
    Replace /dev/sdXn with your partition (like /dev/sdb1). Then run the filesystem check:
    sudo fsck /dev/sdXn
    
  • Check the HDD's health with smartmontools:
    Install it first if you don't have it:
    sudo apt-get install smartmontools
    
    Then scan the entire HDD:
    sudo smartctl -a /dev/sdX
    
    Replace /dev/sdX with your HDD device (e.g., /dev/sdb). Look for any "Failed" statuses or high error counts—these would signal a failing disk.

2. 调整GRUB启动参数

Incorrect power management settings in GRUB often cause shutdown hangs. Let's tweak them:

  • Edit the GRUB config file:
    sudo nano /etc/default/grub
    
  • Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash". Add one of these parameters to the end to fix power management issues:
    • acpi=force: Forces ACPI (Advanced Configuration and Power Interface) to enable, which helps with shutdown
    • apm=power_off: Switches to APM (Advanced Power Management) instead of ACPI for shutdown
    • noapic: Disables the APIC if it's causing hardware conflicts
      Example modified line:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"
    
  • Save the file (press Ctrl+O, then Enter), exit nano (Ctrl+X), then update GRUB:
    sudo update-grub
    

Reboot your system and test if shutdown/restart works now.

3. 排查后台进程与服务

Sometimes a misbehaving process or service refuses to terminate, causing the system to hang. Here's how to track it down:

  • When the system hangs during shutdown, try switching to a text console by pressing Ctrl+Alt+F1 (or F2-F6). You might see messages about processes that are stuck stopping.
  • If you can't catch that in real-time, check the system logs after a failed shutdown:
    sudo cat /var/log/syslog | grep -i shutdown
    sudo cat /var/log/boot.log
    
    Look for error messages about services failing to stop (like failed to stop [service-name]).
  • If you find a problematic service, disable it temporarily to test:
    sudo systemctl stop [service-name]
    sudo systemctl disable [service-name]
    

Reboot and see if shutdown works—if it does, you can dig deeper into fixing that specific service.

4. 更新系统与驱动

Even though Ubuntu 16.04 is end-of-life, there might be leftover updates or driver fixes that can resolve the issue:

  • Run system updates (if you still have access to the old repositories):
    sudo apt-get update
    sudo apt-get upgrade
    
  • Check for proprietary graphics drivers: Open "Software & Updates" > "Additional Drivers" and see if there are recommended drivers for your GPU. Graphics driver issues are a frequent cause of shutdown hangs.

5. 检查磁盘空间(关键提醒!)

Wait a minute—you said Ubuntu is on a partition of a 1GB HDD? That's way too small for a functional Ubuntu install (the minimal requirement is around 5GB). If your partition is full, that's almost certainly causing instability, including shutdown hangs.

  • Check your disk usage:
    df -h
    
    Look at the Use% column for your Ubuntu partition. If it's 90% or more full, free up space:
    sudo apt-get clean  # Clears old apt packages
    sudo apt-get autoremove  # Removes unused packages
    

You might also need to move some files off the partition or resize it if possible (though resizing partitions can be risky—back up data first!).

内容的提问来源于stack exchange,提问作者student_23

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:45:20