Solved

recovering/finding data lost in a crash?

Posted on 2000-02-15
12
198 Views
Last Modified: 2010-04-20
I'm running Linux 2.2.10 with RT-Linux.
During a data acquisition task, my computer locked up and I had to do a hard reboot. When the computer came back
up, my data file that was open and being written to during the crash, another closed datafile, and the directory containing both datafiles were missing. i.e., directory newdata, which contains the files file1.dat and file2.dat was totally missing. (My application was in the middle of writing to file2.dat when the computer crashed). If it was just file2.dat that was missing, I wouldn't be totally surprised, but the fact that the main directory itself is missing really surprises me. Is it totally gone or is there a way that I can find it?
Thanks in advance! -Dave
0
Comment
Question by:djc2
12 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2523834
Look in the /tmp directory... If it's not there, it's gone... Sorry!
0
 
LVL 3

Expert Comment

by:RobWMartin
ID: 2523862
If there is any hope, this article may help:

http://www.linuxcare.com/viewpoints/tales/09-01-99.epl

If the system has been up and running for a while, it may be gone fer good.

Feel for ya.

Rob
0
 

Author Comment

by:djc2
ID: 2524572
OK, no luck so far. I followed RobWMartin's suggested link. From there
I found the ext2fs undeletion mini howto (specifically, the most relevant page:  www.linuxdoc.org/HOWTO/mini/Ext2fs-Undeletion-8.html)
I followed the instructions in there about detecting recently deleted inodes.
Unfortunately, no inodes show up as deleted on my hard disk device today. But, I guess that's not really a surprise, given that I didn't actually delete a file.

A bit of new info: there was also one other file that I edited today on the same partition prior to the crash. Turns out that now that file appears as it was prior to the edits and it is timestamped Feb 3, the last time I edited it. So,
it seems that the hard disk appears exactly as it was before I did _anything_ to it today. Is it possible that it wasn't sync'ed, or that some sort of table wasn't updated (I'm totally ignorant of this stuff, so I don't know how to even describe it.) Is it possible that the changes were made to the hard disk but some sort of master record wasn't updated to indicate that?
Maybe the results of the following are relevant (/dev/hdd1 is the partition with the missing files):

[root]# e2fsck -c -f -n /dev/hdd1
e2fsck 1.12, 9-Jul-98 for EXT2 FS 0.5b, 95/08/09
Checking for bad blocks (read-only test): done
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/hdd1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/hdd1: 12423/5003712 files (2.8% non-contiguous), 1575784/5000050 blocks
 
0
 
LVL 14

Accepted Solution

by:
mcrider earned 100 total points
ID: 2524676
Unix systems don't write directly to the disk... They write to an image and that image is only written to the disk when a SYNC is executed.

Sorry, but you have lost your information.  If you dont already have SYNC running as a crontab entry, I suggest you do it.


Cheers!
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2534656
I once lost two directories containing 100Mb in something like 100 files due to a power failure in the building. This data had accumulated in approx. 36 hours. Only one or two of these files where still open at the moment supreme.

How can you lose such an amount of data because of unflushed buffers? The machine is an alpha running kernel 2.0.36 with 512 MB RAM so it has the space to hold 100 MB in buffer. Still, I always thought buffers where flushed every 30 secs for data and every 5 secs for metadata.
0
 

Author Comment

by:djc2
ID: 2535638
mcrider, what do you suggest for a crontab entry to run SYNC?
Thanks
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 14

Expert Comment

by:mcrider
ID: 2535725
Well, at a minimum, I would sync the system every 5 minutes... Something like:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/sync



Make sure sync is in your /bin directory... If it's not, put the correct path to the command.



Cheers!
0
 

Author Comment

by:djc2
ID: 2535876
mcrider, what do you suggest for a crontab entry to run SYNC?
Thanks
0
 

Author Comment

by:djc2
ID: 2535907
Sorry that I'm beating this into the ground, but given the vulnerability to
losing data in this way, why isn't syncing the disk run automatically on Linux systems every 5 minutes or so? Are there some negatives to doing it? Does anybody know of anywhere I can find more details on this?

Thanks,
Dave
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2535969
Have you read the man page on "sync" ?  There are no negative aspect to it...

Linux doesn't come with this task running by default, but it should! I put this on every linux system I build...


Cheers!
0
 

Author Comment

by:djc2
ID: 2535979
OK, I'll try it out. Thanks
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2536003
Thanks for the points! Glad I could help!


Cheers!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now