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

UEFI+LUKS加密+LVM环境下Ubuntu16.04重装故障求助

Fixing Ubuntu Boot Failure After /boot Deletion (LUKS + LVM)

Alright, let's walk through getting your LUKS-encrypted, LVM-based Ubuntu system back up and running. You're stuck booting straight to UEFI because /boot got deleted, /proc is empty, and the installer can't detect your existing OS—so we'll use the "Something else" workflow via Live USB, but first we need to manually mount and repair your system.

Step 1: Boot from Live USB & Prepare the Environment

  1. Fire up your machine with the Ubuntu Live USB, select "Try Ubuntu" to get to the desktop.
  2. Open a terminal (Ctrl+Alt+T) — we'll use this for all commands moving forward.

Step 2: Unlock LUKS & Activate LVM

First, we need to access your encrypted disk and LVM volumes:

  • List all disks/partitions to identify your encrypted volume:
    lsblk
    
    Look for a partition with TYPE=crypt (e.g., /dev/sda3). Note this device path carefully.
  • Unlock the encrypted partition (replace /dev/sda3 with your actual crypt partition):
    sudo cryptsetup luksOpen /dev/sda3 cryptdata
    
    Enter your LUKS passphrase when prompted.
  • Scan for LVM volume groups and activate them:
    sudo vgscan
    sudo vgchange -ay
    
  • Verify your LVM logical volumes are available:
    ls /dev/mapper
    
    You should see entries like ubuntu-root (your root filesystem) and ubuntu-swap (swap volume).

Step 3: Mount System Partitions & Enter Chroot

Now we'll mount your system and chroot into it to perform repairs directly on your installed OS:

  1. Mount your root logical volume (replace ubuntu-root with your actual root volume):
    sudo mount /dev/mapper/ubuntu-root /mnt
    
  2. Mount critical system directories to link the Live environment to your installed system:
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    
  3. Recreate the /boot directory since it was deleted:
    sudo mkdir /mnt/boot
    
  4. Find your EFI system partition (ESP) via lsblk — it's the small (usually ~512MB) partition with TYPE=vfat. Mount it to /boot/efi:
    sudo mount /dev/sda1 /mnt/boot/efi
    
  5. Enter the chroot environment to work directly on your installed system:
    sudo chroot /mnt
    

Step 4: Repair Grub & Kernel

Now we'll fix the bootloader and ensure all necessary boot files are present:

  1. Reinstall GRUB to your main disk (replace /dev/sda with your actual disk, not a partition):
    grub-install /dev/sda
    
  2. Update the GRUB configuration to detect your system and generate a valid boot menu:
    update-grub
    
  3. Reinstall your kernel packages to ensure all missing boot files are restored (adjust the package names if you're using a non-generic kernel):
    apt install --reinstall linux-image-generic linux-headers-generic
    

Step 5: Clean Up & Reboot

  1. Exit the chroot environment:
    exit
    
  2. Unmount all mounted partitions in reverse order to avoid errors:
    sudo umount /mnt/boot/efi
    sudo umount /mnt/dev
    sudo umount /mnt/proc
    sudo umount /mnt/sys
    sudo umount /mnt
    
  3. Close the encrypted LUKS partition:
    sudo cryptsetup luksClose cryptdata
    
  4. Remove the Live USB and reboot your machine — it should now boot normally into your encrypted Ubuntu system.

Important Notes

  • Double-check all device paths (/dev/sdaX, volume names) when running commands — using the wrong path can cause avoidable issues.
  • Since you've already backed up your data, you can proceed with confidence, but take your time to verify each step before moving on.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 03:21:11