fsck:对 /dev/md0 执行 fsck.ext4 时出现错误 2(没有此类文件或目录)

fsck:对 /dev/md0 执行 fsck.ext4 时出现错误 2(没有此类文件或目录)

我有一个 raid5,在意外断电后无法访问。

细节:

# cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] 
md0 : active raid5 sdd[3] sdc[1] sdb[0]
      3906766848 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
      bitmap: 0/15 pages [0KB], 65536KB chunk

unused devices: <none>


# /sbin/mdadm --misc --test /dev/md0
# echo $?
0


# /sbin/mdadm --misc --detail /dev/md0
/dev/md0:
           Version : 1.2
     Creation Time : Wed May 29 18:43:39 2019
        Raid Level : raid5
        Array Size : 3906766848 (3725.78 GiB 4000.53 GB)
     Used Dev Size : 1953383424 (1862.89 GiB 2000.26 GB)
      Raid Devices : 3
     Total Devices : 3
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Thu Mar 19 19:02:08 2020
             State : clean 
    Active Devices : 3
   Working Devices : 3
    Failed Devices : 0
     Spare Devices : 0

            Layout : left-symmetric
        Chunk Size : 512K

Consistency Policy : unknown

              Name : Serwer:0  (local to host Serwer)
              UUID : 84a16ed7:c54e6e9f:f3ae512c:413b3a28
            Events : 4368

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       3       8       48        2      active sync   /dev/sdd


# ls -l /dev/md0
brw-rw---- 1 root disk 9, 0 mar 19 19:00 /dev/md0

然而:

/sbin/fsck /dev/md0
fsck from util-linux 2.33.1
fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/md0


# mount /dev/md0 /media/storage/
mount: /media/storage: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.

答案1

/sbin/fsck /dev/md0/sbin失败,因为你的上没有PATH,所以fsck找不到fsck.ext4

直接运行/sbin/fsck.ext4可以工作,就像添加sbinPATH

PATH="${PATH}:/sbin" /sbin/fsck /dev/md0

答案2

使用/sbin/fsck.ext4 /dev/md0完成了工作。没想到/sbin/fsck /dev/md0会认不出FS。

相关内容