AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题

问题[fsck](unix)

Martin Hope
user1156544
Asked: 2022-04-25 04:20:20 +0800 CST

修复了文件系统错误

  • 0

当我突然意识到我的所有文件都被标记为只读时,我正在使用我的虚拟机。我觉得很奇怪,所以我重新启动,然后我被提示进入“BusyBox”。由于某种未知原因,文件系统发生了错误。

我fcsk如下图所示运行。理论上,它修复了不同的错误。

由于我不完全了解所做的fcsk事情,并且根据我之前在 Windows 修复其文件系统方面的经验,我现在对文件系统是否真的“修复”或是否存在损坏的文件有点怀疑。

  • 我可以相信修复过程吗?
  • 有没有一种方法可以检查所有数据是否正常,而不必一个一个打开文件?
  • 当发生如下图所示的错误时,会对驱动器中的实际数据产生什么影响?我可以期待部分文件损坏吗?完整的文件损坏?

fcsk


一些单独的错误消息:

File /var/log/journal/d74933508486479e9b07e83b9a036776/system.journal corrupted or uncleanly shut down, renaming and replacing.
pulseaudio[815]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
pulseaudio[815]: Most likely this is a bug in the ALSA driver 'snd_ens1371'. Please report this issue to the ALSA developers.
pulseaudio[815]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
lightdm[931]: gkr-pam: unable to locate daemon control file
dbus-daemon[1035]: writing oom_score_adj error: Permission denied
colord[1570]: failed to get edid data: EDID length is too small
udisksd[1636]: failed to load module mdraid: libbd_mdraid.so.2: cannot open shared object file: No such file or directory
udisksd[1636]: Failed to load the 'mdraid' libblockdev plugin
udisksd[1636]: Error probing device: Error sending ATA command IDENTIFY PACKET DEVICE to '/dev/sr0': ATA command failed: error=0x01 count=0x02 status=0x50 (g-io-error-quark, 0)
pulseaudio[953]: X11 I/O error handler called
pulseaudio[953]: X11 I/O error exit handler called, preparing to tear down X11 modules
systemd[936]: xfce4-notifyd.service: Main process exited, code=exited, status=1/FAILURE
systemd[936]: xfce4-notifyd.service: Failed with result 'exit-code'.
kernel: button: module verification failed: signature and/or required key missing - tainting kernel
input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
piix4_smbus 0000:00:07.3: SMBus Host Controller not enabled!
sd 2:0:0:0: [sda] 167772160 512-byte logical blocks: (85.9 GB/80.0 GiB)
kernel: sd 2:0:0:0: [sda] Write Protect is off
kernel: sd 2:0:0:0: [sda] Mode Sense: 61 00 00 00
kernel: sd 2:0:0:0: [sda] Cache data unavailable
kernel: sd 2:0:0:0: [sda] Assuming drive cache: write through
systemd[1]: File System Check on Root Device was skipped because of a failed condition check (ConditionPathExists=!/run/initramfs/fsck-root).
systemd[1]: Starting Journal Service...
systemd[1]: Starting Load Kernel Modules...
kernel: fuse: init (API version 7.34)
systemd[1]: Starting Remount Root and Kernel File Systems...
systemd[1]: Repartition Root Disk was skipped because all trigger condition checks failed.
systemd[1]: Starting Coldplug All udev Devices...
systemd[1]: Mounted Huge Pages File System.
systemd[1]: Mounted POSIX Message Queue File System.
systemd[1]: Mounted Kernel Debug File System.
kernel: EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro. Quota mode: none.
filesystems fsck
  • 1 个回答
  • 337 Views
Martin Hope
Vlastimil Burián
Asked: 2019-12-28 23:22:49 +0800 CST

*** /dev/sda1 将在下次重新启动时检查错误 *** 但它永远不会;补救?

  • 0

系统:Linux Mint 19 "Tara" - Cinnamon (64-bit),基于 Ubuntu 18.04,内核5.3.0-24-generic


问题持续时间:1 个月。

问题描述:由于这台电脑在我干预之前出现故障,所以每次我ssh到这台机器时,我都会收到这样的信息,这并不奇怪:

*** /dev/sda1 will be checked for errors at next reboot ***


尽管如此,在/etc/fstab(手册页)中我确实有1文件系统检查:

UUID=03b1e8ee-9ad8-4afa-a4ca-xxxxxxxxxxxx  /  ext4  errors=remount-ro  0  1

尽管在/etc/default/grub(手册页)中检查是强制的:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fsck.mode=force fsck.repair=yes"

我还需要做什么才能真正强制检查?

linux-mint fsck
  • 1 个回答
  • 994 Views
Martin Hope
Enter Display Name Here
Asked: 2019-09-25 20:56:23 +0800 CST

有没有办法从 lost+found 中自动恢复系统文件

  • 0

我正在运行 Debian Buster,但根分区的文件系统不知从哪里损坏了。我没有做任何不寻常的事情,基本上只是上网,在某些时候我发现根分区被重新安装为只读。

