5

Okay, some time ago I found what seems to be a bug in nautilus.

/tmp$ mkdir test/
/tmp$ mkdir test2/
/tmp$ echo "very important stuff" > test/important-file.txt
/tmp$ ln -s /tmp/test/ test2/test

If you try to mv test2/test . bash is smart enough to answer :

mv: «test2/test» and «./test» identify the same file

I created a symbolic link to test (a directory containing a file) in another location, and then I moved the symbolic link to the place where the directory was

But then , nautilus gets into the game:

Moving symbolic link to the location where de directory is in nautilus

Nautilus understands that the symbolic link is a directory, and it kindly offers me to merge them:

enter image description here

Now, I merged them (I obviously thought it was two different directories). And as a result...

tmp$ ls -la
lrwxrwxrwx  1 cool-user  best-group-ever      9 août  26 23:51 test -> /tmp/test

Okay. So I lost my directory (which is normal, because I overwrote it) and ended up with a useless circular symbolic link, but... what happened with my important-file.txt ? It had an inode, that's not referenced by any directory in my system anymore.

Obviously, I didn't write that inode in a post-it... so, where is it ?. Is there any way to find every file with an inode which is not referenced by any dir?

And as a bonus question: Is this the expecteb behaviour of nautilus, or is it a bug?

Why and how this happened to me is a long story, but I had some really important (and confidential) files within my directory that I would like to get back

Luis Sieira
  • 101
  • 8

2 Answers2

3

Not sure that's possible. After all, all your of your free space is a list of inodes.

See however the Orphan File feature of ext4.

0

I'll post my answer, but I'm not accepting it, since it doesn't seem to be by any meanings a good one (at least in terms of efficiency or completeness).

This would require a program (I'd write it in C) that recursivelly walks the entire directory tree, registers every referencied inode in an ordered list (avoiding duplicates), and then diffs it against the actual inode list.

The difference are the missing files

Luis Sieira
  • 101
  • 8