~#hello -all,
Many UNIX/Linux/BSD/etc books warn about turn off the puter without a proper shutdown. This can damage files which are open at that moment. Seems logical to me. My question is.. does the system warn you when there are damaged files when the system is up again? I had a power failure this week (twice) while my Linux and freeBSD servers were running. (for study so no power backup). Everything works fine. But is it possible that there are damaged files I don't know of but can cause trouble later on? Thanks for reading.
Yes, there is a very remote chance of that having happened, but it is not at all likely.
Most Unix systems today use a "journaling filesystem" of some sort or other and these are quite robust when it comes to unexpected power loss.
At the startup a system will notice that a filesystem was not properly closed during the shutdown before in such a case and initiate a filesystem check. While older FSes would have a (ever diminishing) chance of such a check not being successful (SUNs sfs, for instance, was famous for the high rate of this happening) or some files being beyond repair modern FSes - and especially journaling FSes - run a very low risk in this regard. Usually you see something like "replaying log" during startup and the time that takes is barely noticeable.
I hope this helps.
bakunin
Thanks. I wil run a fsck manually....
The system at reboot will have done so (fsck that is ) ... If you have looked at the syslogs, you may have seen messages about abrupt shutdown and so expected flags on the filesystems arent so the system will do an fsck...
A quick check would be to look if you have anything in the lost+found directories of each filesystem, nothing = you are OK
That said UPS are cheap now and if you are runing servers, its far from being silly to invest in such device...
The Ubuntu L+F is empty, and the FreeBSD doesn't have a L+F at all in / (yet). So I guess all is well for now. You're right about the UPS. Even for study only set up.![]()
All filsystems have a lost+found directory! If not you are looking for trouble...
So i suggest you correct that fact ASAP: as root type:
mklost+found
at the mount point of that file system!
then go and look in the man pages why...
Best regards
They will have checked and repaired themselves. It can tell, because it leaves a flag for itself to check whether the filesystem was unmounted safely or not. Your system would refuse to boot if it couldn't repair them.
The damage isn't completely random. It happens when a filesystem operation was left half-finished because of a power-failure or other crash. This means that, if anything happened, things(files or folders) which were being often modified are the most likely to be damaged, truncated, or missing.
This also means that a partition which almost never gets written to is very unlikely to be damaged by a power outage. This is one good reason to split up your system into partitions instead of lumping everything into /...
Well.. this is what the FreeBSD man says about fsck finding issues:
"Orphaned files and directories (allocated but unreferenced) are, with the operator's concurrence, reconnected by placing them in the lost+found directory. The name assigned is the inode number. If the lost+found directory does not exist, it is created." (Source: freeBSD.org)
I think I go for your option though..thanks.