Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a customized Sony Vaio S with default Windows 7 64-bit and manually installed Ubuntu 12.04 64-bit installed on it.

I use Grub as boot manager and initially it worked, booting both Windows 7 and Ubuntu.

After some updates on Ubuntu it broke Grub and I reinstalled it.

Now it won't let me boot into Win7, apparently there are some issues with EFI.

blkid gives me the following:

/dev/sda1: LABEL="SONYSYS" UUID="72D1-8783" TYPE="vfat" 
/dev/sda2: LABEL="Recovery" UUID="6E62E06762E0360D" TYPE="ntfs" 
/dev/sda3: LABEL="boot" UUID="5CF7-3AEE" TYPE="vfat" 
/dev/sda5: LABEL="Win7" UUID="BEDC4BEFDC4BA10F" TYPE="ntfs" 
/dev/sda6: UUID="aaff8b62-cffe-4e3c-a539-f57e36f293f8" TYPE="ext4" 
/dev/sda7: UUID="a26bdd92-07e5-41ed-b7cf-79dfcb89560c" TYPE="ext4" 
/dev/sda10: UUID="20565c91-c106-4761-914c-b1c33ed07d1f" TYPE="ext4" 
/dev/mapper/cryptswap1: UUID="f29a5cfc-c098-4308-bada-a519c404d0d4" TYPE="swap"

sda10 and sda6 are my root and home directory, respectively.

Boot-Repair gives the following output:

The first Win7 enty in GRUB from 30_os-prober Windows Recovery Environment (loader) (on /dev/sda5) (fixed by Boot-Repair) gives the following error:

error: unknown command 'drivemap'. error: invalid EFI file path.

The other ones from 40_Custom Windows 7/Windows 7 Alter/etc.:

Black screen and a white rectangle. After a few seconds returning to GRUB.

I tried using rEFInd to boot into Win7, without success. When i click on the Win7 button, it returns to GRUB.

Are there any solutions apart from reinstalling Win7?

Sorry for the messy grubfiles, I tried several ways to boot Win7.

share|improve this question

It looks like you've got an EFI-mode Windows installation, a (probably damaged) EFI-mode GRUB installation, and a BIOS-mode GRUB installation. My guess is that you installed Ubuntu in EFI mode and somewhere along the line the package system decided to install the BIOS-mode GRUB, which damaged your EFI-mode GRUB installation and led to the problems. The Boot Repair tool has made matters worse by unnecessarily renaming and copying files, which is what's causing rEFInd's failure to launch Windows -- Boot Repair has moved the Windows boot loader to a non-standard filename (probably either bootmgfw.efi.old or bootmgfw.efi_backup) and has placed GRUB where the Windows boot loader normally resides (bootmgfw.efi).

If rEFInd lets you get into Linux, then the solution is pretty simple: In Linux, type the following command:

sudo cp /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi.old /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

This will copy what's probably the original Microsoft boot loader back to its proper name. You should then be able to launch both Windows and Linux from rEFInd. If that doesn't work, try the same thing, but copy bootmgfw.efi_backup rather than bootmgfw.efi.old.

If rEFInd is not launching Ubuntu correctly, but is itself launching, then the above should still work to get Windows working, but you'll need to do it from an emergency disc, so the path to the files may be different. You'll need to provide more details about what happens with each of the rEFInd options for me to diagnose that problem.

There's almost certainly a way to get GRUB working instead of rEFInd, if you prefer to do that, but this will involve more diagnostics and a way to boot in EFI mode. (Your Ubuntu installation CD can do this if you can't get into your main Ubuntu installation, but forcing it to do so can be tricky if you don't already know how to do it on your system.)

share|improve this answer
diff shows that the 3 of those bootmgfw.efi.x are the same. I tried copying a what seemed to be a backup from this file from a recovery partition. Then nothing will show up on starup (neither GRUB, nor rEFInd). After copying back the old one, GRUB shows up again. Still, I can boot into Ubuntu via GRUB. Unfortunately, Sony didn't deliver any Recovery DVD, there is only a partition with the corresponding files. I'm scared to lose all the appropriate drivers when reinstalling Win7 from another DVD. – user132697 Feb 17 '13 at 10:21
Apparently my bootmgfw.efi is corrupt. Can I restore it from another machine or even download it somewhere, if possible? – user132697 Feb 17 '13 at 10:31
Copying bootmgfw.efi from another machine should work. I'm sure you can find it somewhere, but I don't have any pointers. I know there are legal Windows recovery disc images available online, so you could try a Web search to find one. Be careful of the source, though -- you don't want to get a dodgy download. – Rod Smith Feb 17 '13 at 15:37
Thanks for your reply. I tried the bootmgfw.efi from C:/Windows/Boot/EFI with the result being again a black screen where GRUB should show up. Do you recommend reinstalling Windows in this case or do you know any other solution? – user132697 Feb 17 '13 at 17:16
There's something strange going on. Perhaps it's rEFInd that's gotten in place of EFI/Windows/Boot/bootmgfw.efi; or maybe your firmware is doing something very peculiar. You could try using a rEFInd USB flash drive or CD-R image to boot into rEFInd and see if that works to boot Windows. If it does, and if you can also then boot Linux, you could re-install rEFInd in either OS. With any luck, that will then work. – Rod Smith Feb 18 '13 at 23:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.