You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Ubuntu更新失败致系统启动进入GRUB提示符,请求解决办法

Fixing Ubuntu GRUB Prompt Loop After Failed Update

Alright, let's work through this GRUB issue you're facing after a botched Ubuntu update—this is a pretty common scenario, and we can get your system back up and running with a few targeted steps.

Step 1: Locate Your Ubuntu Installation Partition

When stuck at the GRUB prompt, even if the ls command throws weird errors, we need to find which partition holds your Ubuntu files. Here's how:

  • Run ls first to see all detected disks (you'll see entries like (hd0) or (hd1)).
  • For each disk, list its partitions: e.g., ls (hd0) will show partitions such as (hd0,1) or (hd0,2).
  • Check each partition with ls (hd0,2)—look for core system directories like boot, bin, etc, or home. That's your target partition (the one with your Ubuntu install).

Step 2: Boot into Ubuntu Directly from GRUB

Once you've identified the correct partition (we'll use (hd0,2) as an example), run these commands in sequence:

  1. set root=(hd0,2)
  2. set prefix=(hd0,2)/boot/grub
  3. insmod normal
  4. normal

This should load the standard GRUB menu. Select your Ubuntu entry to boot into the system like normal.

Step 3: Permanently Repair GRUB to Avoid Future Loops

After successfully booting into Ubuntu, open a terminal and run these commands to fix GRUB for good:

  • First, update the GRUB configuration with your current system setup:
    sudo update-grub
    
  • Then reinstall GRUB to your system's main disk (replace /dev/sda with your actual disk—use lsblk to check if you're unsure; it's the disk name without a partition number, e.g., /dev/nvme0n1 for NVMe drives):
    sudo grub-install /dev/sda
    

Handling "Unknown Filesystem" Errors

If running ls (hdX,n) returns an "unknown filesystem" error, your partition might be corrupted. Here's how to resolve that:

  1. Boot from an Ubuntu installation USB drive, select "Try Ubuntu without installing".
  2. Open a terminal and run lsblk to find your Ubuntu partition (look for the one labeled ext4).
  3. Run a filesystem check to repair errors (replace /dev/sdXn with your partition path):
    sudo fsck /dev/sdXn
    
    Follow the on-screen prompts to fix any detected issues, then repeat Steps 1-3 above to repair GRUB.

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

火山引擎 最新活动