5

There is a created years ago(and many time resized from that times) filesystem with ext4. After power failure it stop to mount. When i try to mount it manually i receive an error:

# mount /dev/space/vservershosting-vs /mnt/
mount: /mnt: mount(2) system call failed: Structure needs cleaning.

In dmesg there is more information:

[32618.800854] EXT4-fs error (device dm-44): __ext4_iget:5080: inode #2: block 1953722220: comm mount: invalid block
[32619.264574] EXT4-fs (dm-44): get root inode failed
[32619.264633] EXT4-fs (dm-44): mount failed

fsck pass without any repairing:

# fsck.ext4 -c -f -v /dev/space/vservershosting-vs
e2fsck 1.44.5 (15-Dec-2018)
Checking for bad blocks (read-only test): done                                                 
/dev/space/vservershosting-vs: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure                                           
Pass 3: Checking directory connectivity                                        
Pass 4: Checking reference counts                                              
Pass 5: Checking group summary information                                     
                                                                               
/dev/space/vservershosting-vs: ***** FILE SYSTEM WAS MODIFIED *****

     1551308 inodes used (7.89%, out of 19660800)
      115052 non-contiguous files (7.4%)
         861 non-contiguous directories (0.1%)
             # of inodes with ind/dind/tind blocks: 48107/1394/6
             Extent depth histogram: 988992/12798/13
    67929516 blocks used (86.38%, out of 78643200)
           0 bad blocks
          16 large files

     1377888 regular files
      143712 directories
          74 character device files
          25 block device files
          10 fifos
         810 links
       29496 symbolic links (29045 fast symbolic links)
          94 sockets
------------
     1552109 files

(the same output with current version of fsck)

When i try to mount - it fail. After that - fsck "fix" fs(second run fsck don't do anything). But fs is still not fixed - when i try to mount it it fail.

root@undefine-ThinkPad-T470p:~# fsck.ext4 -v /dev/sdb1
e2fsck 1.45.5 (07-Jan-2020)
/dev/sdb1 zawiera system plików z błędami, wymuszono sprawdzenie.
Przebieg 1: Sprawdzanie i-węzłów, bloków i rozmiarów
Przebieg 2: Sprawdzanie struktury katalogów
Przebieg 3: Sprawdzanie łączności katalogów
Przebieg 4: Sprawdzanie liczników odwołań
Przebieg 5: Sprawdzanie sumarycznych informacji o grupach
 
     1551308 użytych i-węzłów (7.89% z 19660800)
      115052 pliki nieciągłe (7.4%)
         861 katalogów nieciągłych (0.1%)
             liczba i-węzłów z blokami ind/dind/tind: 48107/1394/6
             Histogram głębokości ekstentów: 988992/12798/13
    67929516 użytych bloków (86.38% z 78643200)
           0 wadliwych bloków
          16 dużych plików
 
     1377888 zwykłych plików
      143712 katalogów
          74 pliki urządzeń znakowych
          25 plików urządzeń blokowych
          10 potoków
         810 dowiązań
       29496 dowiązań symbolicznych (29045 szybkich dowiązań symbolicznych)
          94 gniazda
------------
     1552109 plików
root@undefine-ThinkPad-T470p:~# fsck.ext4 -v /dev/sdb1
e2fsck 1.45.5 (07-Jan-2020)
/dev/sdb1: czysty, 1551308/19660800 plików, 67929516/78643200 bloków
root@undefine-ThinkPad-T470p:~# mount /dev/sdb1 /mnt/test/
mount: /mnt/test: wywołanie systemowe mount(2) nie powiodło się: Struktura wymaga wyczyszczenia.

I've tried to mount using alternative superblocks - the same error/result.

but- when i connect to volume using debugfs i see all important content (3 directories) in lost+found.

I can restore all content using debugfs and rdump command, but - how to mount/fix that volume?

undefine
  • 1,046
  • 9
  • 21
  • You should rerun fsck (possibly without `-c` on subsequent runs) until it does NOT say "filesystem was modified". However, I'm not sure why it didn't mount -- this makes me suspect cache corruption or something. Try rebooting? – user10489 Aug 14 '21 at 14:51
  • Reboot didn't help. I have'd run e2fsck many times with the same result. I suspect bug in ext4 implementation and corrupted 2(root) inode. but how to handle that? – undefine Aug 14 '21 at 17:26
  • Can you issue `fsck.ext4` *without* the `-c` option and report back any output? – shodanshok Aug 23 '21 at 22:30
  • 1
    yes. first run - "fix" something, second run show that fs is clean. But mounting show error(and mark fs dirty what mean that first run of fsck will fix it...). I've updated question with that three commands. Problem isn't important for me anymore - i've restored everything using rdump from debugfs. But i'm curious what happend here and how to fix that. – undefine Aug 24 '21 at 08:05

0 Answers0