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

系统频繁无法启动进入initramfs界面,遭遇e2fsck不支持日志版本问题且/etc/fstab为空的求助

系统频繁无法启动进入initramfs界面,遭遇e2fsck不支持日志版本问题且/etc/fstab为空的求助

Hey there, let's work through this issue step by step—you've got two critical problems here: a filesystem inconsistency with an unsupported journal version, and an empty /etc/fstab file. Let's start with the filesystem repair first since that's stopping your system from booting properly.

第一步:修复文件系统(解决e2fsck日志版本问题)

The error message tells us your /dev/nvme0n1p2 partition has a journal version that the e2fsck in your initramfs can't handle, plus unexpected filesystem inconsistencies. Here are two reliable approaches:

方法1:在initramfs内尝试修复

If you want to fix it directly from the initramfs prompt:

  • First, run a read-only check to confirm the issue without making any changes:
    fsck.ext4 -n /dev/nvme0n1p2
    
  • If the problem is indeed the unsupported journal, try discarding the old journal and repairing the filesystem (note: this will lose uncommitted recent changes, but it's a necessary step to recover):
    fsck.ext4 -E discard_journal /dev/nvme0n1p2
    
    Follow the on-screen prompts to confirm repairs (usually type y when asked). Once done, run exit again to see if the system boots normally.

方法2:使用Linux Live介质修复(更稳妥)

If the initramfs's e2fsck is too outdated to handle the new journal version, use a Linux Live USB/CD (like Ubuntu Live, Fedora Live, or any mainstream distro's live image):

  1. Create a bootable live USB/CD, then boot your system from it and select the "Try [Distro Name]" option to enter a working environment.
  2. Open a terminal and run lsblk to confirm your NVMe partition—you should see /dev/nvme0n1p2 listed clearly.
  3. Run the filesystem check with the updated e2fsck from the live environment:
    sudo fsck.ext4 /dev/nvme0n1p2
    
  4. Follow the prompts to fix any detected issues (type y to confirm repairs). Once finished, shut down the live environment and try booting your normal system again.

第二步:恢复空的/etc/fstab文件

Once your filesystem is fixed and you can access your system (either by booting normally or mounting the partition from the live environment), you need to rebuild /etc/fstab—this file tells the system which partitions to mount at boot.

  1. Get partition UUIDs: Run blkid in a terminal. This will output all your partitions with their unique, stable UUIDs. Look for entries like:
    /dev/nvme0n1p2: UUID="abc123-def4-56gh-ijkl-mnopqrstuvwx" TYPE="ext4"
    /dev/nvme0n1p1: UUID="1234-ABCD" TYPE="vfat"  # Likely your EFI boot partition (if using UEFI)
    /dev/nvme0n1p3: UUID="zyxwvuts-rqpo-nmlk-jihg-fedcba987654" TYPE="swap"  # Swap partition (if you have one)
    
  2. Edit /etc/fstab:
    • If booted into your normal system, open a terminal and run sudo nano /etc/fstab.
    • If using the live environment, first mount your root partition: sudo mount /dev/nvme0n1p2 /mnt, then edit with sudo nano /mnt/etc/fstab.
    • Add the necessary lines based on your blkid output. Here's a typical example:
      # Root partition
      UUID=abc123-def4-56gh-ijkl-mnopqrstuvwx / ext4 defaults 0 1
      # EFI boot partition (only if you use UEFI)
      UUID=1234-ABCD /boot/efi vfat defaults 0 2
      # Swap partition (if exists)
      UUID=zyxwvuts-rqpo-nmlk-jihg-fedcba987654 none swap sw 0 0
      
  3. Test the configuration: Run sudo mount -a (if in the live environment, run this after mounting the root partition). If no errors pop up, your /etc/fstab is set up correctly.

后续预防建议

  • Keep your system updated: Regularly update your distro to ensure e2fsck, kernel, and other system tools are up-to-date—this avoids version mismatches with new filesystem features.
  • Backup /etc/fstab: Before making any changes to this file, always create a backup: sudo cp /etc/fstab /etc/fstab.bak. This lets you restore it quickly if something goes wrong.

备注:内容来源于stack exchange,提问作者user109871

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.23 15:19:05