PDA

View Full Version : [SOLVED] Messed up GRUB after upgrading 10.10 to 11.04



lamb123
March 7th, 2011, 02:00 PM
So, I had Win7 and Ubuntu 10.10 in dualboot and after upgrading to 11.04 I managed to screw up GRUB, it didnt boot into Win7 anymore. After that I got rid of both ubuntu and swap partitions and merged them to Win7 partition via Gparted and made a clean installation of 10.10 again next to existing Win7 hoping to fix GRUB and be able to boot into Win7, but now when I try to boot into Win7, I only see '_' blinking on top left and nothing happens, Ubuntu works fine.

Halp?

Hakunka-Matata
March 7th, 2011, 02:33 PM
Download and run the bootinfoscript in my signature. Post results.

lamb123
March 7th, 2011, 02:41 PM
Boot Info Script 0.55 dated February 15th, 2010

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

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for (,msdos5)/boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD /grldr

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe /boot/grub/core.img

sda3: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 10.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda6: __________________________________________________ _______________________

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

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 * 2,048 206,847 204,800 7 HPFS/NTFS
/dev/sda2 206,848 1,928,623,072 1,928,416,225 7 HPFS/NTFS
/dev/sda3 1,928,624,126 1,953,523,711 24,899,586 5 Extended
/dev/sda5 1,928,624,128 1,952,374,783 23,750,656 83 Linux
/dev/sda6 1,952,376,832 1,953,523,711 1,146,880 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 2AA8E434A8E3FC67 ntfs System Reserved
/dev/sda2 6236E9A136E97687 ntfs
/dev/sda3: PTTYPE="dos"
/dev/sda5 7369c67d-cb3d-4322-bd09-51693cccc9f7 ext4
/dev/sda6 e84e273c-24df-414a-9e8d-35cf5be0d7e8 swap
/dev/sda: PTTYPE="dos"

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sda5 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sda2 /media/6236E9A136E97687 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


=================== sda2: Location of files loaded by Grub: ===================


??GB: boot/grub/core.img

=========================== sda5/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=7369c67d-cb3d-4322-bd09-51693cccc9f7 ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=7369c67d-cb3d-4322-bd09-51693cccc9f7 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 7369c67d-cb3d-4322-bd09-51693cccc9f7
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 2aa8e434a8e3fc67
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

=============================== sda5/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda5 during installation
UUID=7369c67d-cb3d-4322-bd09-51693cccc9f7 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=e84e273c-24df-414a-9e8d-35cf5be0d7e8 none swap sw 0 0

=================== sda5: Location of files loaded by Grub: ===================


994.2GB: boot/grub/core.img
992.2GB: boot/grub/grub.cfg
988.3GB: boot/initrd.img-2.6.35-22-generic
994.2GB: boot/vmlinuz-2.6.35-22-generic
988.3GB: initrd.img
994.2GB: vmlinuz
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda1

