修复 /dev/sda2 恢复日志时遇到问题

修复 /dev/sda2 恢复日志时遇到问题

今天我看到 Ubuntu 正在清理孤立的 inode。以下是启动日志消息:

/dev/sda2: clearing orphaned inode 396229 uid=1000 gid=1000 mode 0100600 ,si
/dev/sda2: clearing orphaned inode 1300596 uid=1000 gid=1000 mode 0100600 ,si
/dev/sda2: clean 578019/30049216 files, 22460578/121120000 blocks

此外:

[FAILED] Failed to start Postfix Mail Transport Agent, instance -)

然后启动恢复。我多次重启系统,但日志各不相同。有时 Postifix 错误从不显示,有时它告诉我缺少 lowerdir,有时它只显示上面的前三行。经过进一步调查,我设法将错误定位到 /dev/sda2,但我似乎无法篡改它,即使作为超级用户也是如此。之后,我在文件系统上运行了部分 fsck,它告诉我:

fsck from util-linux 2.36.1
e2fsk 1.46.3 (27-Jul-2021)
Warning! /dev/sda2 is mounted,
\Warning : skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list is found. Fix? no

Inode 390774 was part of the orphaned inode list.   IGNORED.
Inode 390808 was part of the orphaned inode list.   IGNORED.
Deleted Inode 1300596 has zero dtime. Fix? no

Inode 2087213 extent tree (at level 1) could be shorter. Optimize? no

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(189466--189467) -(189956--189963) -(261644--261652)
Fix? no

Free blocks count wrong (98659422, counted=98643826).
Fix? no

Inode bitmap differences:    -390774  -390808  -1300596
Fix? no

/dev/sda2: ********** WARNING: Filesystem still has errors **********

/dev/sda2: 578019/30049216 files (0.8% non-contiguous), 22460578/121120000 blocks


At this point, I have tried to umount the filesystem  to actually fix the error, but it tells me it's busy, even though I ran the "kill all processes command".I also tried to do it through grub shell prompt, with no luck either.I may be forgetting something (I'm still a beginner), but I would like some help with fixing this filesystem

此外,我更喜欢一种不需要实时 USB 的方法,只是因为我没有 USB,而且在我所在地区很难找到 USB,但我仍然愿意接受所有解决方案。

答案1

恰当的检查/修复文件系统的方法...

  • 以“试用 Ubuntu”模式启动 Ubuntu Live DVD/USB
  • terminalCtrl+ Alt+打开窗口T
  • 类型sudo fdisk -l
  • 识别“Linux 文件系统”的 /dev/sdXX 设备名称
  • 输入sudo fsck -f /dev/sdXX,替换sdXX为您之前找到的数字
  • fsck如果有错误则重复命令
  • 类型reboot

相关内容