LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /dev/sda3: unexpected inconsistency; execute fsck manually. (https://www.linuxquestions.org/questions/linux-newbie-8/dev-sda3-unexpected-inconsistency%3B-execute-fsck-manually-4175504909/)

vienswuer 05-13-2014 09:56 PM

/dev/sda3: unexpected inconsistency; execute fsck manually.
 
I have three distros on three different partitions. I can perfectly boot and use Antergos and Manjaro, but not Sabayon. Whenever I try to start it I get this error. I am not sure what could have caused this, since I did only install several apps and then upgraded, nothing else. In fact, the system worked fine for a couple of days. Then for a month I booted Manjaro, and now when I go for Sabayon, this! http://imgur.com/mtlO5U5
Sabayon is hosted on sda5 but the problem seems to be in sda3 where I have /home. I do not want to lose data on /home, is fsck safe enough?
There are a few lines in Spanish that read as follows: /dev/sda3: contains a file system with errors...
/dev/sda3: unexpected inconsistency; execute fsck manually.
And so on.
I know there are several threads regarding this topic, but I am not sure about which command I should use.
Is this going to work??
umount /dev/sda3
e2fsck -fy /dev/sda3
Another friend suggested
e2fsck -v -y /dev/sda3

ondoho 05-14-2014 12:29 AM

open a terminal, type
Code:

man fsck
now read carefully what the options supplied by your friends mean.
check the file system first, without attempting any repairs.
i'm pretty sure it has to be unmounted for that. you might have to boot into recovery mode first.
if fsck (pretty much the same as e2fsck) finds errors, you can still consider repairing.

syg00 05-14-2014 01:11 AM

fsck is a filesystem tool. Not a file validation tool.
After you run it you will likely have a valid filesystem - but no guarantee on all the files. If you have no backup, you probably have no option but to run it and hope.

Do you use this /home partition on all distros ?.

vienswuer 05-14-2014 06:56 AM

Thanks for replying, so I assume you suggest making a back up "just in case" right? What I still cannot understand is in which way that e2fsck command could break my data, if I am not giving format to anything.

vienswuer 05-14-2014 07:03 AM

[QUOTE=syg00;5170470]fsck is a filesystem tool. Not a file validation tool.
After you run it you will likely have a valid filesystem - but no guarantee on all the files. If you have no backup, you probably have no option but to run it and hope.

Do you use this /home partition on all distros ?.[/QUOTE

Yes, I share /home between the three of them, with different users.

rknichols 05-14-2014 09:54 AM

Quote:

Originally Posted by vienswuer (Post 5170638)
What I still cannot understand is in which way that e2fsck command could break my data, if I am not giving format to anything.

e2fsck, especially if run with the fairly dangerous "-y" option, will do whatever it needs to do to make the filesystem structure consistent. That can include putting all of the files into the lost+found directory with the original names lost and replaced by numbers. Recovering from that can be virtually impossible.

Most errors would not provoke an action that drastic, but without knowing just what the "unexpected inconsistency" was, no one can say. Running e2fsck with the "-n" option to assess the damage can be useful. With the filesystem damaged, it's too late to do any sort of structured backup, but if your data is important you should save an exact image of the whole filesystem before attempting repair.

vienswuer 05-14-2014 02:46 PM

The system (sda3=/home) is "damaged" for Sabayon, not for Manjaro nor for Antergos. That partition is working perfectly for those two distros, so I am not sure whether to perform an e2fsck check or not. I read http://aplawrence.com/Unixart/fear-of-fsck.html and now I am reeeeally afraid of screwing everything up. I was able to backup everything in /home, but as I previously stated, I am not sure if I want to take the risk of messing things up just because of Sabayon, when the other distros are still working out of the box. The HD is brand new, and so are my installed distros.

rknichols 05-14-2014 02:51 PM

It is certainly safe to run e2fsck with the "-n" option to see what it is complaining about but not let it try to fix anything.

vienswuer 05-14-2014 03:05 PM

I was digging a little more on the reason why I am getting this error message, and I came across the answer: I badly switched off my system many times. I had to, firefox kept freezing and freezing for a whole week. Now it doesn't anymore. At the moment, I am considering installing a distro (to replace Sabayon) that won't care if I shut down improperly (like Manjaro and Antergos). I want a linux system similar to those two I mention that will just boot, for God's sake! haha. I am not asking for an impossible fact!

vienswuer 05-14-2014 03:06 PM

Quote:

Originally Posted by rknichols (Post 5170929)
It is certainly safe to run e2fsck with the "-n" option to see what it is complaining about but not let it try to fix anything.

Ok, I am going to try that in a couple of hours.

rknichols 05-14-2014 07:59 PM

You probably will need "-f" also, else fsck will just report that the filesystem appears to have been cleanly unmounted. Hopefully, you knew that.

vienswuer 05-16-2014 01:02 PM

Thanks to all of you who showed some interest on my thread. Finally, I did an "e2fsck -f -n /dev/sda3" but wasn't really helpful since I didn't understand a thing :p So, I tried "e2fsck -fy /dev/sda3" Everything went just fine, after a minute or so I was booting Sabayon without any trouble as well as the other two distros. No data loss at all.

Just in case smbdy reads this, take a look at http://linux.101hacks.com/unix/e2fsck/ where all variables for e2fsck command are explained (-n -f -v -y etc...) I learned a lot from there.


All times are GMT -5. The time now is 06:34 PM.