Fedora 30 - dnf install/update error - Structure needs cleaning

I have just realised that I cannot install or update any package in my Fedora 30 PC.
To be specific, every time I try “dnf install” or “dnf update”, I’m getting the following error:

Error: Cannot create directory "/var/cache/dnf/updates-modular-783da5de2e38c644/repodata": Structure needs cleaning

I checked the systemd journal, I found several errors like the following:

Απρ 03 22:21:24 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:21:25 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:21:25 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:21:25 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142399
Απρ 03 22:21:25 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142399
Απρ 03 22:21:25 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142396
Απρ 03 22:21:26 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142396
Απρ 03 22:21:26 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142393
Απρ 03 22:21:26 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142393
Απρ 03 22:21:26 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142397
Απρ 03 22:21:29 fedorahost kernel: EXT4-fs error: 63 callbacks suppressed
Απρ 03 22:21:29 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:21:29 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:21:29 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:22:20 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm ls: deleted inode referenced: 137270
Απρ 03 22:22:58 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142399
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142399
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142396
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142396
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142393
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142393
Απρ 03 22:23:00 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #137340: comm dnf: deleted inode referenced: 142397
Απρ 03 22:23:06 fedorahost kernel: EXT4-fs error: 63 callbacks suppressed
Απρ 03 22:23:06 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:23:06 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270
Απρ 03 22:23:06 fedorahost kernel: EXT4-fs error (device dm-1): ext4_lookup:1703: inode #1349: comm dnf: deleted inode referenced: 137270

Any help would be apreciated!

Hi @pjhavariotis,

File system errors? Looks like your root partition is in a bad shape
Boot Fedora from a live media (USB or DVD) and try the following on a terminal:

sudo fsck -N /dev/sdx
change x in sdx to the correct alphabet as per the root (/) partition on your machine.
See if the check detects errors and proposes fixes. If so, run the command again without -N and respond accordingly

Otherwise, you may need to rebuild your dnf cache. If you are keeping packages on the cache, back them up somewhere. Then do this:
sudo dnf clean all

then:
sudo dnf makecache

Then try the update again.

Hi @twohot,
FYI, I have already tried to rebuild my dnf cache, but in vain.
I’m getting the same error.

I’ll try the fsck command. I don’t think I have any other alternative!

Finally, I made it.
After booting from Fedora Live usb, I executed the following command in order to “see” my root and home partitions:
sudo vgchange --activate a
After that, I executed the following command in order to check for errors:
fsck.ext4 -vf /dev/mapper/fedora-root
fsck.ext4 -vf /dev/mapper/fedora-home

I’m glad it worked out.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.