Hardware :: Recovering Partition Table Using TestDisk And Sfdisk?

Jul 16, 2010

Something bad happened to my partition table,so right now I'm working from a Live CD. My partition table is completely screwed, although the data on the lost partitions hasn't been overwritten. I've been messing around with TestDisk for about an hour, but I still didn't figure out how to fix my problem. Before the crash, I had 5 partitions:

ext4 - 20GB

and here comes the extended partition:

linux swap - 8 GB
NTFS - 400GB

TestDisk can see all those five partitions. I can mark swap as Logical, but I can't do so with the 400GB NTFS partition - there is just no selection. Turning on "expert mode" didn't help. I have read about using sfdisk to fix partition table, but I don't think I'm able to do it by myself.

Here's how it looks in TestDisk:


Disk /dev/sda - 500 GB / 465 GiB - CHS 60802 255 63
Partition Start End Size in sectors
D HPFS - NTFS 0 1 1 3915 254 63 62910477
D HPFS - NTFS 3916 0 1 4959 254 63 16771860 [Windows XP]


I've filled sizes according to TestDisk's findings. First 3 partitions were OK, the problem lies in the extended partition holding 2 logical ones. By the way, TestDisk is able to enter the 400gb partition and see the files.

View 2 Replies


Installation :: Utility For Recovering Partition Table - Testdisk?

Oct 8, 2010

I had a tri boot of Win 7 /XP and Mint...I was using EasyBCD 2.0 as a boot manager...I booted Mint by configuring the NeoGrub option in Easy BCD..I wanted to uninstall Win 7 and so what I did was the following

1. Edited BCD bootloader settings ...Marked XP as my default and deleted Win 7 entry...

2. Logged out and wiped my Win 7 partition

With my fingers crossed , i rebooted but Easy BCD booted flawlessly with 2 choices XP and Mint(GRUB)...As Easy BCD is not meant for XP, I thought of restoring original NTLDR of XP so that things would be in place and thinking that this cud avoid problems of detection by other Linux OS I deleted manually the Easy BCD menu.lst file and NeoGrub.mbr in my root...That was it , after I rebooted, I got boot screen of EasyBCD but whichever option I select,I got an error message that address not Valid-NTLDR not found or something like that I booted my XP live CD and like many times before ran

3.bootcfg /rebuild

After that , now when I reboot , I am getting "Invalid Partition Table" On booting from a linux CD , I can see the files are in place..I have to get boot sector and partition table fixed...

View 2 Replies View Related

Ubuntu :: TestDisk - Incorrect Partition Table Detected

Apr 29, 2010

I'm not sure exactly how, but somehow one of my partitions was corrupted yesterday (GParted showed it as unallocated space). I tried using testdisk. It found the lost partition, so I happily let it rewrite the partition table. The lost partition did return, but then I found out another partition has disappeared (the one most important to me) and in its place there is an empty NTFS partition and an empty ext3 one (the original was an ext4.

The two new partitions seem to be those that were merged to form the ext4 partition). I tried testdisk again. When I run "testdisk /dev/sda" and choose "Analyse" the incorrect partition table is detected. I tried running "testdisk /dev/sda5" (sda5 is the NTFS partition) and it finds a partition labeled "magic" which is the name of the lost partition but testdisk cannot recover it. I get this:

TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>

