CodeWalrus

General => General Help & Troubleshooting => Topic started by: gameblabla on July 11, 2016, 06:34:52 PM

Title: Recovering hidden files on Ubuntu
Post by: gameblabla on July 11, 2016, 06:34:52 PM
So...  after an unfortunate incident with my computer, i lost some files.
Or so i thought.
What really happenned is the fact all the files and even folders are there but are all hidden.
When i type this on the terminal, it returns this...
hatsune@hatsune:~$ ls
ls: cannot open directory .: Wrong medium type

My file manager shows me nothing, as if there was no files.

However, i can still go to folders as if they were there.
hatsune@hatsune:~$ cd Documents
hatsune@hatsune:~/Documents$


But(t) i'm not done yet !
The files are still there, look !
hatsune@hatsune:~/Documents/DEV/Gameblabla/Website_v2$ find index.htm
index.htm

And they are not corrupted anything !

However, when i try ls again, i get this :
hatsune@hatsune:~/Documents/DEV/Gameblabla/Website_v2$ ls
ls: cannot open directory .: Wrong medium type

My file manager shows me no files.

Photorec unfortunely only gives me eCryptfs files. (because i have encrypted my home directory)

So i thought... Maybe i can brute force filenames ?
I could write a bash script that could try to find all the files in a given directory and try to find the hidden filename in a loop like so.*
a.htm
aa.htm
aaa.htm
..
ab.htm

and so on.
Or maybe there is an utility for my case ?
fsck does not work unfortunely.

What should i do ?
Title: Re: Recovering hidden files on Ubuntu
Post by: Yuki on July 12, 2016, 06:50:01 AM
Which kernel do you use? What I read online suggests upgrading to 4.6 or using the kernel you had before the last time you upgraded should solve the problem (Ubuntu usually keeps previous versions of the kernel accessible in GRUB, in case), otherwise I guess there's a patch coming soon.
Title: Re: Recovering hidden files on Ubuntu
Post by: gameblabla on July 12, 2016, 04:27:53 PM
I admit i had downgraded to Linux 4.1 due to some issues with Virtualbox. (still not compiling modules with Linux 4.6.3)
I upgraded to Linux 4.6 again and it fixed my issue.
How the hell did you know that ?
Is it because they changed the encryption thing starting with Linux 4.4 ?

Thank you, i can always count on you.
Title: Re: Recovering hidden files on Ubuntu
Post by: Yuki on July 12, 2016, 09:39:23 PM
Usually I type the error message in Google and the first few links all said to upgrade to 4.6 because there was some issue with that in the older kernels. Probably because you downgraded and they changed something not retrocompatible in 4.4, yeah.
Title: Re: Recovering hidden files on Ubuntu
Post by: Dream of Omnimaga on July 13, 2016, 04:19:40 PM
Another thing I do, regardless of the OS, is backing up my important files often, in case stuff like this happens. :P