LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Data Recovery Problems (https://www.linuxquestions.org/questions/linux-general-1/data-recovery-problems-507662/)

wellington 12-05-2006 11:30 AM

Data Recovery Problems
 
I installed Windows XP to the first logical partition of my hard drive. I then installed KUbuntu 6.06 on the primary partition. After having troubles with my printer, I decided to go back to Windows, but I could not get there from grub, so I got impatient and re-installed Windows over its existing partition, but not before trying: fixboot, fixmbr, then finally fdisk /mbr. Once I had Windows working again I downloaded DiskInternals Linux reader (ttp://www.diskinternals.com/linux-reader/) I have used it successfully before. It recognized my ext3 partition, but would not read it beyond that. So I decided to install Linux over my windows partition. So now I have two linux partitions. However, linux does not recognize my other partition as ext3, but instead as NTFS. (No I did not overwrite the wrong partition, and even if I did, it should read still be able to read that partition.). It shows up as hda2, as it should, but it will not mount. I tried the mount -t ext3 /dev/hda2 /media/hda2 and I get "mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or other error" I also tried to mount it as NTFS - same error.

I searched the forum, but was unable to find a similar problem, even though many seemed to start out as a missing MBR.

Please help, there are some files that I need to get off this partition, and I am very worried that I am not going to have any success.

The error I get mounting it as an ext3 partition: (mount -t ext3 /dev/hda2 /media/hda2)
"[4296897.895000] NTFS-fs error (device sda2): map_mft_record_page(): Mft record 0xa is corrupt. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record(): Failed with error code 5.
[4296897.895000] NTFS-fs error (device sda2): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0xa as bad. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record_page(): Mft record 0x6 is corrupt. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record(): Failed with error code 5.
[4296897.896000] NTFS-fs error (device sda2): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x6 as bad. Run chkdsk.
[4296897.896000] NTFS-fs error (device sda2): load_system_files(): Failed to load $Bitmap.
[4296897.896000] NTFS-fs error (device sda2): ntfs_fill_super(): Failed to load system files.
[4296949.838000] VFS: Can't find ext3 filesystem on dev sda2.
"
The error I get mounting it as an NTFS partition: (mount -t ntfs /dev/hda2 /media/hda2)
"[4296897.895000] printk: 1 messages suppressed.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record_page(): Mft record 0xa is corrupt. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record(): Failed with error code 5.
[4296897.895000] NTFS-fs error (device sda2): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0xa as bad. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record_page(): Mft record 0x6 is corrupt. Run chkdsk.
[4296897.895000] NTFS-fs error (device sda2): map_mft_record(): Failed with error code 5.
[4296897.896000] NTFS-fs error (device sda2): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x6 as bad. Run chkdsk.
[4296897.896000] NTFS-fs error (device sda2): load_system_files(): Failed to load $Bitmap.
[4296897.896000] NTFS-fs error (device sda2): ntfs_fill_super(): Failed to load system files.
"

matthewg42 12-05-2006 11:41 AM

I'm not sue if it's still the case, because I've not had a windows installation since win98, but it always used to be that the advice was to install windows in the first primary partition and put Linux after it. I dunno, maybe XP is better at this sort of thing.

In any case it sounds like a right royal mess at the moment. Try booting from a knoppix livecd to recover your files (save them on a USB key - don't mount the hard drive read write at all). In future I'd recommend to backup everything before doing anything with partitions, boot loaders and so on.

If you don't have a good backup scheme in place, the time to get it sorted is now - never tomorrow. And never never never "after I've got this new OS installed and dual boot working". After you've done your backup test that you can actually restore files even if the whole system is hosed. This will probably mean that you must be able to get to the backup files from a secondary machine which doesn't have any special software installed.

pixellany 12-05-2006 01:51 PM

This is very confusing. I see commands with hdX and error messages with sdX.

First, tell us what kind of drive and the total number and type of partitions (use fdisk -l). Then replay the story with partition numbers---ie Windows on #2, Linux on #1, then Windows on #X---etc.

If you have valuable data anywhere in this, then clone the drive before trying any more fixes--or just go buy a new drive.

wellington 12-07-2006 03:42 AM

Ok,
Sorry about the confusion. I only have one hard drive, and hdX yeilds the same results as sdX does. Must be a symlink thing or something. Anyway, it is a SAMSUNG HD160JJ SATA drive.
This is what fdisk -l returns:

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 10443 83883366 83 Linux
/dev/sda2 10444 19256 70790422+ 83 Linux
/dev/sda3 19257 19452 1574370 82 Linux swap / Solaris

Windows XP started on /dev/sda2 as an NTFS partition. Linux was then installed on /dev/sda1. The problem with that was I could not get Grub to find my Windows partition. I put in my Windows disc, went to Rescue mode, and issued fixboot, fixmbr, then finally fdisk /mbr After that my computer did not boot in to anything, so I simply re-installed Windows on the partition it was previously on (sda2). Since then, I have been trying to get my data off the linux partition (sda1), first by using DiskInternals linux reader in windows, and then, by installing linux over my windows partition (sda2). Theoretically, I should have two working ext3 partitions now, but I cannot mount sda2 and retrieve my data. I am using KUbuntu 6.06, and its partition software saw sda1 as an NTFS partition. I don't know how that happened, but I figured that was the problem. However, now that I look at my "fdisk -l", it is listed as linux (as it should be). Still I cannot mount sda1, and retrieve data from the drive.

Update: The software 'testdisk' also detects sda2 as a linux partition, until 'proceed' is selected, which I suppose reads the disc in greater detail. For some reason the partition is then detected as an NTFS.

wellington 12-07-2006 10:20 AM

Problem Solved
 
Well, I "solved" my problem. At the suggestion of matthewg42 I set up Windows XP in the primary partition of my drive, then installed KUbuntu. The two seem to be co-existing nicely (fingers crossed). I'd like to thank all of you who attempted to help out. I appreciate the help, even though things didn't work out the way I had hoped.


All times are GMT -5. The time now is 04:26 PM.