Disk /dev/sda5 - 47 GB / 44 GiB - CHS 5823 255 63
The harddisk (47 GB / 44 GiB) seems too small! (< 75 GB / 70 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partition can't be recovered:
Partition Start End Size in sectors
Linux 0 1 1 9137 234 56 146800640 [magic]

EXT4 Large file Sparse superblock, 75 GB / 70 GiB
I tried deleting the second partition and moving the one after it so that there is 75GB available but it didn't help. I have lost worth of a year of my work. The worst thing that could ever happen to me!

View 5 Replies View Related

Ubuntu :: Reading Testdisk Log And Restoring Partition Table?

Apr 1, 2011

I ran testdick on a apple hard drive to find the tables. It looks like it found it, here's the log:


Tue Mar 29 12:02:56 2011
Command line: TestDisk
TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>


How do I restore the table using fdisk? Gparted doesn't let me check the drive. It just says unallocated space, create a table and erase all data.

View 3 Replies View Related

General :: Restoring Partition Table - 'Testdisk' Not Working?

Jan 27, 2010

I was having trouble creating a USB Startup Disk in Ubuntu and used the command:

sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1

This was a mistake as my USB flash drive was on /dev/sdc. If I am understanding this correctly, the command above deleted the MBR and the partition table. This disk had a single "/storage" partition on it. I googled a solution and found that the "testdisk" program seems to be the most popular solution for things like this. I ran it, selected an "Intel/PC partition" type, set the partition to a non-bootable primary Linux partition, wrote it, and rebooted.

Whenever I run:

sudo mount -t ext3 /dev/sdb1 /storage

I get:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

Dmesg shows the following:

[20246.273941] EXT3-fs error (device sdb1): ext3_check_descriptors: Block bitmap for group 1 not in group (block 0)!
[20246.279376] EXT3-fs: group descriptors corrupted!

When I run:

sudo fdisk -l /dev/sdb

I get:

Disk /dev/sdb: 400.1 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


View 4 Replies View Related

Ubuntu :: Difference Between Using GPT Partition Table When Formating Hard Drives And MS-DOS Partition Table?

Aug 6, 2010

Is there a difference between using GPT partition table when formating hard drives and MS-DOS partition table? What are the advantages/disadvantages of using either?

View 2 Replies View Related

Software :: Sfdisk Starts Partition From Sector 1 Instead Of 63?

May 1, 2011

Slackware 13.1,using "sfdisk".I need to use this one as it can be used in a non-interactive mode,"parted"is not a solution for me.Inside my own script I make the partition like this:


set `losetup -f`; dev=$1
`losetup $dev $out`
sfdisk $dev << EOF

However after formatting this single partition in FAT16 I can see the drive in my emulated Windows311, but not use it. It says that the drive cannot be accessed. When I do the same thing interactively with fdisk it all works. When inspecting the partitions in both cases via "fdisk -ul" I see that whenever sfdisk is used to create the partition it is created starting from the 1 sector. Whenever fdisk is used it is created from 63 sector (which is correct of course). How can I make my sfdisk start the partition not from the 1st sector, but also from the 63 so that OS wouldn't have problem with that?

I tried like this:


sfdisk -uS $dev << EOF

But it then just says that the partition does not end on the boundary. Trying to see the content with fdisk -ul says that partition table is incorrect. So doing it this way doesn't work.

View 2 Replies View Related

Ubuntu Installation :: Use "Testdisk" For Recovering Media On 10.04?

May 10, 2010

I have heard of a program recommended by dino99 "testdisk" Its in repos so to install in terminal:

sudo apt-get install testdisk
when installed just type:

sudo testdisk

in terminal to run, i've no idea how its used, though "(create) Create a new log file", then select drive seems the way forward how would i use this to recover a corrupted memory card / usb driv

View 3 Replies View Related

Ubuntu :: TestDisk Cannot Find Partition To Fix

Apr 27, 2011

I messed up a 500GB USB hard drive by confusing it with another drive, accidentally trying to erase it, realizing my error and pulling out the cable in panic. Running Testdisk has found no partitions to fix. Photorec can find most of my files but sorting them out again is going to take weeks. Are there any methods I can use to try and save my folders/file system on the HDD? I'm very much a novice as far as partitions and file systems go.

View 9 Replies View Related

Ubuntu :: Using Testdisk To Recover One Of Lost Partition?

Jan 21, 2010

I was using testdisk to recover one of my lost partition and when I rebooted my system it says , "error unknown filesystem ".I am giving a screenshot of gparted

View 7 Replies View Related

Ubuntu :: Possible To Recover Home Partition Using TestDisk?

Aug 30, 2010

I have stupidly and inadvertently formatted my home partition on my other system while trying to 'downgrade' to Ubuntu 9.10. I have isolated the hard drive and am currently using Testdisk to discover the partitions on there. The scan hasn't yet finished however it appears there are two entries of each partition.

Linux 0 1 1 4012 254 57 64468776
Linux 0 1 1 4012 254 57 64468776
Linux 4013 0 1 14032 254 59 160971296
Linux 4013 0 1 14032 254 59 160971296
Linux 9079 0 1 14032 254 61 79586008 [home]
Linux 9079 0 1 14032 254 61 79586008 [home]

When attempting the downgrade, I was wanting to keep the home folder (and root and swap) all at the same size. I am pretty sure I fouled up by trying to revert the file system type to ext3 from ext4. Which partition out of the two 'home' ones, I should be attempting to keep? I cannot see a difference between them but this is how testdisk has reported the drive. Apart from the standard 'back up everything next time' and more fitting for me 'pack up your PC and never use it again!', does anyone have any specific advice on recovering my original home partition?

View 1 Replies View Related

Ubuntu Installation :: Testdisk Can't Restore The Partition - Just Deleted

Aug 8, 2010

I tried to install Ubuntu next to XP. After restart - no XP and no Ubuntu. Something wrong with loader I guess, I see command line prompt (of the loader I guess).

So I restarted from liveCD. But no "Repair Install" option like in XP CD. So, I deleted partition to install again on top of old, then learned a loader possibly could be fixed.

So, the problem is: testdisk cannot restore partition I deleted. I didn't write on disk anything. May be swap space after couple reloads from liveCD corrupted it?

It complains "The harddisk (...) seems to small!", it sees some other partitions and doesn't see what Gparted and Disk Utility.

Let me know the best approach to get back XP running (having Ubuntu would be good too).

Here below are the screen captures for details.

Quich Search results. Can't recover what's found. Why 4 partitions are found? Notice, "The harddisk seems too small !" Could this be a problem? HDD is not Maxtor anymore

The gap is there but no deleted partition shown

Essentially same thing... going for deeper search

Deep Search hasn't recover anything new. And shows same results as Quick Search (2nd testdisc image )Hit "continue"...

Now the partitions shown as deleted because of overlapping. The partition to be recovered is still not in the list.

Anyway, my final goal is to get WinXP back and if possible, install Ubuntu. It's nice that installer still sees the XP. Too bad the loader doesn't. how to get it done.

Unlike during installation of XP, ubuntu doesn't offer to utilize the deleted partition. Is it going to stay empty/unallocated? Forget the empty space, will I get XP running if I continue and install?

View 9 Replies View Related

Hardware :: Testdisk Fails To Find Lost Partition?

Jan 12, 2010

I resized my root partition yesterday to make it include the unused 28GB at the end of my drive, but something went wrong and now I can't mount it again.. I think this has to do with the computer coming with Vista preinstalled and the partitions not being aligned to cylinders. This is what the partition table looked like before the resize (according to fdisk):


Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdec3533c


None of the last two partition schemes works, when I try to mount sda6 I get an error saying that the XFS superblock contains an invalid magic number. I've tried running xfs_repair on it, but even though it found a few secondary superblocks it couldn't verify them. I've tried running testdisk with the "Cylinder boundary" option set to "no", but it would not find my root partition... The log from the search is here I don't really care about the other partitions, all I need is my old root partition so that I can copy all the important stuff to another drive and then start from scratch with a new partition table (and remove the recovery partition aswell since I don't need it).

View 7 Replies View Related

Ubuntu :: Recover Lost Data From NTFS Partition Using Testdisk/Photorec?

Mar 8, 2010

My main partition having all my data like movies, music, files,etc has become inaccessible. Its file system was NTFS. Due to some recent resizing using GParted, the partition as well as my WIndows 7 OS has become unbootable due to some errors. The data partition's file system has become unknown. I don't care much about the OS but I would like to recover my drive. I am trying to achieve this using Testdisk and Photorec but haven't met with much success so far. The main problem is I can see my partition and all my files through Testdisk but I am not able to copy them to another drive. When I try to copy the option I get is of copying them to the DVD and not to any other partition.

View 4 Replies View Related

OpenSUSE Install :: Invalid Partition Table / Error Message Corrupt Partition?

May 20, 2010

I was installing opensuse 11.2 in parallel with windows xp.but during installation suddenly power has gone and after that opensuse is giving me the error message corrupt partition.i am also not able to login in xp. so I decide to reinstall windows, I got the error saying "invalid partition table" after the first restart of windows xp installation.

I tried to use windows system recovery console and committing fixmbr and fixboot commands, but didn't work.
i have 2 window partition(1 for windows and 1 for data).i do,nt want to format 2,nd partition.

How can I installed windows?My plan was first to install windows xp, then opensuse again.

View 2 Replies View Related

General :: Automating USB Drive Configuration Of Partition Table, Partition And File System

Jan 26, 2011

I have tried to automate the configuration of a usb drive with not much success.

The problem that I have is that I have a large amount of usb drives that have a partition table of type "loop" and I need to change them to "msdos". The size of the drives vary and I need to use FAT32 or FAT16 file system.

I've tried various partitioning commands and gui applications but cant find one that I can give a one line command to to set the partition table, maximum partition size and file system.

View 9 Replies View Related

Hardware :: Invalid Partition Table For Swap Partition That Moved With Gparted?

Feb 8, 2010

I was reading another thread about someone with a bad partition table and I decided to join this forum. I'm not going to take any drastic actions with the partition (/dev/sda3) in question. I am going to wait for instructions on what to do first. I am not very good with Linux and need some hand holding. System: DELL 4550 Dual-Booted with XP and Ubuntu. Works OK, just no swap. Well, here's what I did: I deleted a partition for Windows XP Pro because it was a trial, and it ran out. I then decided to slide the swap partition for the Ubuntu Linux that I dual-boot into over. (If this was successful, I was going to try expanding the root partition to take up the unused space.) I used Gparted on a CD to do this, as I figured it was safe to do.

I now cannot mount the swap space at bootup (and have to go into a backup version of the OS), although I can use Gparted in Linux to execute the "swapon" command, and it appears that it worked because I now see "swapoff" as an option on the context menu. (I actually don't even need a swap partition, except to hibernate.) If I highlight the swap partition and click on "Drive" on Gparted's menu bar and select "Create Partition Table", it will erase all data on /dev/sda, so how do I fix the bad partition table non-destructively?

View 14 Replies View Related

Slackware :: Changing Boot Partition / Bootable And Rewrite The Partition Table?

Apr 24, 2010

Everything is installed and setup on my system, but when I setup my partitions I chose my Windows partition to be bootable. Can I just use cfdisk to toggle the bootable flag so my linux partition is bootable and rewrite the partition table?

View 2 Replies View Related

Ubuntu :: Change Sda2 Partition To Ntfs - WARNING: The Kernel Failed To Re-read The Partition Table

Mar 27, 2010

I want to change my sda2 partition to ntfs type. i have installed GParted but it is returning a strange type of error. Here is the error dump file...


WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot. WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.

View 9 Replies View Related

Ubuntu :: Tell Kernel To Reread Partition Table While One Partition Mounted

Feb 5, 2010

Is there a program that will reread the partition table and update the kernel even if one of the unmodified partitions is mounted? I installed my system on one partition, then I added another with free space. Now I want to format the second partition, but the kernel doesn't know about it yet. I tried sfdisk -R /dev/sda, but it refuses while the root partition is mounted. Is there anyway I can avoid rebooting?

View 2 Replies View Related

General :: USB Flash Disk Partition Disappeared As Well As Partition Table?

Feb 17, 2011

USB flash disk partition disappeared as well as partition table I'm not sure about the cause


root@u# less /var/log/syslog
usb 5-1: New USB device found, idVendor=058f, idProduct=1234
usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0


Where did the partition table go? The device had one ext3 partition something around 4GB(size of USB storage device). I need to restore few files from this device.

View 3 Replies View Related

Software :: Cloning Partition To Different Laptop - Invalid Partition Table

Nov 19, 2009

I'm trying to clone a Linux install to a different laptop. It's made a little complicated by two facts:

1) The 'new' laptop I'm trying to copy my Linux installation to is actually older and has a smaller hard drive then the computer I'm copying from

2) The computer I'm copying from has both a windows and Linux installation; I only care about the Linux partition.

I figured I would copy only the Linux partition from my primary computer to the laptop, sense the laptop doesn't have a large enough hard drive to copy everything. So I used the DD commands to copy SDA3 (main Linux partition) from my main computer to SDA2 of my laptop. When I came back a few hours later I was surprise to find my laptop trying to reboot itself (I never turned it off). It would keep starting to reboot, failing, and restarting itself. Not too surprising sense its boot partition wasn't changed so it's trying to boot into centos when I copied a redhat partition to it.

The problem is that when I used a redhat boot disk the rescue mode was unable to find a Linux partition to mount. /dev/sda2 exists, but trying to mount it gets the complaint "No such file or directory". "fdisk -l" lists sda1 (the boot sector) and sda2. Sda2 is the correct size and reports Linux LVM for its system. But "fdisk -l /dev/sda2" gives the error message "Disk /dev/sda2 doesn't contain a valid partition table" Did I not clone the drive correctly, or was an error caused due to the boot sector not being copied yet (the laptops boot sector is smaller then my old computers, so I can't copy from old computer to laptop)? Can I salvage the laptops partition table somehow, or do I have to repeat the cloning process? And if I do have to re-clone my computer can anyone tell me what I did wrong the first time so it works this time? I don't care if I copy just the Linux partition or both windows and Linux. Even though my main computer has a larger hard drive I'm only using about half of its available space so it should be possible to copy both partitions if I could ignore the unused sections of the harddrive.

Edit: I used DD to copy a tiny part of the Linux partition from my laptop so I could look at it. Most of it is illegible binary of course, but I scrolled through till I found some text right near the beginning:


VolGroup00 {
seqno = 1


So it seems that the DD command did copy everything over to the laptop, which is good to know. I noticed that it says device="/dev/sda3" right in the middle of the code I just posted. The Linux section of my original computer was SDA3 but I copied it to partition SDA2 of my laptop. So is the problem because the boot partition is for the wrong device? I don't suppose if I modified that one line to say SDA2 it would be able to load correctly? (Not that I know how I would modify the line, short of using the DD command again).

View 8 Replies View Related

Ubuntu :: Partition Outside The Disk - Corrupted Partition Table?

Oct 5, 2010

What I believe has happened is that I've corrupted the partition table. Essentially one of my partitions' ending point exceeds the maximum number of cylinders/sectors on my drive.

Essentially I have the same problem as on the thread @ [url] but do not know how to fix this and am afraid to reformat/partition based on sectors without really knowing what I'm doing here.


When I try to look at SDA in GParted everything shows up as unallocated (though it's obviously not) and it says


View 2 Replies View Related

Ubuntu :: Partition Table To Remark Partition As BTRFS ?

Jul 29, 2011

In my efforts to resize my BTRFS Partition, I accidentally unmarked my BTRFS partition as being BTRFS, and can't mark it back as I can't find the numeric ID for BTRFS and how to apply.

View 1 Replies View Related

Fedora :: Recovering An Encrypted Partition?

Apr 8, 2010

I have been using fedora 12 for last 6 months, recently I bought an external USB hard drive of 320 GB capacity. I made 2 partitions using the Disk Utility in Fedora. I encrypted the first partition as it was supposed to hold a lot of sensitive data, and yes it did have. Now I had to change my OS to AV linux for some audio-video editing work which wasnt being done properly on fedora due to some issue beyond my knowledge. now the problem is my encrypted partition is not accessible in my new installation. I see an empty space on my /dev/sda1. although no change to partition data has been done and the data on the second partition /dev/sda2 is easily accessible. when putting the drive on automount, is does not ask me for the password and neither does it show me the data. I have tried fdisk and sme other utilities but have failed to get my drive unencrypted.

View 7 Replies View Related

Ubuntu :: Recovering Windows 7 From The Partition

May 1, 2010

I have a 64-bit HP G60 Notebook and I installed Ubuntu 10 The problem is that if i want to recover Windows 7 from the Partition I can i pressed Esc and selected Recovery but it said wrong filesystem then when booting Ubuntu i wend down to Windows Vista Loader and it opened HP Recovery but said there was a problem. I want to get Windows 7 back with all HP Factory software installed

View 9 Replies View Related

Debian :: Recovering Data From Deleted Partition

May 16, 2010

I was trying to delete a logical drive in windows xp and the damn disk management tool in windows not only deleted my other windows partition but also my linux /data ext3 partition. Now I have a unallocated space in place of these partitions. The data is still there but the entries in the partition table have been removed. So how do I recover my partition. I was trying to use the following tutorial. [URK]

I used the sudo parted /dev/sda -- and then rescue START END command and could get back the /data partition. But it gives me the following error while mounting the partition. mount: wrong fs type, bad option, bad superblock on /dev/sda7, missing codepage or helper program or other error. In some cases useful info is found in syslog - try dmesg | tail or so.

What does this mean. How to I fix this? Also when I try to recover my windows partition using parted it scans for a while and then does nothing. It doesnot ask for writing the lost partition in the partition table. What do I do?

View 3 Replies View Related

Ubuntu :: Recovering Files From NTFS Partition?

Apr 17, 2010

By mistake i have deleted few files from my NTFS partition,is it possible to recover all those files..?

View 9 Replies View Related

Ubuntu :: Recovering Files From Unbootable Partition?

May 2, 2010

After realizing 10.04 Final doesn't support Intel 855 graphics card the hard way (upgrading to 10.04 from 9.10), I did some very silly things and now cannot even choose past kernals or go into failsafe graphics mode (which had worked prior to this).Long story short I screwed up GRUB. Because I am an amateur end user.I still have the 10.04 live cd. Can I reinstall this to put GRUB back to the original state?

View 9 Replies View Related

Ubuntu :: Recovering Data From A Formatted Partition?

Dec 19, 2010

I just installed kubuntu 10.10, replacing an older installation. I have three hard drives one of which had all of the data I wanted to save, about 500gb. I repartitioned and formatted the other two drives and made sure that the data drive would be mounted but not formatted. When I booted into my new installation, the data drive was blank. I'm not sure if it's relevant, but I had just upgraded the file system from ext2 to ext4 before starting the installation.

I've been trying to recover my lost partition with testdisk. The website has instructions for recovering a formatted partition. It looks like it's working until the instructions tell me to choose Boot and RebuildBS, which I don't see as options. Can anyone give me any advice on how to recover? How did this even happen? Has anyone had a similar issue with installation?

View 1 Replies View Related

Copyrights 2005-15 www.BigResource.com, All rights reserved