I just switched from Elementary to Manjaro (the latest KDE min ISO, encrypted disk). In Elementary OS I used to shutdown my machine by running shutdown now from a terminal. Unfortunately, when I tried doing so in my Manjaro installation the file-system got corrupted somehow (?), as I’ll try to explain in the following.
After shutting down the computer with shutdown, the machine wasn’t able to open a tty due to errors in a mapper file (I don’t quite remember what the error message was, but it was something like that) and it asked me to run fsck /dev/mapper/luks-4db6e442-011a-4887-9170-46d9191ebb5b manually. I then run fsck and answered every question it asked with the default answer.
After that, the machine was able to open the tty. However, now the (hard drive) file-system appears to be broken: when I try reading/writing/stating certain files I get the error message “Structure needs cleaning”, which I understand as an indicative of file-system corruption.
Could anyone help me figure out what’s going on/how to fix it? I don’t mind reinstalling Manjaro btw, but I would prefer an alternative solution. If there’s some technical information you need, please ask me (I just don’t know what that information might be).
It’s also worth noting that the file-system corruption issues started in Elementary: I first tried installing Manjaro but it didn’t work out (the ISO wouldn’t boot because I unknowingly had Secure Boot enabled). I then gave up on installing it. However, after the failed installation attempt, the file-system in Elementary got corrupted too! (I was getting the same “Structure needs cleaning” error)
I then tried installing Manjaro again and figured out what was wrong, but the corruption persists somehow.
Update: I tried @GaVenga’s solution and it worked flawlessly! Didn’t even need to reinstall anything. There was some data loss (mainly the files that “needed cleaning”), but nothing of significance as far as I can tell. @GaVenga Thanks for your help!
Yes, I’m concerned about that too. But it is important to remember that the FS only got corrupted in Elementary after I tried (and failed) booting into Manjaro. Could it be the case that the unsuccessful installation attempt messed something up (and the subsequent successful install did not fix it for some reason)?
More information on the unsuccessful attempt: when I selected the USB drive (the one with the ISO burned in) in the BIOS boot device selector I got a black screen for a fraction of a second and then the BIOS boot device selector came up again. I didn’t even got to the installer at first. After this, I started experimenting the corruption issues I described in Elementary.
I later figured out this happened because I had Secure Boot enabled and the Manjaro ISOs are not signed. I imagine trying to boot from the USB drive with Secure Boot enabled caused the issue, thought I don’t have sufficient knowledge to confirm or deny that this is the case. I guess we’ll see whether or not my theory has some merit (I’ll be back here if my system gets unstable again in the near future).
This might be the reason for your corrupted files - if you ran fsck on the device while it was still encrypted (the encrypted container not yet opened).
You have to open the container/decrypt the device or partition before you can work on the filesystem on it.
… it’s uncertain to me what happened …
I managed to do it. Somehow.
I could describe to you how it happened if you are interested.
But that’s how I know.
I lost all my backups. It was a 2 TB USB connected spinning disk which died soon after.
But maybe I was able to run fsck,
which was set to correct errors it found without asking each time,
because the drive was already malfunctioning intermittently.
The one thing I have not yet done is to open the case (it has to be destoyed to do that) and trying to connect the drive by some other way.
But with that many writes - it found and “corrected” a lot of “errors” - I’ts unlikely that I’ll be able to open the encrypted container ever again.