将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 55|回复: 1
收起左侧

Fix “ext4-fs error ext4_lookup deleted inode referenced” error in Ubuntu

[复制链接]
发表于 2022-10-30 00:11:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
The other day I started my Ubuntu virtual machine and encountered with the following error.
ext4-fs error ext4_lookup deleted inode referenced
) A' j9 _2 q9 H" }! t  Y+ v! i
It didn't boot and kept showing me the above error continuously. After a couple web searches, I found the solution for the above error is so obvious. Yes, I guess the file system EXT4 for the partition /dev/sda1 is corrupted. So, I decided to log in to the single user mode and perform manual file system check.
$ ^. b3 j) j- f% d0 N

3 t% Q/ a" N+ a8 Q; p) u: }1 O
2 u6 T/ b, G: @, N' Z4 ^
To log in to the single user mode, reboot your system and select Advanced options for Ubuntu from the GRUB boot menu.
Check the following screenshot.

: U6 H  Y' S) d& e9 Y8 H0 W
Then, select Recovery mode.

; i" n+ ?! q% A" e+ x0 A
On latest Ubuntu versions, you can log in to the single user mode as described in the following link.

At the single user mode prompt, run:
fsck /dev/sda1
+ g- a, o0 G3 J
You'll be now asked to answer a couple of questions. Type "Y" until you get the problem solved.
6 a3 T# q1 I2 z
                               
登录/注册后可看大图
Fix "ext4-fs error ext4_lookup deleted inode referenced" error in Ubuntu
2 {" j$ b/ S3 C/ H, h
Finally, you'll see the FILE SYSTEM WAS MODIFIED message. Type reboot and press ENTER.
8 R! u) ]) l3 o9 N# i% @; `$ n
That's it. Now, the system will boot without any problem. Be mindful that some of your files might be lost already. If you have anything important on your hard drive, connect your hard drive as secondary hdd in any system and do the backup before running the fsck command. Also note that this method will not work if your hard drive is already dead or nearly in dead condition. Keeping an external backup is always a recommended.
Thanks for stopping by!

