LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-23-2007, 04:41 AM   #1
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Rep: Reputation: 16
About data recovery


I have an ext3 harddisk. Due to some unknown reasons, two partitions of it can no longer be mounted by the system, and give me an error message on loading GRUB.

Now it is hopeless to rescue the system. I just want to get back some important data. Are there any software to retrieve data from a partition of damaged filesystem (ext3)?

Thanks a lot.
 
Old 10-23-2007, 07:52 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Quote:
Now it is hopeless to rescue the system.
Not necessarily.

First, it's time for a change of mindset. If you come from the M$windows world, you are used to having to reinstall windows because windows doesn't provide the tools to make system repairs such as are available with Linux. You are used to thinking in terms of data recovery instead of system repair.

In the Linux world, unless you do something as root that damages the system, you can probably repair it, if you know what to do. If you don't know what to do, and are still fresh from the windows world, you will probably do the windows thing and think you need data recovery software, or that you need to reinstall.

Also in the Linux world, you shouldn't need data recovery tools, and you shouldn't need to reinstall, until you have used available tools to prove that data recovery or reinstallation are necessary.

Now to the proving the need for data recovery, or finding the repair to make the two partitions mountable.

Boot from a liveCD.

Check the file /etc/fstab (in the running OS) to see if the liveCD wrote anything for the two problem partitions, such as device names and mount points.

If they are not there, them make two mount points in the /mnt directory for the two partitions. In a terminal: mkdir /mnt/part-1; mkdir /mnt/part-2.

Run 'fdisk -l' (without quotes) to get the device names for the two partitions.

Mount the two partitions:
mount /dev/hdax /mnt/part-1
mount /dev/hday /mnt/part-2

where hdax if the first problem partition, and hday is the second.

Open your file manager and go to /mnt/part-1. Do you see files listed? If so, the partition is mountable.
Go the /mnt/part-2. Do you see files listed? If so, the partition is mountable.

The problem now comes down to this question: Why won't these two partition mount on boot?

At this point, you can try this:
Unmount the two partitions:
umount /dev/hdax
umount /dev/hday

Note: that's u-mount and not un-mount.

Run 'fsck /dev/hdax' followed by 'fsck /dev/hday' to see if fsck can repair the mountablity of the two partitions. Fsck must be run on unmounted partitions.

Shut down the liveCD, and reboot.

Take copious notes, copy the output of fdisk -l. Come back with more info on your partition setup, the output of fdisk -l, and any error messages you get along the way.
 
Old 10-23-2007, 11:33 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Wouldn't ddrescue (on a live CD) do the job?
 
Old 10-23-2007, 03:56 PM   #4
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
Thanks Bigrigdriver

To Bigrigdriver,

Thanks very much for your help. But I met problems during the process. When I follow your procedure until the mount step, the system said that I must specify the filesystem type in order to mount. So I added "-t ext3" into the command. Then it said that it could not detect any ext3 filesystem. But I am sure that my filesystem is an ext3 one...

What should I do?
 
Old 10-24-2007, 05:09 AM   #5
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Rep: Reputation: 17
Try this:
file -s /dev/hdxx <-- thats the name of your partition

Does it say something like this:
Linux rev 1.0 ext3 filesystem data

Also, some utilities to look at:

e2image
debugfs
badblocks
dumpe2fs
e2fsck

I've never used these, so all I can say is RTFM (man pages )

Last edited by kinetic; 10-24-2007 at 05:11 AM.
 
Old 10-24-2007, 07:22 AM   #6
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249

Rep: Reputation: 30
Did you try mounting them with '-t auto' instead?
 
Old 10-26-2007, 10:42 AM   #7
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
To Mickyg and kinetic,

I've tried "file -s /dev/sdb3". But it failed to give me the fs information.

I've tried also "mount -t auto /dev/sdb3 /mnt/sdb3". Still it gave me an error message about "bad superblock"

So what can I do next?

Thanks very much for giving me help to save my partition!!!
 
Old 10-26-2007, 06:54 PM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Uhm... this is the first time I see you are using a SCSI disk (or is it SATA?)

Try (as root)
cfdisk /dev/sdb

Are you able to see the partition table on the screen?

Do you see partition #1 and #2 being listed as ext3?

Whatever you do in that screen, DO NOT CHANGE ANYTHING AND DO NOT PRESS THE WRITE BUTTON!

You don't want to change anything, not just to 'try and see'. This is a dangerous tool, but the only one I can come up with quickly, and I would approach this problem myself like this.

jlinkels
 
Old 10-27-2007, 09:18 AM   #9
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
Sorry to hijack this thread but I was hoping to get some advice from a similar problem I am having with a SATA drive.


