Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Ok, here's the situation. I have 2 computers, each dual booting Windows and Linux. Crucial data was stored on pc#1's Windows partition. I wanted to upgrade pc#1's Windows from 98 to XP, but being a Microsoft operating system, my Win98 was messed up pretty bad and I wanted a clean install. I backed up all the crucial data (the whole damn hard drive, actually) onto PC#2's Linux partition. I then formatted pc#1 Windows from FAT32 to NTFS (destroying all data) and installed XP.
PC#2's Linux partition is XFS, running Mandrake.
I went to PC#2 to get the crucial data I backed up there, Boom, kernel panic - no init found. I put off the task of fixing it for a while and then what do you know, a friend that I had previously asked to put Redhat on PC#2 comes over. He does, and during the install, formats the PC#2 Linux partition to ext3 and installs Redhat.
Is there any way I can recover the data? It's very important =/ There was a whole lotta crap on PC#2's Linux partition so the backed up crucial data is probably not overwritten. The question is, it was written when the partition was XFS and then it was formatted to ext3...
It's quite messy... I'm not sure if it's possible to salvage anything, but try this (as a last resort)...
Move the harddisk from pc#2 to another linux system with a lot of free space (about the size of your pc#2 harddisk). Then make binary copies (with dd) of your new partitions to another drive. You MAY be able to browse (or scan with grep) through those files and find something usefull... Mainly text (plain text).... However, your files may have been fragmented and it would be almost impossible to put them back together...
I'm not sure if formatting a drive to ext3 would erase its contents. I guess not because it would be too lenghty....
Good luck. See if you can get better solutions... I tried something like this, because I had to recover 200Mb of documents (*.doc) from a corrupted fat system. The first thing I did was to backup the whole thing (2Gb) on another system, and then run M$ scandisk. Fortunatelly for me, scandisk was able to recover most of the information and I didn't have to scavange around to get it!
I've got a few questions so I can maximize my chances of getting my data back.
I have the mandrake disks and can reinstall mandrake and format it back to XFS. Should I?
Are there any undelete tools that can look this deep?
Can I shrink the partition a few gigs before making the binary image without lowering my chances or recovery? The Linux partition is about 40gb and my largest other hard drive's total capacity is 40gb (Ironically, it's also PC#1, but I don't mind wiping it out again since there's nothing on it). I would need Linux on PC#1 and the image so it'd be really tight.
If you format that zone again, you'll only lower your chances of finding anything usefull there...
Reinstalling Mandrake on the same partition doesn't guarrantee that everything will go back into place like the first time...
Because you have multiple partitions you can backup only the partion you want (in this case, the one with linux on it).
You can backup only the zone that you know contained your data! ARE YOU SURE it was in that red zone? If it was indeed, you can only backup up to a point... Let's say the data you want to recover is about 1GB. You could guess the start point of where the data used to be and copy 1GB from there. Use dd. Read the manual. It does miracles.
Question: What kind of data did you have? Plain text or binary? (avi, mp3, exe, doc, zip, etc..)? If it's binary it will be EXTREMELY difficult to salvage anything usefull... You'd have to search for headers and to know where the file's end is and PRAY that the system wasn't fragmented!
Tip: Any modifications you make should not be done on that linux filesystem. This way, if anything goes wrong, you can always get another copy or take the disk to proffesionals, so that they can retreive the information...
And keep me posted... I'm curious if it can be done!
The whole ordeal happened on the same day, so I'm positive that the data isn't fragmented.
I am also sure that all the data is in the first 20GB of the partition.
However, there is some bad news too:
The files I'm trying to recover are binary (the most important things are jpeg images)
I am still a noob at linux. How can I tell dd to make the image onto my other hard drive? Do I disconnect the drive I'm trying to recover from and attach it to PC#1 and make the image onto the drive there?
man dd and info dd just added some confusion. I'm thinking that you can tell me what to type since I'd probably mess everything up.
You might be in luck if they are jpeg. They must have some kind of header that can be easily detected. Maybe in the header is some reference to the size of the image. If not, you could (in theory) copy from header #1 to header #2 then from header #2 to header #3 and so on... This can be done by grep, but it's too complex and I don't know how to do this (maybe from a shell script or something...).
Now, first of all you must create a copy of that info...
To do this you must have a running linux, prefferably not the linux on the partition you're trying to salvage... You can move the disk, or boot from a knoppix cd (if you have one)...
Let's say you've moved the disk to another pc. Connect it as master slave (this means that it's hdb). Boot the pc and run a linux from its primary disk (hda)
Prepare the destination ... Make sure you have enough free space + some margin of error.
Issue this command :
You might be in luck if they are jpeg. They must have some kind of header that can be easily detected.
Have a look at FIRE/Biatchux (what's in a name). It's THE forensics/recovery cdrom and comes loaded with TCT, so you got all the tools to recover files on one disk.
If you're looking for a header-based recovery tool, search sourceforge for "foremost", that tool fits the description 100 percent.
These are advanced tools, so if you use them you better read the docs before you start.
Ah, I do have a Knoppix cd (and Linux loaded on PC#1), and that header info looks promising.
Gonna do the command tonight and teach myself grep. The thing is, the only thing I know about grep at the moment is that it searches for text within a file. And that might not be correct, even! Looks like I've got some reading to do.
One more thing: Any programs or such I can run under Windows?
The original HD might have its information somewhere on the drive. Similar story, new filesystem (destructive format of FAT32->NTFS5), new operating system (win98->winxp), and data probably not overwritten. No idea about fragmentation of original drive though. While it seems like it would not have as good chances as the linux partition on PC#2, it's worth a shot.
Thanks guys! I'l tell you how it worked out tomorrow.
Note to self: From now on, make TWO backups AND have one of them removable media, and TEST it!
It is possible that the original info is somewhere on pc#1, but with ntfs... i really don't know. You can try this... Get Easy Recovery (from ontrack) and it will find deleted files. I know it works on fat and fat32, but I haven't got a clue if it works under ntfs too... (Tell me if it works). Also, I don't know if it can get anything out of formated disks... I think it relies on fat tables, and by format, these are wiped clean... but I don't know for sure... You can try it!
Booted from knoppix cd (Finally got it back - was introducing someone to Linux and let him borrow it for a week) and could read from both hd's just fine, but as soon as I did the dd command I got permission denied. You can't be root in knoppix anyway, I believe. I logs you in automatically as "knoppix"
Tonight I'll try booting off of one hd and attaching the one to create the binary dump from on the slave channel.