Power failure: file damage?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Power failure: file damage?
# 1  
Old 03-28-2014
Power failure: file damage?

~#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.
# 2  
Old 03-28-2014
Quote:
Originally Posted by raylier
But is it possible that there are damaged files I don't know of but can cause trouble later on?
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
This User Gave Thanks to bakunin For This Post:
# 3  
Old 03-28-2014
Quote:
Originally Posted by bakunin
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....
# 4  
Old 03-28-2014
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...
This User Gave Thanks to vbe For This Post:
# 5  
Old 03-28-2014
Quote:
Originally Posted by vbe
.
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.Smilie
# 6  
Old 03-28-2014
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:
Code:
mklost+found

at the mount point of that file system!
then go and look in the man pages why...
Best regards
# 7  
Old 03-28-2014
Quote:
Originally Posted by raylier
~#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.
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 /...
This User Gave Thanks to Corona688 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Failure of sftp send to log file

I want to transfer all details of sftp connection into a log file and spawn sftp $PCMSu@$FTP_LOC >> log_file is not working for me. Please suggest how to send the data to a log file that has all information if sftp connection is successful or not? Script that I am using: #!/usr/bin/expect... (7 Replies)
Discussion started by: Geeta Yadav
7 Replies

2. Solaris

After power failure, SunFireV240 with SOLARIS 5.9 cannot start

SUNW, Sun Fire V240 Spare Sun OS Release 5.9 After a power failure we try to start the server We have the following messages: Thanks for your assistance (7 Replies)
Discussion started by: doudou2012
7 Replies

3. UNIX for Dummies Questions & Answers

boot up failure unix sco after power failure

hi power went out. next day unix sco wont boot up error code 303. any help appreciated as we are clueless. (11 Replies)
Discussion started by: fredthayer
11 Replies

4. SCO

file system not getting mounted in read write mode after system power failure

After System power get failed File system is not getting mounted in read- write mode (1 Reply)
Discussion started by: gtkpmbpl
1 Replies

5. Shell Programming and Scripting

writting a shell script to delete damage files

hi, I have 100 files say File1.mp3, File2.mp3 .......file100.mp3 i found that File1.mp3 to File50.mp3 are damaged. I want to delete the damaged files from the directory using sed with regex how can i do this. thanks (5 Replies)
Discussion started by: pchangba
5 Replies

6. Solaris

Automatic reboot does not work after power failure

Hi all, I have a server SUN FUJITSU in solaris 10 ; result of uname -a is : SunOS MOBD1 5.10 Generic_118833-03 sun4us sparc FJSV,GPUZC-M I have configured the eeprom to auto-boot as usual and this automatic reboot does not work in case of power failure. I must type "boot" on the prompt "ok"... (5 Replies)
Discussion started by: aribault
5 Replies

7. UNIX for Dummies Questions & Answers

Restart on power failure

How do I configure my workstation (Solaris 9) to restart and perform any check disk automatically if there is a power failure? Thanks. (1 Reply)
Discussion started by: here2learn
1 Replies

8. UNIX for Advanced & Expert Users

Xstartup file failure - HELP !!

Hi, dear Experts ! I need some help, again. Earlier in my work I experienced that one script included in '/etc/dt/config/Xstartup' file caused some serious troubles. But this is another story. The point here is: I changed the script so that it worked again. But... After restart of... (3 Replies)
Discussion started by: DGoubine
3 Replies
Login or Register to Ask a Question