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

Fedora 27(Btrfs分区SSD)无法启动,求助解决启动报错问题

Hey there, let's work through this frustrating boot issue with your Fedora 27 and Btrfs setup—you've got two main hurdles here: a corrupted Btrfs filesystem and a locked root account blocking rescue mode access. Let's tackle them one by one.

Step 1: Bypass the Locked Root Account to Access Rescue Mode

The "root account is locked" error is stopping you from getting into the rescue console, so we'll use a GRUB trick to gain access and reset the root password:

  • When the GRUB menu pops up, select the rescue mode entry and press e to edit its boot parameters.
  • Look for the line starting with linux (it'll have a bunch of kernel options). At the very end of this line, add rd.break.
  • Press Ctrl+X to boot with this modified configuration. You'll drop into an emergency shell where the root filesystem is mounted read-only at /sysroot.
  • Remount it as read-write to make changes:
    mount -o remount,rw /sysroot
    
  • Switch to the actual root environment:
    chroot /sysroot
    
  • Now reset the root password (follow the prompts to enter and confirm a new one):
    passwd root
    
  • Exit the chroot environment:
    exit
    
  • Remount the filesystem back to read-only:
    mount -o remount,ro /sysroot
    
  • Finally, start the normal init process to enter rescue mode:
    exec /sbin/init
    

You should now have access to the rescue console without the lock error.

Step 2: Repair the Corrupted Btrfs Filesystem

Now that you're in rescue mode, let's fix the Btrfs issues you're seeing (bad tree blocks, orphan entries, pending checksums):

  1. First, identify your Btrfs root partition. Run blkid to list all partitions—look for the one with TYPE="btrfs" (it's usually something like /dev/mapper/fedora-root or /dev/sda3).
  2. Unmount the partition if it's already mounted (rescue mode might mount it automatically, so check with mount first):
    umount /dev/your-btrfs-partition
    
  3. Run a read-only check first to assess the damage (this won't modify your data):
    btrfs check --readonly /dev/your-btrfs-partition
    
    This will confirm the bad tree blocks and other issues you saw earlier.
  4. If the read-only check confirms corruption, run the repair tool. Warning: This will modify your filesystem—if you can, back up any critical data first (e.g., by connecting the SSD to another computer or using a Live USB to mount it read-only).
    btrfs check --repair /dev/your-btrfs-partition
    
    This command will fix orphan entries, repair bad tree blocks, and resolve the pending checksum issues.
  5. After repair, test mounting the partition to make sure it works:
    mount /dev/your-btrfs-partition /mnt
    
    You can navigate to /mnt and check if your files are accessible.
Step 3: Post-Repair Checks to Ensure Bootability

Once the filesystem is repaired, let's make sure your system can boot properly:

  • If you're still in the chroot environment (from Step 1), regenerate the initramfs to ensure all filesystem drivers are up to date:
    dracut -f
    
  • Update your GRUB configuration to make sure it points to the correct partition:
    • For BIOS systems:
      grub2-mkconfig -o /boot/grub2/grub.cfg
      
    • For UEFI systems:
      grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
      
  • Exit rescue mode and reboot your laptop. Try booting with your default kernel entry—this should work now if the repair was successful.
Important Notes
  • The btrfs check --repair command is a last resort—always prioritize backing up data before running it if possible.
  • If you keep seeing filesystem corruption after repair, it might be a sign of SSD hardware failure. Run a SMART check to verify:
    smartctl -a /dev/sda
    
  • Fedora 27 reached end-of-life years ago, so it doesn't receive security updates or bug fixes. Once you get your system up and running, consider upgrading to a supported version of Fedora for better stability.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 09:15:27