Size boot_sector bigger than partition

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
rafah1982
Posts: 2
Joined: 29 Sep 2014, 22:06

Size boot_sector bigger than partition

#1 Post by rafah1982 »

Hi,

I was installing fedora 20 with dual boot with windows 7, and after I resized the win partition, windows stopped booting. The system repair didn't work, as well as other options such as bootexec /rebuildbcd.
In fact, while doing those things, I made things worse and now neither grub nor the windows bootloader recognize any windows partitions.

So I downloaded testdisk and ran it from fedora, and I see this:

Code: Select all

TestDisk 7.0-WIP, Data Recovery Utility, August 2014
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Windows RE(store)        0  32 33  2349 223 50   37748736
 2 * HPFS - NTFS           2349 223 51  2362 159 37     204800
Error: size boot_sector 918353505 > partition 906389504
Invalid NTFS or EXFAT boot
 3 P HPFS - NTFS           2362 159 38 58782 194 36  906389504
 3 P HPFS - NTFS           2362 159 38 58782 194 36  906389504
 4 E extended             58782 194 37 60801  80 63   32428080
 5 L Linux                58782 227  6 58846 161  3    1024000
   X extended             58846 161  4 60801  80 15   31401984
 6 L Linux LVM            58846 193 36 60801  80 15   31399936



*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
>[Quick Search]  [ Backup ]
                            Try to locate partition
Take a look at:
2 * HPFS - NTFS 2349 223 51 2362 159 37 204800
Error: size boot_sector 918353505 > partition 906389504
Invalid NTFS or EXFAT boot


Apparently, when rezising the windows partition there was an error in which the boot sector says the partition is bigger than it really is, making it impossible to mount from linux and no bootloader can "see" the partition.

Any ideas on how to fix this?
I thought about resizing the partition to the number of sectors it shoud have according to the boot sector. Another option would be to tell the boot_sector the actual number of sectors that the partition has.
Of course, i have no idea on how to do either.

I would avoid formatting the partition by all means, given that there there is info that i would not like to loose.

Anyone had this issue before??

Thanks a lot!!

User avatar
Fiona
Posts: 2835
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Size boot_sector bigger than partition

#2 Post by Fiona »

What's the current size of your partition?
Did you run Deeper Search?
Might be possible that your previous partition would be found?
Also you can check each found partition and pressing p to have a try to list your files.
A boot sector diagnose using RebuildBS makes only sense if you have an appropriate partition which can contain your data.
Please repeat your diagnose and copy and paste the content of your testdisk.log.

Fiona

rafah1982
Posts: 2
Joined: 29 Sep 2014, 22:06

Re: Size boot_sector bigger than partition

#3 Post by rafah1982 »

Hi, Thanks Fiona for the reply.

I partially fixed by running ntfsfix on fedora.
Now the boot sector size matches the partition size and I can mount it with no issues and use my windows files from fedora.

However, I cannot boot it. I believe that when I was trying to solve it through the windows repair system, I destroyed the BCD and the MBR.

I used bootinfoscript and i got this result:

Code: Select all

============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img, but core.img can not be found at this 
    location.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /BOOTMGR /BOOT/BCD

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr

sda3: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /Windows/System32/winload.exe /ubuntu/winboot/wubildr 
                       /ubuntu/winboot/wubildr.mbr

sda4: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info: 

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        /grub2/grub.cfg

sda6: __________________________________________________________________________

    File system:       LVM2_member
    Boot sector type:  -
    Boot sector info: 

fedora-swap': __________________________________________________________________

    File system:       
    Boot sector type:  Unknown
    Boot sector info: 
    Mounting failed:   mount: unknown filesystem type ''

fedora-root': __________________________________________________________________

    File system:       
    Boot sector type:  Unknown
    Boot sector info: 
    Mounting failed:   mount: unknown filesystem type ''
mount: unknown filesystem type ''
I want to boot /dev/sda3 that is my windows 7 system.

Any help?

Thanks!!

User avatar
Fiona
Posts: 2835
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Size boot_sector bigger than partition

#4 Post by Fiona »

Nice to read that you didn't loose any data.
I'd need info from testdisk Analyse.
Either log file or screen shot?
It's your current partition structure/table.
So I can judge your current situation and suggest something to make your system bootable.
Perhaps it could be necessary to set your MBR back to standard, so that you can reinstall or repair Grub or using EasyBCD under Windows to configure multiboot.
If windows doesn't want to start, it might be possible that you have to run a windows startup repair.
http://pcsupport.about.com/od/toolsofth ... repair.htm

Fiona

Locked