LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2013, 06:20 AM   #1
Ch3shire
LQ Newbie
 
Registered: Nov 2013
Location: the Netherlands
Posts: 4

Rep: Reputation: Disabled
Need help with recovering folders/files after running e2fsck -f -v -C 0


Hi Guys,

I have looked around the forum to see if I can find similar posts with my problem. However not so much, so I opened this topic on my own.

What do I have and what did I do: I have a QNAP TS-509, firmware 4.0.2 Build 20130726, 4 x WD5000AAKS and 1 x Hitachi HDS725050KLA360.
The QNAP is in a windows domain network and there are a couple off shares on the QNAP with domain permissions.
Everything worked fine en still does.

The problem: File System not clean. Examination failed (Cannot unmount disk)
Solution: Go to Storage manager -> Current Configuration: Logical Volumes -> select RAID set -> click Check File System
Did this help? No not for me. Every time I rebooted I got the message back.

So I took it on myself to scavenger the internet for a solution. Eventually I found this:

If you get this message from your QNAP:
1 The file system is not clean. It is suggested that you run "check disk"

and after you start a disk check and you end up with message like this:

2 [Mirror Disk Volume: Drive 1 2 3 4] Examination failed (Cannot unmount disk).
or
3 Get the same message back over and over again.

You need to get into SSH and execute following:
1 /etc/init.d/services.sh stop
2 /etc/init.d/opentftp.sh stop
3 /etc/init.d/Qthttpd.sh stop
4 umount /dev/md0
5 e2fsck -f -v -C 0 /dev/md0
6 mount /dev/md0
7 reboot
8 After all of above, your QNAP NAS will reboot and everything will get back to normal.

Number 8 is is not necessarily true.

after number 5 I got a kind of matrix looking output, at that moment I just wanted to shoot myself for not making a back up first. When I try to think what was happening, there were corrupted files or some sort that he was repairing. I really don't know for sure anymore. When all was finished I executed 6 and 7 and everything seemed to be ok.

Not the case....

After a couple of days I needed some files from two specific folders, but these where nowhere to be found anymore. So I didn't lose any shares, I lost folders and the files within.

There where some folders and files that where lost, but they where nicely put in the @Recycle folder. Strangely the network share (where the two lost folders and the files where in, shows up in the shared folders section, but not in the file manager.

However the two folders that are missing are projects we are working on for customers and nowhere to be found anymore. We contacted Customer care of QNAP. The guy really tried his best, but told me to get a recovery program to see if I that could recover the folder and files.

I have tried using Photorec and testdisk (running now) but so far no luck. The files missing are mostly are .docx, .xlsx and .txt .docx and .xlsx aren't in testdisk or photorec.

Hopefully there is someone that can help me get my files back.

Cheers Rick
 
Old 11-08-2013, 06:05 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Your missing directories and files may be in your lost+found directory.

--------------------
Steve Stites
 
Old 11-09-2013, 10:19 AM   #3
Ch3shire
LQ Newbie
 
Registered: Nov 2013
Location: the Netherlands
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi Steve,

I maybe a Newby at this, but that was the first place I Looked
Unfortunately I can't find them anywhere. I tried TestDrive and PhotoRec but nothing.
I really do not have a clue what to do to get them restored.

Cheers Rick
 
Old 11-09-2013, 11:37 AM   #4
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 think the problem started with not trying to understand what the actual error was but trying to "fix" things from the user Interface. Next time the array gives you such problems, provided you now have a suitable backup scheme in place (and have actually tested restoring files!), first gather nfo with respect to kernel (warnings) ('dmesg', 'less /var/log/messages'), running processes ('lsof -Pwln'), status of your RAID and disk setup (see mdamd.conf / raidtab, 'cat /proc/mdstat', 'mdadm -D /dev/md0', 'fdisk -l'), do a --dry-run after umounting md0 ('e2fsck -n /dev/md0') and if and when you decide to run such a destructive check pipe output to a file ('e2fsck -f -v -C 0 /dev/md0 2>&1 | tee /dev/shm/fsck.log') for reference purposes. Same goes for Photorec: always first 'cd' to a location you can afford to write to (USB stick, never the Live file system) and always run it with the "/debug" and "/log" flags to have a log file to post.

There's no clue as to what the status of the NAS is but since you said "Everything worked fine en still does" and seem to have examined the file system I assert it's up and running and accessible again. That's a Bad Thing as journaling file systems are particularly quick re-allocating free disk space lowering chances of of recovery within seconds after the fact. So even if you would manage to start the recovery process right after you've remounted all disks read-only I'm sorry to say there's no guarantee whatsoever recovery may be (partially) successful.
 
Old 11-11-2013, 07:32 AM   #5
Ch3shire
LQ Newbie
 
Registered: Nov 2013
Location: the Netherlands
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi unSpawn,

It was a stupid mistake to not make a backup first. Reading about the error message and its solution I didn't think anything could go wrong. After I ran the commands I got a matrix kind of screen I have no idea what was going on, but it didn't feel good. after some time this stopped. I then mounted the raid set again and rebooted. The error message was gone. It was only after a couple of days I found out that some folders and files where missing. The strange thing was that other folders and files where dumped in @Recycle (a temporary recycle bin that can be activated in your QNAP). I didn't think I would be needing a backup system, because I was using a NAS. WRONG!

The solution I found to clear the error message on the NAS did the job. The message was gone, so where some files and folder. The NAS was and is running with no problems. I have copied everything onto a external back up to keep files and folders save and to keep the NAS clear of data reads and writes.

As I am a newbie I Googled for a solution to get my folders and files back. I found out how to use PhotoRec. I ran PhotoRec and now need to go trough all the files
What I want to know is there a way to just try and recover the share where the folder was in? I have a lot of files now to go trough because a have recovered the whole NAS.

Last edited by Ch3shire; 11-11-2013 at 07:36 AM.
 
Old 11-12-2013, 05:07 PM   #6
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 Ch3shire View Post
As I am a newbie I Googled for a solution to get my folders and files back.
While this won't help you right now and while you couldn't possibly be faulted for doing that you have to remember always is to ensure you understand what's said, what the circumstances are and what the consequences are because the Internet is rife with stale, deprecated, incomplete HOWTO's, articels, web log and forum posts and such by both knowledgeable and sheer incompetent posters who assume you know what you're doing, care nothing about the results or just copy other peoples posts. Never take anything for granted, make it a reflex to question everything and do your own research. Self-reliance goes a long way.


Quote:
Originally Posted by Ch3shire View Post
What I want to know is there a way to just try and recover the share where the folder was in? I have a lot of files now to go trough because a have recovered the whole NAS.
No, I'm afraid that won't work because any meta data is lost (as file names are listed in the drectories inode). Depending on what type of files you have what's left is to check log files, clients caches, backup copies (and Windows registry Hives if applicable) to piece things together.
 
Old 11-14-2013, 08:24 AM   #7
Ch3shire
LQ Newbie
 
Registered: Nov 2013
Location: the Netherlands
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi unSpawn,


thanks for the advice. I will never take anything for granted anymore and will stay a member of this community to learn and get a better insight into Linux. I recovered 1 TB of files which I need to go trough. I already found one document that was in the missing folder. So I hope I will be able to find more.

thanks again !!

Cheers Rick
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
maximal mount count reached, running e2fsck is recommended Iyyappan Red Hat 7 12-07-2010 03:24 AM
find -exec command to recursively delete files and folders in folders with X name Joan Murt Linux - Newbie 2 07-08-2009 04:35 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
Running fsck (or e2fsck) on root file system... xbill311x Linux - Newbie 2 01-02-2006 10:54 PM
run e2fsck when system is running? mikeshn Linux - General 1 10-14-2003 11:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:09 AM.

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