00000000 eb 63 90 4e 54 46 53 20 20 20 20 00 02 08 00 00 |.c.NTFS .....|
00000010 00 00 00 00 00 f8 00 00 13 00 e0 00 00 08 00 00 |................|
00000020 00 00 00 00 80 00 80 00 ff 1f 03 00 00 00 00 00 |................|
00000030 55 21 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |U!..............|
00000040 f6 00 00 00 01 00 00 00 67 fc e3 a8 34 e4 a8 2a |........g...4..*|
00000050 00 00 00 00 fa 33 c0 8e d0 bc 00 80 38 59 f2 72 |.....3......8Y.r|
00000060 00 00 00 00 ff fa 90 90 f6 c2 80 74 05 f6 c2 70 |...........t...p|
00000070 74 02 b2 80 ea 79 7c 00 00 31 c0 8e d8 8e d0 bc |t....y|..1......|
00000080 00 20 fb a0 64 7c 3c ff 74 02 88 c2 52 bb 17 04 |. ..d|<.t...R...|
00000090 80 27 03 74 06 be 88 7d e8 17 01 be 05 7c b4 41 |.'.t...}.....|.A|
000000a0 bb aa 55 cd 13 5a 52 72 3d 81 fb 55 aa 75 37 83 |..U..ZRr=..U.u7.|
000000b0 e1 01 74 32 31 c0 89 44 04 40 88 44 ff 89 44 02 |..t21..D.@.D..D.|
000000c0 c7 04 10 00 66 8b 1e 5c 7c 66 89 5c 08 66 8b 1e |....f..\|f.\.f..|
000000d0 60 7c 66 89 5c 0c c7 44 06 00 70 b4 42 cd 13 72 |`|f.\..D..p.B..r|
000000e0 05 bb 00 70 eb 76 b4 08 cd 13 73 0d f6 c2 80 0f |...p.v....s.....|
000000f0 84 d0 00 be 93 7d e9 82 00 66 0f b6 c6 88 64 ff |.....}...f....d.|
00000100 40 66 89 44 04 0f b6 d1 c1 e2 02 88 e8 88 f4 40 |@f.D...........@|
00000110 89 44 08 0f b6 c2 c0 e8 02 66 89 04 66 a1 60 7c |.D.......f..f.`||
00000120 66 09 c0 75 4e 66 a1 5c 7c 66 31 d2 66 f7 34 88 |f..uNf.\|f1.f.4.|
00000130 d1 31 d2 66 f7 74 04 3b 44 08 7d 37 fe c1 88 c5 |.1.f.t.;D.}7....|
00000140 30 c0 c1 e8 02 08 c1 88 d0 5a 88 c6 bb 00 70 8e |0........Z....p.|
00000150 c3 31 db b8 01 02 cd 13 72 1e 8c c3 60 1e b9 00 |.1......r...`...|
00000160 01 8e db 31 f6 bf 00 80 8e c6 fc f3 a5 1f 61 ff |...1..........a.|
00000170 26 5a 7c be 8e 7d eb 03 be 9d 7d e8 34 00 be a2 |&Z|..}....}.4...|
00000180 7d e8 2e 00 cd 18 eb fe 47 52 55 42 20 00 47 65 |}.......GRUB .Ge|
00000190 6f 6d 00 48 61 72 64 20 44 69 73 6b 00 52 65 61 |om.Hard Disk.Rea|
000001a0 64 00 20 45 72 72 6f 72 0d 0a 00 bb 01 00 b4 0e |d. Error........|
000001b0 cd 10 ac 3c 00 75 f4 c3 00 00 00 00 00 00 24 12 |...<.u........$.|
000001c0 0f 09 00 be bd 7d 31 c0 cd 13 46 8a 0c 80 f9 00 |.....}1...F.....|
000001d0 75 0f be da 7d e8 da ff eb a4 46 6c 6f 70 70 79 |u...}.....Floppy|
000001e0 00 bb 00 70 8e c3 31 db b8 01 02 b5 00 b6 00 cd |...p..1.........|
000001f0 13 72 d3 b6 01 b5 4f e9 ff fe 00 00 00 00 55 aa |.r....O.......U.|
00000200

Unknown BootLoader on sda3

00000000 63 03 00 00 00 00 00 00 64 03 00 00 65 03 00 00 |c.......d...e...|
00000010 67 03 00 00 68 03 00 00 00 00 00 00 00 00 00 00 |g...h...........|
00000020 00 00 00 00 6b 03 00 00 6c 03 00 00 6d 03 00 00 |....k...l...m...|
00000030 6e 03 00 00 71 03 00 00 73 03 00 00 74 03 00 00 |n...q...s...t...|
00000040 76 03 00 00 00 00 00 00 79 03 00 00 7b 03 00 00 |v.......y...{...|
00000050 7e 03 00 00 80 03 00 00 84 03 00 00 87 03 00 00 |~...............|
00000060 88 03 00 00 8c 03 00 00 8d 03 00 00 90 03 00 00 |................|
00000070 93 03 00 00 94 03 00 00 95 03 00 00 96 03 00 00 |................|
00000080 97 03 00 00 98 03 00 00 00 00 00 00 99 03 00 00 |................|
00000090 00 00 00 00 9b 03 00 00 9c 03 00 00 9d 03 00 00 |................|
000000a0 9e 03 00 00 a1 03 00 00 a3 03 00 00 a6 03 00 00 |................|
000000b0 a7 03 00 00 a9 03 00 00 aa 03 00 00 ab 03 00 00 |................|
000000c0 ad 03 00 00 af 03 00 00 00 00 00 00 b1 03 00 00 |................|
000000d0 00 00 00 00 b4 03 00 00 b7 03 00 00 b8 03 00 00 |................|
000000e0 b9 03 00 00 bb 03 00 00 c0 03 00 00 c3 03 00 00 |................|
000000f0 c5 03 00 00 c6 03 00 00 c7 03 00 00 c9 03 00 00 |................|
00000100 cb 03 00 00 cc 03 00 00 cd 03 00 00 cf 03 00 00 |................|
00000110 d0 03 00 00 d2 03 00 00 00 00 00 00 d3 03 00 00 |................|
00000120 d8 03 00 00 d9 03 00 00 da 03 00 00 dd 03 00 00 |................|
00000130 e1 03 00 00 00 00 00 00 00 00 00 00 e2 03 00 00 |................|
00000140 e3 03 00 00 e6 03 00 00 ea 03 00 00 ec 03 00 00 |................|
00000150 ee 03 00 00 ef 03 00 00 f3 03 00 00 f4 03 00 00 |................|
00000160 00 00 00 00 f6 03 00 00 f8 03 00 00 48 b3 d3 33 |............H..3|
00000170 04 38 50 ad 3b 98 7f 8c 0a a7 a4 09 25 3c 88 9d |.8P.;.......%<..|
00000180 bb 7d 8e 4c b2 b7 d5 a6 4a 4d 3d 52 09 ca b7 d5 |.}.L....JM=R....|
00000190 50 62 f7 03 87 bd e4 c8 3a 78 4a 45 70 38 77 20 |Pb......:xJEp8w |
000001a0 6f 1e 71 8e 49 e8 42 68 48 c8 0b f2 7b 94 7e 57 |o.q.I.BhH...{.~W|
000001b0 63 09 0e 71 6b f6 be 27 86 43 72 7a 6b b2 00 df |c..qk..'.Crzk...|
000001c0 d3 ff 83 df d3 ff 02 00 00 00 00 68 6a 01 00 df |...........hj...|
000001d0 d3 ff 05 df d3 ff 62 6d 6a 01 a0 82 11 00 00 00 |......bmj.......|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

apernix
March 7th, 2011, 02:56 PM
It seems no problem with grub, maybe partition sda1 which hold boot information for windows 7 has an error.

Tray to fix windows boot sector using windows 7 DVD and reinstall grub using LiveCD, maybe it can help.

Hakunka-Matata
March 7th, 2011, 03:13 PM
Simply updating Grub may resolve your problem:
sudo update-grub

Hakunka-Matata
March 7th, 2011, 03:22 PM
@apernix, it appears to me that /dev/sda1 does not have an Operating System on it. Win7 is installed on /dev/sda2, no?

And this looks like a problem too, no? from post#3:
=================== sda2: Location of files loaded by Grub: ===================


??GB: boot/grub/core.img

=========================== sda5/boot/grub/grub.cfg: ===========================

lamb123
March 7th, 2011, 03:34 PM
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done


didnt help, I will try with Win7 DVD later

Hakunka-Matata
March 7th, 2011, 03:52 PM
So, I had Win7 and Ubuntu 10.10 in dualboot and after upgrading to 11.04 I managed to screw up GRUB, it didnt boot into Win7 anymore. After that I got rid of both ubuntu and swap partitions and merged them to Win7 partition via Gparted and made a clean installation of 10.10 again next to existing Win7 hoping to fix GRUB and be able to boot into Win7, but now when I try to boot into Win7, I only see '_' blinking on top left and nothing happens, Ubuntu works fine.

Halp?

The red text is confusing, how did you 'merge' that space into the Win7 partition. Everything I see concerning adjusting partition size on Windows partitions is to do that operation using Windows partition manager, not GParted. /dev/sda1 shows as being a Reserved partition with no Operating system installed. /dev/sda2 has the Win7 OS on it.

Hakunka-Matata
March 7th, 2011, 03:57 PM
Do you have your Win7 Data backed up?

Your Results.txt shows that /dev/sda1 has the boot flag set. I would use GParted and set /dev/sda2 boot flag, since that is the partition which has Win7 installed.

Hakunka-Matata
March 7th, 2011, 03:59 PM
Grub looks for the partition which has a boot flag set to determine where Windows OS is installed, Linux partitions do not use the Boot Flag.

Hakunka-Matata
March 7th, 2011, 04:20 PM
Grub looks for the partition which has a boot flag set to determine where Windows OS is installed, Linux partitions do not use the Boot Flag.

That statement is actually incorrect, but the effect is Correct. This post is from Forum member 'oldfred', he's sharp. It deals with a very similar situation to yours,


Re: After Installing ubuntu 10.04 , windows 7 failed to start (status: 0xc0000225)
the windows in sda2 is a recovery or something and the install is sda3. It looks like sda3 has all the boot files but the boot flag is on sda2. Boot flag does not effect grub as it just jumps to the partition boot sector. Windows boot loader in the MBR needs to see the boot flag (active partition) to know what partition boot sector to jump to to continue booting.

Did you try booting sda3?

If not, move boot flag to sda3 and try windows repair tools. You can use gparted, disk Utility or command line.

set boot flag on for sda3 (off for others)
sudo sfdisk -A3 /dev/sda

It also says you have SFS partitions, which are a windows proprietary type but still NTFS. This sometimes has caused issues as I think windows stopped using it.

How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows
http://support.microsoft.com/kb/927392
http://www.sevenforums.com/tutorials...ot-record.html
http://windows7ultimate.windowsreins...indexthumbs.ht

If in windows repair you run fixMBR you will overwrite grub. That is ok if you want to confirm that windows boots ok, but you will have to reinstall grub2 to the MBR.

How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
http://ubuntuforums.org/showthread.php?t=1014708

sudo mount /dev/sda4 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda
If that returns any errors run:
sudo grub-install --recheck --root-directory=/mnt/ /dev/sda

oldfred
March 7th, 2011, 05:12 PM
I see a couple of errors. Windows has to have a valid NTFS boot sector. you have a grub4 dos file /grldr in the boot partition which sometimes cause issues and a grub folder in the windows system partition. Delete the grub4dos file/folder & the grub folder.

sda1: ____________________________

File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD /grldr

sda2: ___________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe /boot/grub/core.img

If you have a windows repair CD you can use it to run the fixBoot command to update the boot sector.
From Ubuntu you can download testdisk and it can recover the backup boot sector, if it is valid or rebuild a boot sector.

Restore PBR boot sector for windows from linux using testdisk
http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Boot_Sector

As described, it has an option to "Recover NTFS boot sector from its backup", It also has a rebuild boot sector.
Instructions
http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

oldfred's Windows Vista/Win7 repair links posts #7 & #9:
http://ubuntuforums.org/showthread.php?p=9826152
Make sure boot flag is set for any partition you try to repair.

Hakunka-Matata
March 7th, 2011, 05:21 PM
thanks oldfred, nothing like being safe vs. sorry!

lamb123
March 7th, 2011, 06:15 PM
I see a couple of errors. Windows has to have a valid NTFS boot sector. you have a grub4 dos file /grldr in the boot partition which sometimes cause issues and a grub folder in the windows system partition. Delete the grub4dos file/folder & the grub folder.

sda1: ____________________________

File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD /grldr

sda2: ___________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe /boot/grub/core.img

If you have a windows repair CD you can use it to run the fixBoot command to update the boot sector.
From Ubuntu you can download testdisk and it can recover the backup boot sector, if it is valid or rebuild a boot sector.

Restore PBR boot sector for windows from linux using testdisk
http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Boot_Sector

As described, it has an option to "Recover NTFS boot sector from its backup", It also has a rebuild boot sector.
Instructions
http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

oldfred's Windows Vista/Win7 repair links posts #7 & #9:
http://ubuntuforums.org/showthread.php?p=9826152
Make sure boot flag is set for any partition you try to repair.


Okay, I deleted grldr file from sda1, but there is no GRUB folder in /Windows/System32/Boot/

Followed testdisk instructions for sda1



First screen: Select "No Log" and press enter. Second screen: Select the hard drive containing the Windows system partition and choose "proceed". Third screen: "intel" Fourth screen: "advanced", Fifth screen: Select the Windows system partition and choose "boot" Sixth screen: "BackupBS" Seventh screen: type "Y" to confirm and seemed ok, but for sda2, instead of "BackupBS" I get "Org.BS" instead




Boot sector
Warning: Incorrect number of heads/cylinder 224 (NTFS) != 255 (HD)
Warning: Incorrect number of sectors per track 19 (NTFS) != 63 (HD)
Status: OK

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.

oldfred
March 7th, 2011, 06:23 PM
Your sda2 looked ok, so it should not have needed repairs.

The /boot/grub is not in /windows but off the root or top level of windows. If windows is booting from the same partition (yours is not) it has a /Boot with the window boot files and gets very confused. If you have a /Boot but without the boot files, then it is different than the /boot. But windows cannot tell the difference between /boot & /Boot as it is not case sensitive like Linux is. Do not delete /Boot but do delete /boot.

lamb123
March 7th, 2011, 06:29 PM
Ok I am now getting "A disk read error occoured. Press ctrl+alt+delete to restart" when trying to boot win7

sda1 testdisk output:



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

Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Partition Start End Size in sectors
1 * HPFS - NTFS 0 32 33 12 223 19 204800 [System Reserved]

Boot sector
Warning: Incorrect number of heads/cylinder 224 (NTFS) != 255 (HD)
Warning: Incorrect number of sectors per track 19 (NTFS) != 63 (HD)
Status: OK

Backup boot sector
Warning: Incorrect number of heads/cylinder 224 (NTFS) != 255 (HD)
Warning: Incorrect number of sectors per track 19 (NTFS) != 63 (HD)
Status: OK

Sectors are identical.

Next

[ Quit ] [ List ] [Rebuild BS] [Repair MFT] [ Dump ]



sda2 testdisk output:


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

Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Partition Start End Size in sectors
2 P HPFS - NTFS 12 223 20 120051 59 41 1928416225

Boot sector
Warning: Incorrect number of heads/cylinder 224 (NTFS) != 255 (HD)
Warning: Incorrect number of sectors per track 19 (NTFS) != 63 (HD)
Status: OK

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.


[ Quit ] [ List ] [Org. BS ] [Rebuild BS] [ Dump ]

oldfred
March 7th, 2011, 06:43 PM
You can then try the Rebuild boot sector.

[Rebuild BS]

If that does not work then maybe the windows fixBoot will? Do you have windows repair CD?

lamb123
March 7th, 2011, 06:48 PM
yeah, will use win7 disk

oldfred
March 7th, 2011, 07:01 PM
If you need more info on how to use repair CD.

oldfred's Windows Vista/Win7 repair links posts #7 & #9:
http://ubuntuforums.org/showthread.php?p=9826152
Make sure boot flag is set for any partition you try to repair.

billbear
March 10th, 2011, 02:25 PM
In short, to solve this problem (http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable.html), recent update of grub introduces this new bug (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/730225) which can corrupt the first ntfs partition.

If you have some big adobe product installed in Windows, recent grub update will ruin the first partition if it's NTFS.

We should have a sticky thread here waring this. Be careful to apply this grub update.

billbear
March 10th, 2011, 03:28 PM
I see a couple of errors. Windows has to have a valid NTFS boot sector. you have a grub4 dos file /grldr in the boot partition which sometimes cause issues and a grub folder in the windows system partition. Delete the grub4dos file/folder & the grub folder.

sda1: ____________________________

File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD /grldr



These are actually not errors, he uses a technique called softmod to crack and activate windows7. This technique uses a modified version of grub4dos and a modified NTFS boot sector which is not recognizable (Unknown BootLoader on sda1) by the script Hakunka-Matata gave.

The modified NTFS boot sector looks for grldr instead of bootmgr.
Then the modified grub4dos silently runs a command "acpi"(which is not in the usual version of grldr) to emulate BIOS with ASUS or Dell, HP, Lenovo, Sony OEM ID in the SLIC and RSDT tables of ACPI module.
After that it runs "chainloader /bootmgr" to boot windows.

oldfred
March 10th, 2011, 04:26 PM
I have seen the /grldr in windows partitions many times, but normally removing it and fixing boot sector solved the problem. If it is as you say them you are into issues of we cannot help.

Ubuntu Forums Code of Conduct
http://ubuntuforums.org/index.php?page=policy

billbear
March 10th, 2011, 04:41 PM
Yes windows will boot and work.
They may not notice windows becomes unactivated until microsoft someday later tells them and refuse to function normally. They may not associate it to the fix they performed months before and may not ask for help here again.

oldfred
March 10th, 2011, 05:00 PM
So you are saying OEMs not users are setting up systems this way and not providing valid windows licenses?

billbear
March 10th, 2011, 06:16 PM
So you are saying OEMs not users are setting up systems this way and not providing valid windows licenses?

No.
Users buy pirated windows DVDs and install systems this way. (mimic OEMs)
Users download cracks and modify systems this way.
They do know their copies are not legal.
They don't know the inner mechanics though.

I admit on most occasions /grldr under ntfs partitions are normal attempts to load linux from windows bootloaders but this one is not. From the detailed information the script gave, especially the hexcode of "Unknown BootLoader on sda1", I can confirm that his copy of windows is illegal.

oldfred
March 10th, 2011, 08:02 PM
@billbear
Very useful info.

But that means the Admins will close this thread.

Hakunka-Matata
March 10th, 2011, 09:07 PM
In short, to solve this problem (http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable.html), recent update of grub introduces this new bug (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/730225) which can corrupt the first ntfs partition.

If you have some big adobe product installed in Windows, recent grub update will ruin the first partition if it's NTFS.

We should have a sticky thread here waring this. Be careful to apply this grub update.

+1 oldfred -- "this problem" and "this new bug" posts # 20 & 21