2

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 -> geek@simulator.918: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!

Inspired_Blue
  • 601
  • 2
  • 9
  • 26
  • 1
    It should be in /media/geek/SimEx/5\ Data/17-18/Journal/, if you are looking at the folder Journal from Nautilus, reload the location. – sourav c. Dec 01 '17 at 06:48
  • Please post the output of ls /media/geek/SimEx/5\ Data/17-18/Journal/Records/1711*D.org – wjandrea Dec 01 '17 at 06:51
  • No the files are not there in /media/geek/SimEx/5\ Data/17-18/Journal/ – Inspired_Blue Dec 01 '17 at 06:58
  • Output for ls Records/

    geek@simulator:~$ ls Records/ 171201D.org Contacts.org List.txt SSH.txt Times.csv~ 2017 EX 2.ods Courses Resolution.org Tickets Timetable.html 2017 PL 2.ods Firefox.txt SBB.org #Times.csv# Timetable.ods 2017 TS 2.ods Latex Shots Times.csv

    – Inspired_Blue Dec 01 '17 at 06:59
  • Similarly the files '1711*D.org' doesn't show in /media/geek/SimEx/5\ Data/17-18/Journal/ – Inspired_Blue Dec 01 '17 at 07:00
  • @Inspired_Blue Please [edit] your question to add details. Info like file listings are hard to read in comments. – wjandrea Dec 01 '17 at 07:06
  • if possible, in the terminal used to run the mv command press ctrl+r. This should take you into a revers-i-search mode. Then type in mv, pressing ctrl+r will step you through matching commands in your command history. Find the command you ran and if different from the one in your question edit your question to possibly shed light on your problem. – J. Starnes Dec 01 '17 at 07:22
  • yes the command is something I have directly copied from the terminal. It was the last executed command from last night. It's still there on my terminal session. – Inspired_Blue Dec 01 '17 at 07:48
  • 1
    My external hard-disk unmounts itself because of a loose connection. This is not true, the HDD is not unmounted properly, just disconnected. This may result in a slightly corrupted file-system. Try to check/repair the file-system with adequate tools (depends on the file-system used). – mook765 Dec 01 '17 at 09:27

2 Answers2

2

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.

find / -iname '1711*D.org' 2>/dev/null

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.

  1. Do not run any command that will write date to the disk.
  2. Boot from a live usb with testdisk installed or available.
  3. Follow the appropriate undelete guide; NTFS, FAT, EXT.

    Steps for ext:

    1. Run testdisk
    2. Select Advanced
    3. Select the partition that was holding the lost files and choose Undelete
    4. Navigate in the directory structure until you have found the directory that was holding the file you are trying to recover. Deleted files are displayed in red. To undelete a file, select the file to recover and press 'c' to copy the file
    5. Select the destination, not on the drive to be recovered from.
    6. Once the ext2 file recovery completed, choose Quit.
  4. Setup automatic backups.
J. Starnes
  • 1,969
1

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 run find $your_mountpoint -name '1711*.org' to find your files (which have been hidden by the mounted disk).

muclux
  • 5,154