1

Topic: Can GParted help recover my NTFS?

I used to have Vista dual booted with XP on two hard drives in RAID 0. Both drives were NTFS. I reformatted my XP partition, shrunk it and expanded the vista partition, and tried to install Ubuntu on the now-empty XP drive, but somehow it managed to partly rewrite the reiserfs file system over my entire drive even though I'm positive only the other was selected. It destroyed my NTFS file system and my computer will not boot except for this 8.04 Ubuntu Live CD I'm using.

Anyway, I tried the Vista recovery stuff a few times with little luck. When I went back to Ubuntu and checked GParted, It is now reading my old XP partition and data on it, but sees my ex-Vista partition as unallocated. Is there a way to recover this?

I've tried using the testdisk utility but it's over my head and I don't really know how to repair my file system.

By the way, I'm using dmraid to allow GParted to read my RAID 0 setup. It read it fine before.

http://img393.imageshack.us/img393/5274/screenshot1yp7.png
http://img393.imageshack.us/img393/screenshot1yp7.png/1/w1022.png

2

Re: Can GParted help recover my NTFS?

I would think to testdisk. GParted can't really recover partitions, it works on good, healthy partitions (it usually doesn't proceed if something wrong is detected).
Obviously something went wrong during the ubuntu install process. Anyway, I think that reiserfs isn't a default Ubuntu choice (at least for older Ubuntu versions).
If data on the previous vista partition were already overwritten, it makes even harder and less probable the partition recovery. If only the partition table was damaged, then it woiuld be possible to find the real partition entries using testdisk.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3 (edited by Metallibus 2008-10-04 10:51:45)

Re: Can GParted help recover my NTFS?

The install gave me an error right at the start. It said there was some problem writing the file system. It was within about 30 seconds or so, so I can't imagine it formatted that quickly.

When I tried the vista startup recovery, it said things like attempting to repair partition table, but it never seemed to do much.

I was trying to follow directions given by others that led me to picking reiserfs.

Anyways, I posted a much more detailed thread on the ubuntu forums, but its very long (http://ubuntuforums.org/showthread.php? … ost5903824)

I'm trying to mess around with testdisk, but I don't really know how to go about using it or what to do with it.

Any guidance would be greatly appreciated, My apologies for the other post being so long =X


EDIT: I followed these instructions I found on another page:

Recovery of reformated partition

If the partition has been reformated to another filesystem (FAT32 formated as NTFS or vice-versa),

    * run TestDisk,
    * select the harddisk, the partition type
    * choose Advanced
    * select the partition
    * choose Type,
    * enter the value corresponding to the previous filesystem
    * choose Boot
    * choose RebuildBS
    * List
    * If you can see your files, choose Write and confirm
    * In Analyse, choose to rewrite the partition with the correct partition type.

But I don't see my files there - the only partition it seems to recognize is a piece of the old xp one and theres only one file there labeled system volume information.

4

Re: Can GParted help recover my NTFS?

Hi!

Metallibus wrote:

The install gave me an error right at the start. It said there was some problem writing the file system. It was within about 30 seconds or so, so I can't imagine it formatted that quickly.

A hard drive can be "formatted" even faster than this.
What Windows calls "formatting" is in fact a two-stage process:
1. scan the whole partition for unreadable sectors (which can take hours to complete);
2. build a file system on the partition, using the bad sectors list from step 1 (which is complerted within a  few seconds).
Since modern hard drives always keep a number of "spare blocks" that you can't use yourself to store data in, and since these "spare blocks" are automatically used as a backup if one of the "regular" sectors turns oput to go bad, step 1 is mostly unnecessary - except for hard drives that are so close to the trash that you better not put any valuable data on them. Thus, Linux skips step 1 by default (it is performed only if you explicitly request it) - and as a result, "formatting" on Linux is much faster than on Windows.

Anyways, I posted a much more detailed thread on the ubuntu forums, but its very long (http://ubuntuforums.org/showthread.php? … ost5903824)

I haven't read this thread, but from your description I conclude that you did a lot of write operations on your hard drive since the error occurred. Each write access could destroy a part of what's left of your old file system and data - and together with the different ideal Windows and Linux might have about your RAID, I fear you won't have a great chance to recover anything.

I think your "RAID" controller was the root of all your trouble: The "RAID" controllers found on many mainboards are not necessarily well-supported on Linux. On the one hand, hardware vendors seem to be a bit afraid to publish the specifications for their products - but it is these specs that describe the interfaces to the product and how to use them, so without these documents, writing a driver for a piece of hardware is very difficult. Imaging buying a car, but the vehicle manufacturer has not built in a steering wheel, pedals and the other knobs and lever you usually find in a car, but has invented some fancy way the driver should operat the car - but you as the driver don't get a manual telling you how to do this... roughly the same situation.
On the other hand, these "RAID" controllers are usually barely more than a regular UDMA or SATA controller, equipped with a special firmware that hooks up with the BIOS routines (so the drives behind this controller can be accessed via the standard BIOS interfaces) and provides routines to read and write data from a RAID - but since all this is done via the BIOS hooks, the code required to distribute data across hard drives, calculate checksums, rebuild a faulty array etc. runs on the CPU. And since Linux has a reliable software RAID layer (that can use any hard drive or partition, no matter to which controller it is attached - in theory, you could take a SCSI, a SATA and an UDMA drive and put a RAID 5 on them) built into the kernel, there's no real need to support vendor-specific solutions.

5

Re: Can GParted help recover my NTFS?

I haven't really done any writes to the drive, until I attempted vista recovery and just now a chkdsk. Testdisk was finding other partitions, and lots of them, some of them with readable files, though none of them were my files (mostly looked like dos stuff or something? Now testdisk isn't really finding anything so I think it's gone.

So is there a way to install Ubuntu on a RAID or not?

The raid I'm using is just a software RAID (Intel Matrix Storage Manager).

6

Re: Can GParted help recover my NTFS?

Hi!

Metallibus wrote:

I haven't really done any writes to the drive, until I attempted vista recovery and just now a chkdsk.

Just one single write to a drive containing a jammed partition structure or file system can be too much! Overwrite one sector (or even a single bit) at the wrong place, and your chances to recover any data diminish rapidly. This is why for data forensics (as well as for data recovery!), the first step is to create a sector-by-sector copy of the disk thet is being examined: If you do anything wrong, you damage only the copy, so you can still create another copy from the still unchanged original.

Testdisk was finding other partitions, and lots of them, some of them with readable files, though none of them were my files (mostly looked like dos stuff or something?

Many of the Windows system files look like DOS stuff - so maybe you've just seen these.

Now testdisk isn't really finding anything so I think it's gone.

I don't know how testdisk works. To be sure, you can use gpart to do another scan for lost partitions on your hard drive.

So is there a way to install Ubuntu on a RAID or not?
The raid I'm using is just a software RAID (Intel Matrix Storage Manager).

In principle, any Linux distribution can be installed to a RAID (which can require some manual work, depending on the RAID level that you wish to use), but this will usually be the Linux kernel-based RAID driver (or a "real" RAID controller that completely hides the drives behind itse f from the operating system and instead presents the system with a the arrays defined in teh controller's BIOS). I don't know if the Intel Matrix RAID is supported - sorry.