Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
The best I can tell, testdisk has detected partitions that have since been resized and partially overwritten (which is why some can't show files... they start in an area that has since been overlapped). I can make a guess which ones are correct, but it is only a guess... I'm not there so I can't really be sure of this.
Code:
Disk /dev/sda - 320 GB / 298 GiB - CHS 38914 255 63
Partition Start End Size in sectors
D FAT32 LBA 0 1 1 33002 254 63 530193132 [NO NAME]
D HPFS - NTFS 0 32 33 21939 13 42 352448848
D HPFS - NTFS 0 32 33 33002 177 7 530186240
D HPFS - NTFS 0 32 45 32676 254 63 524953945
When i select the above partition and type p to list files, i get the message that I can't open file
D Linux 21940 0 1 23854 254 60 30764472
D Linux 23855 1 1 32485 254 63 138656952
D Linux 28158 0 1 36788 253 63 138656952
can't open the above either
D Linux Swap 32486 1 1 33001 254 42 8289456
D Linux 32677 2 1 32980 254 61 4883632
D Linux Swap 32981 1 1 33001 254 41 337280
D HPFS - NTFS 33002 209 40 36987 37 42 64008192 [LENOVO]
* HPFS - NTFS 36987 37 43 38899 129 14 30722048
That's six likely candidates for for partitions, and only four primary spots. That means at least three of these partitions are logical, and it's not the bootable one at the end (confusing, some BIOS still can't boot past the 1024 cylinder).
My guess on the original structure is as follows (and yes, this is in almost backwards order in the partition table):
Code:
sda1: NTFS 0 to 21939 Primary
sda2: NTFS 36987 to 38899 Primary Bootable
sda3: NTFS 33002 to 36987 Primary
sda4: Ext'd 21940 to 33001
sda5: Linux 21940 to 23854 (probably /)
sda6: Linux 23855 to 32485 (probably mounted /home)
sda7: Swap 32486 to 33001
I have ignored the detected partition between the swap locations under the suspicion that it is something that got left in swap space at around the time of whatever caused this problem.
I could be wrong though.. I'm exploring another possibility:
Code:
sda1: NTFS 0 to 32676 Primary
sda2: NTFS 33002 to 36987 Primary
sda3: NTFS 36987 to 38899 Primary Bootable
sda4: Ext'd 32677 to 33001
sda5: Linux 32677 to 32980
sda6: Swap 32981 to 33001
Edit: I don't think this second one is the case because of your comment about not being able to read files from one of the partitions in this scheme. That would imply that maybe this was the scheme prior to a resize operation, but is no longer valid. /Edit
I think the tell tale would be what files can actually be read from whatever locations. It's hard here, since there's really no way for the program to be sure, so how can we?
If you restore the partition table as I have written, I'd suggest you at least back up (as a raw image file) the individual partitions, including the swap, so you can have something for recovery programs (like photorec) to work with, prior to attempting to boot from the hard drive. Otherwise you may suffer irreversible data loss (especially if we choose the wrong structure). 360GB is a lot of space, you're probably best off using an external hard drive if you can afford it.
Thank you for that, I've made some adjustments to what I think is the correct partition table based on what you showed me.
Code:
sda1: (07)NTFS 0 to 21939 168GB Primary Bootable [Windows]
sda2: (17)NTFS-H 36987 to 38899 14GB Primary [Recovery] (has the factory drive image)
sda3: (07)NTFS 33002 to 36987 30GB Primary [Lenovo] (windows drivers disk)
sda4: (05)Ext'd 21940 to 33001 84GB
sda5: (83)Linux 21940 to 23854 14GB Logical (I don't know where this was mounted, clean slate)
sda6: (83)Linux 23855 to 32485 66GB Logical (/)
sda7: (82)Swap 32486 to 33001 4GB Logical
Like I said, I haven't used testdisk, but I'm thinking that you can use the T option to change the types to the numbers I listed (the NTFS-H is hidden NTFS.. only booted when you want to restore the computer to factory condition) and the L/R arrows to undelete the specific partitions underlined a couple posts above.
Note: You might have to Add the extended partition.
Since sda2-3 are not separated on cylinder boundaries, I'd suggest you do as much of the recovery from testdisk as you can. Using other tools (like fdisk) at this stage would probably result in making those windows partitions unreadable.
Once you have the partition table redefined, doing a raw image backup can be done with various tools. I prefer cat in this situation (it doesn't get more raw than that). It would work something like:
cat /dev/sda1 > /media/backup/partition1.img
and so forth (skipping 4, since that's a container) until the partitions are all backed up as raw images. This way, if the internal hard drive totally goes kafluey on boot and you have to start from scratch, you can sic a recovery tool on the image files and restore to the local hard drive.
need to clarify just when you get error 17. During grub loading or do you get grub menu and error after selecting OS to boot ?
If it is after OS selection post the menu.lst.
After this is fixed and you try to boot into XP, do not let it do auto check disk. If you made a wrong guess at partitions and check disk runs it will convert files to 'found.0xx' and you will be bad off.
I believe the windows partitions are all correct, it appears you have chosen not to restore the empty 14 GB (21941-23856) partition at this time. This is okay for now, but you should keep it in mind; you may want to recover that space for use somehow in the near future.
The grub issue can probably be repaired automatically with Supergrub. It comes with the Parted Magic CD, just select SuperGrub at the boot menu.
AFA the windows scandisk (or chkdsk), it will have to be done anyway, but don't let it at boot; set it up to do the scan interactively (do not automatically fix errors) to avoid the problem LostFarmer's talking about. You might also consider running a disk utility from a Windows BartPE boot CD (e.g. Ultimate Boot CD for Windows).
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe