I had a problem with my RasPi and it couldn't boot to lxde. So I tried fsck /dev/mmcblk0p2 and it works again. However, my Apache cannot start anymore so I can't open localhost and phpmyadmin. The error is "cannot load /usr/lib/apache2/modules/mod_auth_basic.so". Do you have any idea how to fix it?
1 Answer
How did you do fsck? If you did it while system running (that means /dev/mmcblk0p2 mounted as /) you did it wrong. Linux filesystems should not be check/repair while mounted.
If you did check/repair filesystem while mounted maybe apache modules moved to /lost+found folder which is a linux special folder. You can search your file in /lost+found then move to original folder if you can find it. I suggest you backup your SD card, re-image with your system then restore your files.
From fsck manual :
Note that in general it is not safe to run e2fsck on mounted filesystems. The only exception is if the -n option is specified, and -c, -l, or -L options are not specified. However, even if it is safe to do so, the results printed by e2fsck are not valid if the filesystem is mounted. If e2fsck asks whether or not you should check a filesystem which is mounted, the only correct answer is ''no''. Only experts who really know what they are doing should consider answering this question in any other way.
-
My RasPi couldn't log in LXDE and stay at prompt. The reason was the root account was locked. So I did fsck /dev/mmcblk0p2, rebooted and it started working again exept apache. I tried to look at the lost+found folder but can't find any file there. Commented Sep 12, 2013 at 12:10
fsck
, even when done properly (with the fs unmounted) if the fs was in an inconsistent state to start with (which you imply it was). Whatfsck
does is fix the filesystem so that whatever can be recovered is, and so that there are no inconsistencies which might snowball into further corruption. Usually this puts everything to rights, but if a file is truly mucked then it will remain that way. So don't get into a habit of thinking, eg, that you can yank the plug and if there is a problem fsck will fix it. Probably, but it is not guaranteed.