Unknowingly Set My XP Partition as Linux Swap - Help?

Asked by trevor

I'm running a 3 OS System at the moment, (well, nearly...) on a 250g hard drive

sda1 is the stock HP windows vista partition (ntfs)
sda2 is a 35g partition with Ubuntu (journal3)
sda3 is the stock HP recovery partition (ntfs)
sda4 is a 45g Windows XP build partition (???)

I didn't do my homework before installing, so I thought I could use the free space in my XP partition as my linux swap. My thinking on this was uneducated, unclear, and I'd rather not get into it. Boot commands were set to be installed to sda2 (Ubuntu partition). I installed ubuntu, rebooted, and could not start into any operating system.

I diddled around with trying to edit the bootlog to get me into either windows vista or xp. My experience in this sort of thing is nil, so it wasn't long before I decided to try something else.

I popped back in my ubuntu live cd, and reinstalled this time with no swap partition. I'm now able to boot into ubuntu using grub. Grub recognizes vista, as well as vista recovery. However, sda4, my XP partition, does not show. If I try to boot into Vista, I get this error:

<windows root> \system32\hal.dll
is missing or corrupt
replace or reinstall or something. youre not getting into your computer.

Short of reinstalling windows xp, is there anything I can do to recover that partition?
It was never actively used as a swap partition. It was obviously not reformatted.

note: my sda values might be off. i dont remember if they start at 0 or 1.
note: if there's any information that might make answering this easier, Please say so!!

Thank you for your time<3

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
trevor (voterrwest) said :
#1

Also: I do not have installation discs for Vista (Cheap manufacturers fault) or XP (my fault for using a cheap build), so the option of using those restore programs to recreate my boot log is out.

Revision history for this message
trevor (voterrwest) said :
#2

:' (

Disk /dev/sda: 250.1 GB, 250059350016 bytes
240 heads, 63 sectors/track, 32301 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1549f232

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 19825 149876968+ 7 HPFS/NTFS
/dev/sda2 19826 24544 35675640 83 Linux
/dev/sda3 24545 25762 9208080 7 HPFS/NTFS
/dev/sda4 25763 31354 42275520 7 HPFS/NTFS

Disk /dev/sdf: 8000 MB, 8000004096 bytes
247 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot Start End Blocks Id System
/dev/sdf1 ? 50813 125353 570754815+ 5b Unknown

Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(50812, 15, 11)

Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(125352, 80, 51)

Partition 1 does not end on cylinder boundary.
/dev/sdf2 ? 11016 137438 968014120 65 Novell Netware 386

Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(11015, 93, 47)

Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(137437, 121, 42)

Partition 2 does not end on cylinder boundary.
/dev/sdf3 ? 122103 248525 968014096 79 Unknown

Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(122102, 184, 30)

Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(248524, 211, 39)

Partition 3 does not end on cylinder boundary.
/dev/sdf4 ? 188435 188438 27749+ d Unknown

Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(188434, 46, 25)

Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(188437, 200, 33)

Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you have a backup of the partition you can restore that easily. I suggest you install XP to a portion of the space so you can recreate the swap. You will need to reinstate the boot loader as XP will overwrite grub on the MBR

Revision history for this message
trevor (voterrwest) said :
#4

Unfortunately I have no backup for ANY of these partitions.

Revision history for this message
bcbc (bcbc) said :
#5

Please post the results of the http://bootinfoscript.sourceforge.net/ (post the results to http://pastebin.ubuntu.com and then return the pastebin address here).
Thanks

Revision history for this message
trevor (voterrwest) said :
#6

http://pastebin.ubuntu.com/618553/

Thank you.

A little history on the subject:
Partition 2 used to be a bad copy of windows that got stuck in the activation cycle, so I put a new build on partition 4. My bootloader previous to this goof gave me the options for Partition 4 windows, Partition 2 windows, and also a bad install on partition 4.

Revision history for this message
bcbc (bcbc) said :
#7

Good news is that you aren't currently "using" the swap. So maybe the underlying data is recoverable. I would install and run testdisk and see whether it can restore the underlying ntfs file system with all files intact.

e.g.
sudo apt-get install testdisk
sudo testdisk

Follow instructions here:
http://www.cgsecurity.org/wiki/Data_Recovery_Examples#Recovery_of_reformatted_partition

You might consider doing a block level backup of the partition before attempting recovery (taking an image copy of the partition).

PS even if testdisk can recover it may not be 'bootable' - sometimes when you install windows on a computer with an existing windows it will combine the boot files in the old windows partition.
But that's something you can worry about later I guess - first see if you can recover your data and restore the ntfs file system.

Revision history for this message
trevor (voterrwest) said :
#8

When I reach the step: List, which says If you can see your files, choose Write and confirm
I can not see my files.

Can't open filesystem. Filesystem seems damaged.

is what I can see.

Two steps previous, however, I see this information, which makes me think it may be possible to restore from the backup boot sector:

Disk /dev/sda - 250 GB / 232 GiB - CHS 30401 255 63
     Partition Start End Size in sectors
 4 P HPFS - NTFS 24246 150 1 29509 164 63 84551040

Boot sector
Status: Bad

Backup boot sector
Warning: Incorrect number of heads/cylinder 240 (NTFS) != 255 (HD)
Status: OK

Sectors are not identical.

The in-between step, after selecting RebuildBS, tells me this: (kinda redundant)

Disk /dev/sda - 250 GB / 232 GiB - CHS 30401 255 63
     Partition Start End Size in sectors
 4 P HPFS - NTFS 24246 150 1 29509 164 63 84551040

filesystem size 84551040 1
sectors_per_cluster 8 0
mft_lcn 2 0
mftmirr_lcn 21618 0
clusters_per_mft_record -10 0
clusters_per_index_record 1 0
Extrapolated boot sector and current boot sector are different.

Should I give restoring from the backup boot sector a go?

Revision history for this message
bcbc (bcbc) said :
#9

At this point, if you have unbacked up data, I'd use photorec to extract them. Photorec comes with testdisk and can retrieve data regardless of the underlying file system.

Or you can try some alternative recover media. Unfortunately I'm not an expert on these - but I have used testdisk and photorec successfully before.

PS since this isn't a Wubi issue I've move you back to the general Ubuntu category and maybe some other people will be able to help.

Can you help with this problem?

Provide an answer of your own, or ask trevor for more information if necessary.

To post a message you must log in.