linux下挂载磁盘报错“Structure needs cleaning”


linux下挂载磁盘报错“Structure needs cleaning”。系统之前一直正常,突然掉盘后无法挂载,尝试手动挂载后报错:

root@pbs:~# mount -a
mount: /mnt/data/1: mount(2) system call failed: Structure needs cleaning.

对于重装linux系统或者掉盘的用户常常遭遇挂载磁盘报Structure needs cleaning的问题。

首先查看磁盘是什么文件系统?

root@pbs:~# blkid
/dev/sda2: UUID="C350-74AC" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2b815f26-9d57-4576-bd46-c2ac96a061a4"
/dev/sda3: UUID="NvwYCd-nRPj-MZC3-b1ab-5189-H8d4-L4GC54" TYPE="LVM2_member" PARTUUID="f67d1946-e13d-46a0-828c-e693c74f1f05"
/dev/mapper/pbs-swap: UUID="a466b56a-75a8-482a-a082-5c9edf8aed69" TYPE="swap"
/dev/mapper/pbs-root: UUID="b4e03bb0-4a97-4f56-a71b-726d62bccad5" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda1: PARTUUID="c6c5beb9-52ca-4139-8575-4dede116105b"
/dev/sdc1: UUID="8c6d2538-3673-4733-afc2-3fbce8cf06f4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d3c972c3-9ad6-5f45-af24-bbc797a35830"
/dev/sdb1: UUID="e83baf39-e63b-4a8e-888e-44b8b0eb6065" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="38c59ede-7835-4c57-8579-f58f1714811f"

ext4文件系统,使用命令 fsck.ext4 /dev/sdb1修复,

如果是xfs文件系统,使用命令 xfs_repair -L /dev/sdb1修复,

e2fsck 1.46.5 (30-Dec-2021)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
/dev/sdb1: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Inode 1048961 seems to contain garbage.  Clear<y>? yes
Inode 1048962 seems to contain garbage.  Clear<y>? yes
Inode 1048963 seems to contain garbage.  Clear<y>? yes
Inode 1048964 seems to contain garbage.  Clear<y>? yes
Inode 1048965 seems to contain garbage.  Clear<y>? yes
Inode 1048966 seems to contain garbage.  Clear<y>? yes
Inode 1048967 seems to contain garbage.  Clear<y>? yes

一般情况修复后可正常挂载。如果修复后还是无法挂载,可能你就需要重新格盘

声明:初心|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - linux下挂载磁盘报错“Structure needs cleaning”


愿你勿忘初心,并从一而终