我尝试重新启动,但 grub 启动到一个最小的 shell 而不是它通常的菜单。所以我从我的 Debian USB 记忆棒启动进入救援模式,然后 fsck 根和 efi 分区,发现了很多错误,但似乎都已成功修复。Badblocks 没有发现任何问题,而且硬盘驱动器看起来还不错(没有奇怪的噪音或类似的东西)。

Grub 又可以工作了,但是当我尝试以正常或恢复模式启动 Debian 时,它内核崩溃,说它找不到 libseccomp.so.2。然后我记得如果 fsck 无法确定文件的位置,它会将文件放入 lost+found 中。

那里有很多文件。有没有办法自动从那里恢复所有系统文件?还是我应该格式化并重新安装?

编辑:SMART检查的结果

# smartctl -HA -f brief -l xerror,error /dev/sda
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.19.34-1-lts] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     PO-R--   100   100   050    -    0
  2 Throughput_Performance  P-S---   100   100   050    -    0
  3 Spin_Up_Time            POS--K   100   100   001    -    1712
  4 Start_Stop_Count        -O--CK   100   100   000    -    4003
  5 Reallocated_Sector_Ct   PO--CK   100   100   050    -    0
  7 Seek_Error_Rate         PO-R--   100   100   050    -    0
  8 Seek_Time_Performance   P-S---   100   100   050    -    0
  9 Power_On_Hours          -O--CK   042   042   000    -    23297
 10 Spin_Retry_Count        PO--CK   179   100   030    -    0
 12 Power_Cycle_Count       -O--CK   100   100   000    -    3471
191 G-Sense_Error_Rate      -O--CK   100   100   000    -    3116
192 Power-Off_Retract_Count -O--CK   100   100   000    -    73
193 Load_Cycle_Count        -O--CK   061   061   000    -    392741
194 Temperature_Celsius     -O---K   100   100   000    -    36 (Min/Max 8/48)
196 Reallocated_Event_Count -O--CK   100   100   000    -    0
197 Current_Pending_Sector  -O--CK   100   100   000    -    0
198 Offline_Uncorrectable   ----CK   100   100   000    -    0
199 UDMA_CRC_Error_Count    -O--CK   200   200   000    -    0
220 Disk_Shift              -O----   100   100   000    -    0
222 Loaded_Hours            -O--CK   052   052   000    -    19435
223 Load_Retry_Count        -O--CK   100   100   000    -    0
224 Load_Friction           -O---K   100   100   000    -    0
226 Load-in_Time            -OS--K   100   100   000    -    274
240 Head_Flying_Hours       P-----   100   100   001    -    0
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning

SMART Extended Comprehensive Error Log Version: 1 (64 sectors)
No Errors Logged
fsck
  • 1 个回答
  • 1080 Views
Martin Hope
user3840170
Asked: 2019-08-23 08:25:33 +0800 CST

fsck 退出状态“系统应该重新启动”

  • 0

Linux 上的 fsck(8) 联机帮助页包括以下退出代码表:

   The exit code returned by fsck is the sum of the following conditions:

          0      No errors
          1      Filesystem errors corrected
          2      System should be rebooted
          4      Filesystem errors left uncorrected
          8      Operational error
          16     Usage or syntax error
          32     Checking canceled by user request
          128    Shared-library error    

退出代码 2 已分配给“系统应重新启动”,因此我们可以假设它有某种用途。然而,原则上fsck可以在检查某种对系统操作根本不重要的外部拇指驱动器后返回此退出代码。像这样的非必要文件系统中的错误需要重新启动似乎很荒谬,特别是如果文件系统仅被fsck.

“系统应该重新启动”退出代码实际上是什么意思?

fsck exit-status
  • 2 个回答
  • 852 Views
Martin Hope
Larry Cai
Asked: 2019-06-15 23:34:31 +0800 CST

如何清理和重新启动从 LVM 组中提取的 HDD(显示坏的超级块)?

  • -2

去年我有 2 个 4TB 硬盘驱动器被放在一个 LVM 组中,由于安装 nextcloud 的巨大问题,最终没有真正使用这个服务器。在某些时候它开始给我启动问题,所以我删除了 LVM 卷和组。

最近我在这个系统上干净地重新安装了 Ubuntu 18.04,但无法让这些 HDD 再次在 LVM2 中工作。我正在使用 KVPM 使它们成为 LVM2 PV,然后是 Group 和 Volume。我无法将它们安装为最后一步。

sudo mke2fs -n /dev/mapper/lvmgroup-lvmvol
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 1953507328 4k blocks and 244191232 inodes
Filesystem UUID: 278308bd-878e-4dde-8bac-420ddb858636
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

一些指南建议 fsck 可以清除这些块:

$ sudo e2fsck -b 32768 /dev/lvmVolGroup/lvmVGVol
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/lvmVolGroup/lvmVGVol

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/lvmVolGroup/lvmVGVol

