Score:3

Mount filesystem with "structure needs cleaning" on ext4

in flag

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?

user10489 avatar
nc flag
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?
in flag
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?
shodanshok avatar
ca flag
Can you issue `fsck.ext4` *without* the `-c` option and report back any output?
in flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.