My thread is located here http://www.linuxquestions.org/questi...ailure-591556/


If anyone can help me I would appreciate it. I am hesitant to try any steps found in this thread on my problem till someone tells me its ok. I would like to try to salvage as much data off my drive as possible.


thanks!
 
Old 10-27-2007, 10:49 AM   #10
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Bigrigdriver, nicely done.

lawrence_lee_lee, since you can't mount the partitions, there is a problem with the filesystem (but you knew that).

You now have several choices. First of all, try fsck. You need to do this on an unmounted partition anyway. man fsck to learn the details, but basically you would start with the command fsck /dev/sdb3.

If fsck gets you nowhere, then do an fdisk -l /dev/sdb and post the results here. There could be problems in your partition table.
 
Old 10-28-2007, 09:07 AM   #11
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
results of "fdisk -l ..." and "cfdisk ..."

I tried "cfdisk /dev/sdc3" (it become sdc because I plug into another linux machine to do the job), it did gave me some information as below:

==========================
cfdisk 2.12r

Disk Drive: /dev/sdc
Size: 250059350016 bytes, 250.0 GB
Heads: 255 Sectors per track: 63 Cylinders: 30401

Name Flags Part Type FS Type [Label] Size (MB)
sdc1 Primary Linux swap / Solaris 8192.38
sdc2 Primary Linux ext2 30721.43
sdc3 Primary Linux 184320.30
sdc4 Primary Linux ext2 26822.64
===========================

I also ran "fdisk -l /dev/sdc", it gave:

===========================
Disk /dev/sdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sector/tracks, 30401 cylinders
Unit = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 996 8000338+ 82 Linux swap / Solaris
/dev/sdc2 997 4731 30001387+ 83 Linux
/dev/sdc3 4732 27140 180000292+ 83 Linux
/dev/sdc4 27141 30401 26193982+ 83 Linux
===========================


I've also tried fsck "/dev/sdc3", it gave:

===========================
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
Couldn't find ext2 superblock, trying backup blocks...
ext3 recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
/dev/sdc3: recovering journal

fsck.ext2: Bad magic number in super-block while trying to re-open /dev/sdc3
Warning... fsck.ext2 for device /dev/sdc3 exited with signal 11.
===========================


What can I do?? I am very worried...
 
Old 10-28-2007, 02:00 PM   #12
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
If the drive is supposed to be an ext2/ext3 drive, rather than fsck, try e2fsck. You also should do a man e2fsck to learn about the options, and you might want to force it to run (the -f option).

fsck is supposed to invoke the correct file system repair program, but if it can't tell then it will fail to run. When you run e2fsck, you are saying "this drive has the ext2/3 file system on it; this is the proper utility to use".

Also, in Post 7 you referred to drive sdb and in post 11 you referred to drive sdc. Which is it?

The partition table listed by the flavors of fdisk looks reasonable; your problem isn't there unless something wrote a bogus (and fully consistent) partition table into your bootblock.

Last edited by jiml8; 10-28-2007 at 02:07 PM.
 
Old 10-28-2007, 10:06 PM   #13
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
I've mentioned in my post 11 line 1 that, "...it become sdc because I plug into another linux machine to do the job...". Therefore, it become the sdc rather than sdb.

You said that my partition table looks reasonable. Doesn't this mean that it may be possible to recover my file system? Can I get back my files? If yes, that's sooooooooo good!!

Thanks a lot! You give me hope! I will try it out, e2fsck.
 
Old 10-29-2007, 10:16 AM   #14
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by lawrence_lee_lee View Post
I've mentioned in my post 11 line 1 that, "...it become sdc because I plug into another linux machine to do the job...". Therefore, it become the sdc rather than sdb.
OK

Quote:
You said that my partition table looks reasonable. Doesn't this mean that it may be possible to recover my file system? Can I get back my files? If yes, that's sooooooooo good!!
Well, there is no obvious systemic reason why your file system can't be accessed. Can you recover it? That just depends on what has happened to it. If it is any of the "ordinary" problems, then e2fsck should fix you up. If you, for instance, deleted it by mistake or overwrite it using dd, then probably not.

Quote:
Thanks a lot! You give me hope! I will try it out, e2fsck.
Good luck.
 
  


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
LXer: Linux Data Recovery on Windows - Is possible through Disk Doctors Linux Recovery Software LXer Syndicated Linux News 0 10-22-2006 12:21 PM
Data Recovery scbops Linux - Security 4 04-24-2006 05:51 AM
data recovery batev Slackware 7 04-10-2006 02:14 PM
data recovery possible? darkleaf Linux - Software 1 02-05-2005 12:33 PM
data-recovery lobo Linux - General 3 01-24-2002 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:10 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