但是我已经尝试了很多列出的坏块,它们都只是抱怨 8193 和 32768。是的,我也尝试了这些确切的块,同样的消息。

所以我尝试删除/删除所有 LVM 步骤,并使用 gparted 完全重新格式化两个驱动器,然后重新开始。这不起作用,我仍然遇到完全相同的问题。

上次有一些数据传输到 LVM 以测试它是否正常工作,我并不真正关心保留任何现有数据,因为我还有其他备份。我只需要 LVM 再次起作用。驱动器本身应该仍然可以工作,因为它们是全新购买并单独测试的,然后就留在了已关闭半年的系统中。

有谁知道我能做什么?

fsck lvm
  • 1 个回答
  • 397 Views
Martin Hope
user151785
Asked: 2019-03-27 22:14:37 +0800 CST

超级块中的错误幻数:dm-crypt 设备

  • 1

我有一个使用 dm-crypt 加密的设备。这是我在笔记本电脑上使用的迷你 SD 卡。

我最近遇到了一些笔记本电脑死机的问题,在日记中出现了这些消息:

Mar 20 17:18:30 gorgonzola kernel: EXT4-fs (dm-0): warning: mounting fs with errors, running e2fsck is recommended
Mar 20 17:18:30 gorgonzola kernel: EXT4-fs (dm-0): recovery complete
Mar 20 17:18:30 gorgonzola kernel: EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
...
Mar 20 17:23:30 gorgonzola kernel: EXT4-fs (dm-0): error count since last fsck: 84
Mar 20 17:23:30 gorgonzola kernel: EXT4-fs (dm-0): initial error at time 1505289981: ext4_journal_check_start:60
Mar 20 17:23:30 gorgonzola kernel: EXT4-fs (dm-0): last error at time 1551543757: ext4_reserve_inode_write:5903: inode 1054920: block 4194732

我曾尝试运行 fsck,但出现此错误:

Bad magic number in super-block

在尝试解决此问题之前,我只想确保我确实能够在 dm 加密的驱动器上运行 fsck。还是预期会出现此错误?我之所以感到困惑,是因为我可以很好地安装这个设备。出于所有意图和目的,该驱动器运行良好。它安装,它可以读取和写入所有数据......唯一的问题是我在启动时收到此错误。那么超级块真的有问题吗?

fsck dm-crypt
  • 1 个回答
  • 1180 Views
Martin Hope
sourcejedi
Asked: 2019-01-13 06:41:06 +0800 CST

如何显示来自所有“fsck”单元的日志消息

  • 2

系统管理员是否有合理的程序来查看所有fsck消息?


在我当前的 Fedora 29 系统上,我可以查看fsck当前启动的所有消息,如下所示:

sudo journalctl -b /usr/lib/systemd/systemd-fsck

但是,这是一个假设fsck将消息写入stdout/的 hack stderr。它不允许fsck检测到它是从 systemd 运行的假设,并通过 syslog 或 journald 套接字发送日志消息,例如,以便为每个消息设置适当的“优先级”。

有没有一种更简洁的方法,即使有些人fsck将其日志消息直接发送到日志,也能奏效?

systemd fsck
  • 1 个回答
  • 330 Views
Martin Hope
yael
Asked: 2018-04-25 00:26:33 +0800 CST

是否可以运行 fsck 以仅查看已安装磁盘上的错误

  • 11

我们有 RedHat 7.2 操作系统。

/dev/sdc is mounted to /bla/appLO

是否可以fsck在已安装的磁盘上运行(不带umount /bla/appLO)并仅查看错误(如果存在)?

例子:

e2fsck -n /dev/sdc
e2fsck 1.42.9 (28-Dec-2013)
Warning!  /dev/sdc is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sdc: clean, 11/1310720 files, 126322/5242880 blocks

fsck -n即使安装了磁盘也会显示错误吗?

fsck disk
  • 1 个回答
  • 26744 Views
Martin Hope
Antonio Petricca
Asked: 2018-01-01 07:09:38 +0800 CST

回送设备的启动时 Fsck

  • 4

我发现无法通过文件中的标志fsck在启动时在回送设备上运行,也无法通过在安装回送设备时手动运行来完成此操作。fsckfstabfsck

是否有替代方法可以在启动时检查设备?

fsck fstab
  • 2 个回答
  • 997 Views
Martin Hope
warsong
Asked: 2017-12-11 12:36:16 +0800 CST

如何在加密的 LVM 分区上运行 fsck?

  • 2

我在 Fedora 27 上,我正在尝试对 SSD 进行 fsck,但 /forcefsck 之类的常见操作不起作用。

还尝试像这样设置我的 /etc/default/grub

GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.luks.uuid=luks-2ef8e9f4-a691-4007-91d1-04d34cb4dd4f rd.lvm.lv=fedora/swap rhgb quiet fsck.mode=force"
fsck
  • 2 个回答
  • 1448 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve