/ dev / sda1:发现已损坏的孤立链接列表中的inode


16

突然,硬盘驱动器变为只读状态时,我通常使用Ubuntu 2015.04(带有ecryptfs加密的用户主目录)笔记本电脑。

我重新启动,现在卡在此了:

[    0.703206] ACPI PCC probe failed.
starting version 219
error: /dev/sdb: No medium found
error: /dev/sdb: No medium found
Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default or ^D to
try again to boot into default mode.
root@nico:~#

系统日志中有趣的部分:

-- Unit systemd-fsckd.service has begun starting up.
system-fsck[475]: /dev/sda1 contains a file system with errors, check forced.
kernel: ACPI warning: \_SB_.PCIO.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20141107/nsarguments-95)
kernel: ACPI warning: \_SB_.PCIO.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20141107/nsarguments-95)
kernel: thinkpad_acpi: EC reports that Thermal Table has changed
system-fsck[475]: /dev/sda1: Inodes that were part of a corrupted orphan linked list found.
system-fsck[475]: /dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
system-fsck[475]: (i.e., without -a or -p options)
system-fsck[475]: fsck failed with error code 4.
system-fsck[475]: Running request emergency.target/start/replace
systemd[1]: system-fsck-root.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start File System Check on Root Device
-- Subject: Unit system-fsck-root.service has failed

我不确定这是ACPI还是磁盘问题。我曾尝试将我的Lenovo Thinkpad T520更新到最新的BIOS,但它不能更好地启动。

如何解决此问题,或者如果磁盘快要死了,如何至少将数据从加密的主目录导出到外部驱动器?


8
它发现根文件系统出错。按照说的做,运行fsck /dev/sda1并以交互方式让它向您显示发现的错误,然后选择更正它们。一次不说一次就反复检查,看看有多少错误。如果它们似乎只用于那些不重要的文件(例如日志文件),请再次检查是。这可能会导致文件丢失,因此,如果您可以先复制分区再说一个USB设备,请先复制。
meuh

Answers:


20
  1. 在提示符下,键入fsck /dev/sda<number>并按Enter(<number>根据包含文件系统错误的目录从日志中查找)
  2. 输入y所有错误以修复它们
  3. exit

如何找到<number>
Kapil Yadav

Tyvm。有效。
维拉斯(Viraths)

1
@KapilYadav:您可以在抛出的错误日志中找到编号。例如,在OP的问题中,日志显示“ system-fsck[475]: /dev/sda1 contains a file system with errors, check forced.因此,数字为1
Rocky Inde

0

在终端

sudo -i (如果不是root用户,请跳过此步骤)

fdisk -l

寻找您的根驱动器。

我在树莓派中使用Kali Linux,所以我的外观看起来像是... mmcblk0p2而不是sdb1...看您的。

`umount /dev/mmcblk0p2`

fsck -y /dev/mmcblk0p2

poweroff


-1

我有同样的问题。我已经使用Win32DiskImager从正常运行的Raspbian SD卡创建了一个图像文件。当我运行pishrink时,该工具给了我“孤立的inode列表”错误。因此,我遵循了Rocky Inde的建议并执行了fsck。它遇到并修复了一些错误,所以我再次运行了pishrink,它起作用了!感谢Rock Inde。

如果您到此为止并且仍然对如何执行感到困惑,我已经创建了一个脚本,部分基于pishrink,以修复这些“孤立的inode”。您可以在以下位置查看脚本源

https://github.com/gmenezesg/fix_orphaned_inode_list

用法:

wget https://raw.githubusercontent.com/gmenezesg/fix_orphaned_inode_list/master/fix_orphaned_inode_list.sh

sudo chmod +x fix_orphaned_inode_list.sh

sudo ./fix_orphaned_inode_list.sh [imagefile.img]

脚本:

#!/bin/bash

function cleanup() {
  if losetup $loopback &>/dev/null; then
        if [ "$verbose_mode" = true ]; then
        echo "### Running cleanup ###"
        fi
        losetup -d "$loopback"
  fi
}

verbose_mode=false

while getopts ":v" opt; do
  case "${opt}" in
    v) verbose_mode=true ;;
    *) usage ;;
  esac
done
shift $((OPTIND-1))

usage() { echo "Usage: $0 [-v] imagefile.img"; exit -1; }

if [ "$verbose_mode" = true ]; then
echo "### Mapping arguments ###"
fi

img="$1"

if [ "$verbose_mode" = true ]; then
echo "### Usage checks ###"
fi

if [[ -z "$img" ]]; then
  usage
fi
if [[ ! -f "$img" ]]; then
  echo "ERROR: $img is not a file..."
  exit -2
fi
if (( EUID != 0 )); then
  echo "ERROR: You need to be running as root."
  exit -3
fi

echo "#Check that what we need is installed"
for command in parted losetup tune2fs md5sum e2fsck resize2fs; do
  which $command 2>&1 >/dev/null
  if (( $? != 0 )); then
    echo "ERROR: $command is not installed."
    exit -4
  fi
done

if [ "$verbose_mode" = true ]; then
echo "### Setting cleanup at script exit ###"
fi
trap cleanup ERR EXIT

beforesize=$(ls -lh "$img" | cut -d ' ' -f 5)
parted_output=$(parted -ms "$img" unit B print | tail -n 1)
partnum=$(echo "$parted_output" | cut -d ':' -f 1)
partstart=$(echo "$parted_output" | cut -d ':' -f 2 | tr -d 'B')
loopback=$(losetup -f --show -o $partstart "$img")
tune2fs_output=$(tune2fs -l "$loopback")
currentsize=$(echo "$tune2fs_output" | grep '^Block count:' | tr -d ' ' | cut -d ':' -f 2)
blocksize=$(echo "$tune2fs_output" | grep '^Block size:' | tr -d ' ' | cut -d ':' -f 2)

fsck -y "$loopback"
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.