LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-27-2013, 10:13 PM   #1
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
Directory/folder disappeared.


Ubuntu 12.04
Gnome3


A very large and very important 'directory' has disappeared from my hard drive. This directory had between 50 or 60 sub-directories and at least a 1000 files, pdfs, and images. I became aware of this very shortly after using file manager to transfer some images from a sans disc in my card reader to a subdirectory in the directory that disappeared.

I went immediately to these forums to read about recovery. Saw lots of post on recovering file but very little on recovering directories.

I took this image about 5 minutes after this happened.
Code:
dave@Dafydd:~$ cat /var/log/syslog | grep sda1
Feb 27 15:51:30 Dafydd kernel: [    1.367947]  sda: sda1 sda2 < sda5 >
Feb 27 15:51:30 Dafydd kernel: [    2.062512] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
Feb 27 15:51:30 Dafydd kernel: [   19.349960] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro,user_xattr
dave@Dafydd:~$
I took this after an hour and a reboot. Probably means neither is relevant.
Code:
dave@Dafydd:/var/log$  dmesg | grep sda1
[    1.367947]  sda: sda1 sda2 < sda5 >
[    2.062512] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   19.349960] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro,user_xattr
dave@Dafydd:/var/log$
Back in the 8 bit era, (Motorola 6809 and Microware OS-9), we had a raw disk editor that would let us open a disk in raw mode and edit/search the data of the file allocation table to find the location of files or directories. DOES SUCH AN ANIMAL EXITS FOR LINUX?

If someone can put me on some recovery applications, I will really appreciate it. This directory was the location of all the code/images/stuff for the club website I administer.

Thanks
Dave
 
Old 02-28-2013, 09:07 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Dafydd View Post
A very large and very important 'directory' has disappeared from my hard drive. (..) I became aware of this very shortly after using file manager to transfer some images from a sans disc in my card reader to a subdirectory in the directory that disappeared.
Sorry to hear that. In short you have no idea when you deleted the directory.


Quote:
Originally Posted by Dafydd View Post
This directory was the location of all the code/images/stuff for the club website I administer.
You're so lucky you decided to make daily backups!


Quote:
Originally Posted by Dafydd View Post
I took this image about 5 minutes after this happened. (..) I took this after an hour and a reboot. Probably means neither is relevant.
Indeed. What you did isn't relevant (except you shouldn't have done that in the first place) but what you did not do (in short: immediately remount partition read-only or shutdown immediately after deletion, boot from Live CD, not mount anything and make 'dd' backup of partition).


Quote:
Originally Posted by Dafydd View Post
If someone can put me on some recovery applications, I will really appreciate it.
Since you have no idea when you deleted the directory any write ops done in the time between deletion and now work against you. Over time the chance of recovery becomes exponentially smaller. Even with the right tools there is no guarantee of recovery. With testdisk you can "view" the file system (advanced options) and look for deleted items (in red IIRC if colorization is on), Photorec, Scalpel and Foremost are you standard header / footer file carvers and else you can grep / hexedit your way through the disk image. If making a disk image is out of the question at least boot a Live CD or have the partition mounted read-only and recover to a physically different partition or disk. Oh and BTW a (partial) backup, file magic, mediainfo, exiftools and the photorec post-op script may help as all directory and file names will be gone.

Good luck!
 
Old 02-28-2013, 01:14 PM   #3
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
This question is for my enlightment more than anything else.
When I delete a directory, it will not delete unless it is empty. How/what would delete a directory with many sub-directories in it and many many files/images?

This is the process I went through that cause the directory to be deleted. For what its worth.
------------------------------------
Opened a terminal and cd to directory.
made new directory to hold todays work
opened email reader and copied some text to go into 'index.html' file
opened gedit index.html
pasted text into index.html
inserted html tags

put sans disk from phone into card reader
plugged card reader into USB port
file manager came on screen
cloned file manager window
cd'ed cloned file manager window to 'made new directory'
copied - pasted images to new direcroy,

cd to new directory and 'ls', the new images were there
returned to original file manager window
erased images on sans disk
closed file manager

returned to index.html
entered html code to display images
hit cntl S to save
Get message "No such file or directory"
------------------------------------------

'index.html' file was still in 'gedit' so I saved it elsewhere.
My last backup of the missing directory is about 8 month old so all is not lost and I can download a copy of current files from the website host.
 
Old 02-28-2013, 01:18 PM   #4
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by unSpawn View Post
Sorry to hear that. In short you have no idea when you deleted the directory.
You're so lucky you decided to make daily backups!
I deserve that jab. Thank you, now twist.
 
Old 02-28-2013, 02:05 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I see no need as you remembered you can download the files from the web site. So effectively you do have a backup. Kind of.
 
Old 02-28-2013, 11:47 PM   #6
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
Miracles. I found it. I DID NOT MOVE IT. Something else did. I was in a directory next to where it resided on the hard drive.

It is intact and healthy.

I may have also found why it did this. I was trying to copy it back to the original location and ran out of disk space on my 160 gig internal drive.

Any way thanks for the help and information. I have something in the bucket for later. Like finding out the layout of a linus drive.

Again thank you for the responce.

Dave
 
Old 03-01-2013, 12:42 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Dafydd View Post
Miracles. I found it. (..)It is intact and healthy.
Thanks for posting back.

But please note things don't move on their own ;-p
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Everything Has Disappeared From My Downloads Folder xjonquilx Linux - Software 20 08-17-2019 05:20 PM
Folder and files disappeared miros84 Linux - Software 5 01-11-2013 01:14 AM
[SOLVED] Folder disappeared, any ideas? nikooo777 Linux - Server 4 12-07-2011 05:56 PM
Transferring photos from mobile to memory stick and whole folder disappeared! Jillybeans Linux - Newbie 19 12-30-2010 05:50 AM
Kmenu folder icons disappeared legalbeagle Linux - Desktop 0 02-11-2008 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration