LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-12-2004, 11:58 PM   #1
SammyK
LQ Newbie
 
Registered: Aug 2003
Posts: 24

Rep: Reputation: 15
"Undeleting" data using grep, but get "grep: memory exhausted" error


So I have done all sorts of research into recovering files on an ext3 file system, and since ext3 actually zeros-out inodes instead of flagging them like in ext2, the old undelete software is useless. Thus, I am turning to good ole grep to help me. I am doing the whole:

grep -a -B50 -A50 "search string" /dev/sda3

thing, and my problem is that grep takes up so much memory over time that it pukes. I can run top while running that grep command and see the available memory get smaller and smaller until there is virtually none left and grep pukes.

So, I have 256MB RAM and an 18GB HD. Is there a fix for this? Can I get grep to write it's temp data to another hard drive instead of the memory?
 
Old 03-13-2004, 05:31 AM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
I think you answered your own question - a delete in ext3 zeroes out the markers instead of inactivating them, and as a result, that more or less kills any opportunity for an undelete. The grep option is basically a last resort, but perhaps you can boost your memory? I don't know if your budget/interest would validate going to 512Mg RAM or 1G RAM, but if the data is that important, you may be able to cost-justify the expense. Good luck with recovering the data. -- J.W.
 
Old 03-13-2004, 04:11 PM   #3
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Rep: Reputation: 30
you could try searching the disk in parts, something like the following to search 500M at a time:

dd if=/dev/sda3 bs=1048576 count=500 | grep ...
dd if=/dev/sda3 bs=1048576 skip=500 count=500 | grep ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"grep" Command (SystemV/68 system) xtremexp Other *NIX 3 05-28-2005 08:25 PM
How to use "OR" option in a grep command. sumitarun Programming 3 04-18-2005 02:44 AM
"grep" and "tcpdump" Magsol Linux - Newbie 2 03-26-2005 12:56 AM
"grep: /etc/issue: No such file or directory" hunter_one Linux - Software 6 10-15-2003 04:27 PM
"pipe: memory exhausted" problem nixie Linux - Software 1 09-02-2003 02:56 PM


All times are GMT -5. The time now is 04:01 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration