I used this command:
mv Records/1711*D.org /media/geek/SimEx/5\ Data/17-18/Journal/
(this is the command I copy-pasted from the terminal. This session is still live on my terminal.)
This executed without any errors:
geek@simulator:~$ mv Records/1711*D.org /media/geek/SimEx/5\ Data/17-18/Journal/
geek@simulator:~$ mv Records/1711*D.org /media/geek/SimEx/5\ Data/17-18/Journal/
mv: cannot stat 'Records/1711*D.org': No such file or directory
The lines are directly from my terminal session. The first one was the last command I used last night. The second line is the command I tried to run after finding out today morning that files are missing. The first one executed (as seen in the terminal). The second one outputs error. And there is no other operation that has been done on this terminal session between the first and second line.
These were very important daily logs for the month of November. Now I don't find them either in the folder Records (which is on the hard disk) nor in the folder Journal (which is on the external hard disk).
My external hard-disk sometimes disconnects because of a loose connection. I suspect this is what might have happened! But mv
executed without any errors!
(I tried to test this idea: I created a dummy file. Typed a mv
command to move dummy file to external hard disk. I used TAB for completing the locations. The auto completion worked, which means the external hard disk was still mounted. But before pressing ENTER I unplugged the exHD. I got errors:
geek@simulator:~$ mv Records/Dummy.org /media/geek/SimEx/
mv: cannot move 'Records/Dummy.org' to '/media/geek/SimEx/': Not a directory
So I am not sure if the above could be a correct explanation)
(Edit: I could re-create the error.
As before I created a dummy file. I used TAB to type a mv
command. The auto-completion was working, implying the ExHD was still mounted. I pressed ENTER and instantaneously unplugged the ExHD. The command executed without errors on the terminal:
geek@simulator:~$ mv Records/Dummy.org /media/geek/SimEx/
geek@simulator:~$
However now the file Dummy.org
is neither on ExHD nor on HD.
So I suspect this is what might have happened. Any hope that I could find the files now? I have heard there are softwares that can recover accidentally deleted files. Need help!)
This is the output of ls command on Records:
geek@simulator:~$ ls -al Records/
total 7116
drwxrwxr-x 6 geek geek 4096 Dec 1 12:55 .
drwxr-xr-x 67 geek geek 258048 Dec 1 12:58 ..
-rw-rw-r-- 1 geek geek 3240 Dec 1 12:55 171201D.org
-rwxrwxrwx 1 geek geek 45021 Nov 22 19:13 2017 EX 2.ods
-rwxrwxrwx 1 geek geek 1248423 Nov 22 19:13 2017 PL 2.ods
-rwxrwxrwx 1 geek geek 3712319 Nov 30 12:18 2017 TS 2.ods
-rw-rw-r-- 1 geek geek 80 Nov 26 22:56 Contacts.org
drwxrwxr-x 10 geek geek 4096 Nov 20 08:02 Courses
-rw-rw-r-- 1 geek geek 217 Nov 29 03:05 Firefox.txt
drwxrwxr-x 2 geek geek 4096 Nov 20 13:09 Latex
-rw-rw-r-- 1 geek geek 71062 Nov 20 15:22 List.txt
-rw-rw-r-- 1 geek geek 73 Dec 1 12:39 .~lock.2017 TS 2.ods#
-rw-rw-r-- 1 geek geek 152 Nov 26 22:56 Resolution.org
-rw-rw-r-- 1 geek geek 484 Nov 26 22:56 SBB.org
drwxrwxr-x 2 geek geek 1826816 Dec 1 12:58 Shots
-rw-rw-r-- 1 geek geek 117 Nov 26 19:40 SSH.txt
drwxrwxr-x 2 geek geek 4096 Nov 24 02:39 Tickets
lrwxrwxrwx 1 geek geek 29 Dec 1 11:22 .#Times.csv -> [email protected]:1511886954
-rw-rw-r-- 1 geek geek 2108 Dec 1 11:27 #Times.csv#
-rw-rw-r-- 1 geek geek 2006 Nov 30 23:29 Times.csv
-rw-rw-r-- 1 geek geek 1129 Nov 30 12:18 Times.csv~
-rw-rw-r-- 1 geek geek 36002 Aug 14 23:54 Timetable.html
-rw-rw-r-- 1 geek geek 14896 Aug 13 18:02 Timetable.ods
Output of ls command on Journal:
geek@simulator:~$ ls -al /media/geek/SimEx/5\ Data/17-18/Journal/1711*.org
-rwxrwxrwx 1 geek geek 10969 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171101D.org
-rwxrwxrwx 1 geek geek 8369 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171102D.org
-rwxrwxrwx 1 geek geek 5777 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171103D.org
-rwxrwxrwx 1 geek geek 11708 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171104D.org
-rwxrwxrwx 1 geek geek 11309 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171105D.org
-rwxrwxrwx 1 geek geek 14371 Nov 22 19:57 /media/geek/SimEx/5 Data/17-18/Journal/171106D.org
-rwxrwxrwx 1 geek geek 19271 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171107D.org
-rwxrwxrwx 1 geek geek 18796 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171108D.org
-rwxrwxrwx 1 geek geek 12933 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171109D.org
-rwxrwxrwx 1 geek geek 10181 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171110D.org
-rwxrwxrwx 1 geek geek 10453 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171111D.org
-rwxrwxrwx 1 geek geek 9320 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171112D.org
-rwxrwxrwx 1 geek geek 12780 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171113D.org
-rwxrwxrwx 1 geek geek 8554 Nov 22 20:01 /media/geek/SimEx/5 Data/17-18/Journal/171114D.org
-rwxrwxrwx 1 geek geek 12095 Nov 22 20:01 /media/geek/SimEx/5 Data/17-18/Journal/171115D.org
-rwxrwxrwx 1 geek geek 18063 Nov 22 21:36 /media/geek/SimEx/5 Data/17-18/Journal/171116D.org
-rwxrwxrwx 1 geek geek 14450 Nov 22 21:36 /media/geek/SimEx/5 Data/17-18/Journal/171117D.org
-rwxrwxrwx 1 geek geek 12817 Nov 22 21:36 /media/geek/SimEx/5 Data/17-18/Journal/171118D.org
-rwxrwxrwx 1 geek geek 6557 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171119D.org
-rwxrwxrwx 1 geek geek 4617 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171120D.org
-rwxrwxrwx 1 geek geek 6759 Nov 22 19:14 /media/geek/SimEx/5 Data/17-18/Journal/171121D.org
-rwxrwxrwx 1 geek geek 7534 Nov 22 21:37 /media/geek/SimEx/5 Data/17-18/Journal/171122D.org
The files listed above are not the original files but the ones I backed up into another place till 22nd November. I have manually moved them to this location now. So records for the remaining 8 days are missing. Also the files above wouldn't have the edits I did on them after 22nd November.
This is the output of:
geek@simulator:~$ sudo find / -iname '1711*D.org'
/media/geek/SimEx/5 Data/17-18/Journal/171101D.org
/media/geek/SimEx/5 Data/17-18/Journal/171102D.org
/media/geek/SimEx/5 Data/17-18/Journal/171103D.org
/media/geek/SimEx/5 Data/17-18/Journal/171104D.org
/media/geek/SimEx/5 Data/17-18/Journal/171105D.org
/media/geek/SimEx/5 Data/17-18/Journal/171106D.org
/media/geek/SimEx/5 Data/17-18/Journal/171107D.org
/media/geek/SimEx/5 Data/17-18/Journal/171108D.org
/media/geek/SimEx/5 Data/17-18/Journal/171109D.org
/media/geek/SimEx/5 Data/17-18/Journal/171110D.org
/media/geek/SimEx/5 Data/17-18/Journal/171111D.org
/media/geek/SimEx/5 Data/17-18/Journal/171112D.org
/media/geek/SimEx/5 Data/17-18/Journal/171113D.org
/media/geek/SimEx/5 Data/17-18/Journal/171114D.org
/media/geek/SimEx/5 Data/17-18/Journal/171115D.org
/media/geek/SimEx/5 Data/17-18/Journal/171116D.org
/media/geek/SimEx/5 Data/17-18/Journal/171117D.org
/media/geek/SimEx/5 Data/17-18/Journal/171118D.org
/media/geek/SimEx/5 Data/17-18/Journal/171119D.org
/media/geek/SimEx/5 Data/17-18/Journal/171120D.org
/media/geek/SimEx/5 Data/17-18/Journal/171121D.org
/media/geek/SimEx/5 Data/17-18/Journal/171122D.org
find: '/proc/17227': No such file or directory
find: '/run/user/1000/gvfs': Permission denied
I am On Ubuntu 16.04. I use emacs.
Since I use emacs, I wonder if it would have some recovery option for the files edited in the last 10 days
p.s.: Please don't tell me they are lost?! Super-panicked!
Find
Running the following command in a terminal will find files matching the pattern
1711*D.org
, and send errors to/dev/null
. Run this command twice once with the drive mounted and again with it unmounted. Since mounting a drive or folder as a folder with existing contents will overshadow those contents making them seem inaccessible, see Mounting Flashdrive - mounted to home directory.Data recovery
If the files can not be found data recovery will be the most likely next course of action. As the linked answer is quite good I will give just the barest summary of the steps.
testdisk
installed or available.Follow the appropriate undelete guide; NTFS, FAT, EXT.
Steps for ext:
testdisk
As you say that your mounted disk sometimes unmounts itself this must have happened when you moved your files.
So
umount
your mounted disk and runfind $your_mountpoint -name '1711*.org'
to find your files (which have been hidden by the mounted disk).