% ^& m* A: s$ k7 P2 i
4 i7 Y3 d0 y$ q: `
 楼主| 发表于 2022-10-30 00:12:31 | 显示全部楼层
解决EXT4-fs error (device dm-0): ext4_lookup 问题
$ v& V& k1 ~- E6 ~2019年1月8日 作者 sharpbai
- |. U6 W: w, o, P5 [6 Z+ a; l问题9 B8 X6 k7 X1 C" j+ x" K
定期检查家用存储服务器的状态,发现dmesg输出信息中包含着和存储相关的报错信息
3 T: Y, x+ m8 l$ Z$ W$ _$ p
( t+ q( h$ E' I4 x
, U. B1 y2 p- u# w, c( \[2320875.914609] md: data-check of RAID array md0
; T) o0 l  i% V. A! B& K[2340593.337728] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm updatedb.mlocat: deleted inode referenced: 11) W( C1 H0 a- c+ p, J
[2365918.220935] EXT4-fs (dm-0): error count since last fsck: 27
( c7 J) a3 H- w8 m' D9 A[2365918.220942] EXT4-fs (dm-0): initial error at time 1544633747: ext4_lookup:1575: inode 2, ^5 A% U1 X2 V/ J
[2365918.220948] EXT4-fs (dm-0): last error at time 1546727139: ext4_lookup:1575: inode 25 M3 I, C' b9 V  Z2 J' n/ q/ J
[2403445.347062] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm ls: deleted inode referenced: 114 P9 t7 o. A% i( l; v
[2403446.810209] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm ls: deleted inode referenced: 12$ N! V' j: l% z- Q- ]) t
9 M( m! R. S9 k* g  m
1
& Z. s, R4 @& a7 k9 Q2) w+ d- ^6 Y. J. D( }- p
3
. m& a+ {; E$ {6 z' B42 Z/ [( G9 ^/ X+ f) R; O! R0 w3 g
55 h0 |; X( I$ Q8 P1 @5 @
6
+ b6 I6 z  j0 v7
4 U/ z+ r  h0 A6 R3 |$ H8
, e0 I+ j% J, k5 q9 U[2320875.914609] md: data-check of RAID array md0) o5 z  @( a" h" r! C: q& p$ t
[2340593.337728] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm updatedb.mlocat: deleted inode referenced: 11
0 _# V4 n* y# _+ x2 w/ U[2365918.220935] EXT4-fs (dm-0): error count since last fsck: 27; ?  f0 f+ b. [' F
[2365918.220942] EXT4-fs (dm-0): initial error at time 1544633747: ext4_lookup:1575: inode 2
- H6 U; {, c' W  `1 q9 b/ ?% y  ~[2365918.220948] EXT4-fs (dm-0): last error at time 1546727139: ext4_lookup:1575: inode 2
5 g' _4 i8 S$ R( ~' {* y[2403445.347062] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm ls: deleted inode referenced: 11
3 d" j& A/ L- d% I1 [- @[2403446.810209] EXT4-fs error (device dm-0): ext4_lookup:1575: inode #2: comm ls: deleted inode referenced: 12
# x7 F. s' h8 c. B* {: [0 k
7 e$ {! t! B$ a5 l7 p! g; U- s排查
2 I( ?, b( n0 u$ y3 v8 m# I存储问题不可小视。首先要确定下问题是什么。看起来是ext4文件系统存在文件节点错误,而且一直没有修复。接下来要确定到底是哪个设备出现了问题。通过日志看到是dm-0设备。但是dm-0设备是哪个存储设备呢?  o! I* f+ L0 `- l

9 V3 O2 x' V2 |. b3 h经过查找,得知通过dmsetup ls可以得知device mapper设备与存储卷的对应关系。通过输出卷的名字,得知是搭建的软RAID1设备/dev/md0所对应的存储卷。  A4 Q; S# ^  Z* n! k+ A& x& A

$ p0 V$ c6 F( W首先检查RAID1阵列是否存在问题,通过运行cat /proc/mdstat,发现阵列在重新检查中,并未出现不同步或降级问题。于是可以确认问题出在ext4文件系统本身。5 t, i8 Q! l2 w. i, P

  o) c* E6 [$ e. M8 `5 R解决
, V9 L: ^9 Q2 N/ J; l对于ext4分区文件系统中文件节点的错误,fsck一般可以解决。于是接下来首先umount问题卷,接下来fsck /dev/md0,一路按y确认修复操作。再通过mount命令挂载,等待了30分钟后,dmesg不再有文件系统错误出现,问题解决。' O: {; P! z' N! M3 i' q

2 p, E5 g5 k+ a( V4 X7 ?复盘  t* S: }2 q* a% _4 h# R& ^
好端端的ext4文件系统怎么就出现错误了呢。分析了下原因,应该有两点。一点是/dev/md0这个RAID1阵列在前段时间出现了其中一块盘跪掉然后替换的情况,期间出现了几次强制断电重启,可能因此留下了文件系统错误。& s- Y3 d7 S9 l# I3 b$ |
6 M# o- G  A0 o% t% B6 Z& k
另外一点,由于这个RAID1阵列并非系统内置设备,为了防止系统不正常启动,所以挂载动作没有放在/etc/fstab中,而是从启动命令中添加了挂载命令语句。两者的差别在于,默认情况下,通过fstab挂载的设备会首先运行fsck检查,再挂载,因此每次一有小问题就会修复,问题不会累积扩大。但是手工挂载并没有检查文件系统,就更容易出问题。( J" z) l5 s5 _7 A$ m3 y

4 _+ F" I/ d/ a6 B' g  d预防( l% B$ q& ?2 {' K
所以接下来又做了一点,在系统启动的挂载脚本执行之前,添加了一行/sbin/fsck -a UUID=xxxxxxxxxxx,这样每次就会先自动检查磁盘,再挂载,防止问题发生。
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2022-12-10 11:06 , Processed in 0.043223 second(s), 22 queries .

Powered by LR.LINUX.cloud bbs168x X3.2 Licensed

© 2012-2022 Comsenz Inc.

快速回复 返回顶部 返回列表