how to restore a Partition which does not start on physical sector boundary.

Asked by Gabor Vas

This is a laptop with stucked CTRL key, kubuntu12.04 and win7 dual boot, grub 1.99 So I tried to do something about win7. win7 recovery messed my partitions up, even i haven't chose any option to do, just wanted to exit.
Now my linux data partition looks messed up hard.
Is there anyway to restore data from sda4 which appears? Or can I reflag it? Partition editor says it's unallocated.

ubuntu@ubuntu:~$ sudo fdisk -lu

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x47367329

   Device Boot Start End Blocks Id System
/dev/sda1 2048 31459327 15728640 27 Hidden NTFS WinRE
/dev/sda2 * 31459328 31664127 102400 7 HPFS/NTFS/exFAT
/dev/sda3 31664128 285570377 126953125 7 HPFS/NTFS/exFAT
/dev/sda4 285571070 625141759 169785345 5 Extended
Partition 4 does not start on physical sector boundary.
/dev/sda5 617058304 625141759 4041728 82 Linux swap / Solaris
ubuntu@ubuntu:~$ sudo sfdisk -d
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 2048, size= 31457280, Id=27
/dev/sda2 : start= 31459328, size= 204800, Id= 7, bootable
/dev/sda3 : start= 31664128, size=253906250, Id= 7
/dev/sda4 : start=285571070, size=339570690, Id= 5
/dev/sda5 : start=617058304, size= 8083456, Id=82

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gabor Vas (cognac-gamma) said :
#1

testdisk /list
TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <email address hidden>
http://www.cgsecurity.org
Please wait...
Disk /dev/sr0 - 3479 MB / 3318 MiB - CHS 1699094 1 1, sector size=2048

Disk /dev/sr0 - 3479 MB / 3318 MiB - CHS 1699094 1 1
     Partition Start End Size in sectors
Invalid NTFS or EXFAT boot
 1 * hid. HPFS/NTFS 64 6796375 6796312
 1 * hid. HPFS/NTFS 64 6796375 6796312

Warning: Bad ending sector (CHS and LBA don't match)

Revision history for this message
Thomas Krüger (thkrueger) said :
#2

There is obviously an extended partition of 165GB missing between block 285571070 and 617058303. There is a chance of getting some data back. But ut should be rather hard to recover the complete partition with all metadata.

Revision history for this message
Gabor Vas (cognac-gamma) said :
#3

I managed to find all my files with testdisk, it offers me to save it to /home/Documents while i'm on live cd, so i just need to find out how to do that, any advice appreciated, i'll post it here if i find it out.
Isn't it a security issue that a win7 dvd can ruin grub?

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

If you install Windows after Ubuntu it will blindly write to the MBR. This is normal as th Windows installer is garbage

Revision history for this message
Gabor Vas (cognac-gamma) said :
#5

Dear actionparsnip,

i had both OS installed properly, just that I placed that bloody win7 dvd in (I didn't chose any option just told it to exit and reboot), ruined grub re-falgging partitions as you can see above. Now testdisk is running for 2 days copying files (very slowly but successfully), I'm unsure how to cancel that job as I wish not to lose files (metadata has no importance for me, I'll reinstall the whole computer).

Can you help with this problem?

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

To post a message you must log in.