How does extundelete handle multiple versions of the same inode?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How does extundelete handle multiple versions of the same inode?
# 1  
Old 12-13-2016
How does extundelete handle multiple versions of the same inode?

Hi,

I noticed a weird behavior in extundelete way to choose the filename to which it will restore a given inode. Here is an example :

Code:
root@rescue:~# for after in '' 0 740 741 $(date -d 'now - 1 year' +%s); do rm -rf RECOVERED_FILES/; echo -e "$(date -d@$after 2> /dev/null || echo No date)\t$(extundelete --restore-all ${after:+--after $after} --log info /dev/md2 | grep 694)"; done | column -tns$'\t'
No date                       Restored inode 694 to file RECOVERED_FILES/lib/x86_64-linux-gnu/libanl-2.13.so
Thu Jan  1 01:00:00 CET 1970  Restored inode 694 to file RECOVERED_FILES/lib/x86_64-linux-gnu/libanl-2.13.so
Thu Jan  1 01:12:20 CET 1970  Restored inode 694 to file RECOVERED_FILES/lib/x86_64-linux-gnu/libanl-2.13.so
Thu Jan  1 01:12:21 CET 1970  Restored inode 694 to file RECOVERED_FILES/lib/udev/rules.d/60-gnupg.rules
Tue Dec  8 16:22:37 CET 2015  Restored inode 694 to file RECOVERED_FILES/lib/udev/rules.d/60-gnupg.rules

So apparently, the same inode has been used for two different files. Inode 694 was "/lib/x86_64-linux-gnu/libanl-2.13.so" from EPOCH to EPOCH+740 seconds and then it became "/lib/udev/rules.d/60-gnupg.rules" until today. I have no problem with this as in ext filesystems, the same inode can be reused once cleared. If I look at the file content (which is always the same whatever --after option I set), the actual file recovered is "60-gnupg.rules".

My first surprise is that a change on my system could happen on January 1st 1970 at 1:12. The install is at most 4 years old. But lets say the clock wasn't set at install time and the change happened after 12 minutes (I'm UTC+1). So I'm not complaining about it.

What I'm surprised about is that if one doesn't set an appropriate "--after" option, extundelete will recover an inode to it's oldest filename, leading to filesystem inconsistency.

Is this normal behavior?
Is there a workaround to it?

Regards
# 2  
Old 12-13-2016
filesystem inconsistency? Or just the wrong file?
# 3  
Old 12-13-2016
That is totally unhelpful and might lead other people to believe an actual answer was given to the original post.

If a lib file contains text or if a config file is missing then : It will be the wrong file and the filesystem will be inconsistent.
# 4  
Old 12-13-2016
Neither is repeating something helpful. Nor is linking to a generic dictionary when asking about a term which has a specific meaning for filesystems. "Inconsistent" for a file system means crashed or damaged - a filesystem that can't or shouldn't be used without running fsck first.

If extdelete is crashing your filesystem, you've got bigger problems, and the problems may not be related to extundelete itself.

Last edited by Corona688; 12-13-2016 at 03:59 PM..
# 5  
Old 12-13-2016
I second corona688's comment. That filetime is very suspect to start with. I believe you have serious filesystem corruption - meaning the metadata for the files has problems.

inodes are one of the primary objects in a filesystem.

Try this:
Code:
$ sudo touch /forcefsck
$ sudo reboot

I am assuming you do not normally run as root, which is a bad practice. You will see what your problems are.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Fedora

Segmentation fault while trying to recover file with extundelete

hello, I accidentally removed a directory with its contents with rm -r and I don't have a backup. I got to know about extundelete utility on linux and downloaded on my Linux Fedora 28 notebook PC. The file system is ext4. I log in to the system as single user mode and unmount the /home directory... (2 Replies)
Discussion started by: milhan
2 Replies

2. Red Hat

Installing multiple versions of same package.

I need to install a older version of gnupg but not delete the current version of gnup2 on RHEL 6.4. What would be the correct syntax to install this? Tried to install and relocate it and still getting conflicts. aXXXXXX:root# rpm -ivh /root/rpmbuild/RPMS/x86_64/gnupg-1.4.16-1.x86_64.rpm... (2 Replies)
Discussion started by: soupbone38
2 Replies

3. UNIX for Dummies Questions & Answers

Patches - why multiple versions?

Hi just wondering really ...... I've done a showrev -p and am somewhat surprised to see apparently multiple different versions of the same patches ...... 112161-02 112161-03 112161-04 It's my understanding that a newer revision of a patch , -04 in this case supercedes all previous... (2 Replies)
Discussion started by: Martincorneuk
2 Replies

4. UNIX and Linux Applications

install multiple versions of firefox in linux

Since apt-get and yum won't let you install multiple versions of firefox I will explain how to here. 1. Go to this page and decide which version of firefox you want. ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/ I used this one. ... (0 Replies)
Discussion started by: cokedude
0 Replies

5. UNIX for Dummies Questions & Answers

how to handle multiple apps on host?

So, I'm going to install Oracle DB within my Suse host... Also, I would like to run Virtual Box and Tomcat.. ok, tomcat is going to be runnable app that will start at boot.. but, how to handle Oracle and virtual box? I would like to have an Oracle under it's own user, and to be able to use... (0 Replies)
Discussion started by: bongo
0 Replies

6. Linux

Compiling with multiple versions of a library

Hello! I have a set of headers and libraries I want to use but they are mixed with ones I do not want to use. They are part of some official stuff, so I cannot modify them while begging and pleading for weeks. These headers and libraries are located here /long/official/path/to/include... (0 Replies)
Discussion started by: gobi
0 Replies

7. Shell Programming and Scripting

How to handle multiple rows in a file

I have a FILE a.txt which has the following data 113901.94,113901.94,56950.97,56950.97,NOT MATCHING,NOT MATCHING 10693.04,10693.04,5346.52,5346.52,NOT MATCHING,NOT MATCHING 1901.94,1901.94,550.97,550.97,NOT MATCHING,NOT MATCHING 103.04,103.04,53.52,53.52,NOT MATCHING,NOT MATCHING #### This... (2 Replies)
Discussion started by: ksmbabu
2 Replies

8. Shell Programming and Scripting

Handle Configuration File with same name of Parameter in multiple Sections

Hi I have a config file with multiple section and a parameter with the same name in each section. I need to read each parameter for distinct section. Parameter = 1 .... Parameter = 2 .... Parameter = 4 .... Tried this: grep -m1 '^*ProcessorsNumber' ServiceBrokerFramework.cfg |... (7 Replies)
Discussion started by: potro
7 Replies

9. Shell Programming and Scripting

How to handle the Multiple Rows in the Database

Hi All, I have problem with database validations, actually my requirement is, my code will generate some seqno;s, which i have to check in database, whether the generated seqno;s are present in database or not, if the generated seqno;s are present in the database means, i need to generate... (2 Replies)
Discussion started by: hsekol
2 Replies

10. UNIX for Dummies Questions & Answers

Using multiple java versions in unix

Hello we are using java 1.2 in our shell / env it is also set in the main JAVA_HOME env var , but we have also java 1.4 installed , now we need to use new application that uses only java1.4 is there any way to point this specific application to use java 1.4 without changing the global... (2 Replies)
Discussion started by: umen
2 Replies
Login or Register to Ask a Question