grub converted GPT win 7 ssd to MBR on UEFI system - help!

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

Long story short - I was using my win 7 audio/video production machine to try to fix a Mint SSD's grub from another computer that is now bust. I removed the win 7 SSD, inserted the Mint SSD and booted grub rescue disk. It said grub had been fixed, but Mint would abort loading I think because of UEFI or something (Mint 17.1 Rebecca). So I removed the Mint SSD and inserted the Win 7 SSD back in and booted. To my horror, I was greeted by grub complaining that the Mint SSD could not be found. I had left a storage HDD in the machine and it appears grub got installed onto that rather than the Mint SSD. So I went into bios and set the boot order back to win 7 SSD and disabled the storage drive now with grub on it, and win 7 wouldn't boot. It gave an error saying insert bootable media etc I tried to fix win 7 with the win 7 install disk, but that complained saying that "the selected disk has an MBR partition table. On EFI systems windows can only be installed on GPT disks.

Now I am completely screwed! I need to remove grub from the storage drive and presumably fix/convert the win 7 SSD to GPT to get my audio/video production machine going again. How can I do this without loosing data?
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by gold_finger »

Your computer probably has UEFI firmware which can boot in either UEFI mode or Legacy mode. Sounds like somehow the boot mode got changed to UEFI when you were messing with Mint drive in computer. All you probably need to do is go into UEFI Settings on startup and change the boot mode to Legacy/CSM/Bios (not sure what exact wording will be). Get into UEFI Settings by hitting a special key immediately after power-on. Each manufacturer is different, so don't know which key that will be for you. Try watching for some kind of message quickly flashing on screen that tells you how to enter setup or settings menu. Worst case, look-up user manual for your computer make/model on manufacturer's website.

EDIT: Your post was a little confusing, but I understood from what you said that you were worried that you needed to convert Windows drive to using GPT partitions and that is what I based my answer on. In other words, I'm assuming that your Windows drive is using MBR partitions and you got message leading you to believe you needed to convert that to GPT partitions. Assuming that is in fact the case, nothing you did with Mint drive attached changed the partition format of the Windows 7 drive -- so no need to panic. Only problem is computer is (for some reason) set to boot in UEFI mode, therefore wants to operate Windows install disk in that mode too.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

The bios was originally set to "UEFI and Legacy". Changing it to just legacy I still get the error - "Reboot and select proper boot device etc". Grub seems to have messed with the win 7 drive and converted it from GPT to MBR somehow.
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by gold_finger »

al35mm wrote:Grub seems to have messed with the win 7 drive and converted it from GPT to MBR somehow.
I thought you removed the Win7 drive to insert the Mint drive? Or are you talking about the data drive that was left in computer while Mint drive was installed? Also, I'm now confused because I don't know whether your Win7 installation was done in UEFI mode or Legacy mode. Message you posted before from Windows install disk made it sound like computer booted in UEFI mode but couldn't perform fix because installed Windows wasn't using GPT (meaning it was installed in and needs Legacy boot). Do you happen to know whether the hard drive holding the Windows system files (the one with the "C: drive" partition) is using MBR or GPT partitions? That is the most important thing to know right now.
al35mm wrote:The bios was originally set to "UEFI and Legacy". Changing it to just legacy I still get the error - "Reboot and select proper boot device etc".
IF my original assumption that Windows was installed in and using Legacy mode (talking about the system drive, not the data drive) is correct, then make sure that drive is connected in computer and make sure that is the one set first in the boot order priority after setting mode to Legacy.

Do you happen to have any live Linux DVD/USB that you can use to boot with while both Windows hard drives are in the computer? It can be Mint or any other distro -- just let us know which one you have if it's not Mint. If you have a Mint DVD/USB, boot with it, open a terminal and enter the following commands:

Code: Select all

sudo parted --list
sudo os-prober
Copy/Paste full output of those command using directions shown here.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

gold_finger wrote:
al35mm wrote:Grub seems to have messed with the win 7 drive and converted it from GPT to MBR somehow.
I thought you removed the Win7 drive to insert the Mint drive? Or are you talking about the data drive that was left in computer while Mint drive was installed? Also, I'm now confused because I don't know whether your Win7 installation was done in UEFI mode or Legacy mode. Message you posted before from Windows install disk made it sound like computer booted in UEFI mode but couldn't perform fix because installed Windows wasn't using GPT (meaning it was installed in and needs Legacy boot). Do you happen to know whether the hard drive holding the Windows system files (the one with the "C: drive" partition) is using MBR or GPT partitions? That is the most important thing to know right now.
Yeah I know it's confusing. Originally the Mint SSD was in a dual boot with a win 7 SSD in a laptop which died. I tried getting into the Mint SSD by putting it in an old tower system I had that had only win 7 in it. That screwed up grub. Now I put the Mint SSD in a 3rd computer (my audio/video production machine) without that win 7 SSD (never been dual booted) in it where I managed to fix grub with grub rescue disk, but that inadvertently installed grob on the storage drive that I had left in the machine. So when I removed the Mint SSD and replaced the native win 7 SSD (that's never met Linux before), grub was on the storage drive and must have done something to mess with that win 7 SSD. So in total we have had 3 computers and 3 different windows 7 disks. My mistake was to leave the storage drive in my a/v machine as grub rescue decided to install grub on that rather than the Mint SSD. So I need to;

a) remove grub from the storage drive
b) get my win 7 SSD booting again

According to the win 7 install disk, the win 7 SSD is using MBR when it should be GPT for UEFI. I'm pretty sure Grub must have changed the partition table type of the SSD when it loaded from the storage drive at boot. It's obviously done something to make the SSD unbootable.
gold_finger wrote:
al35mm wrote:The bios was originally set to "UEFI and Legacy". Changing it to just legacy I still get the error - "Reboot and select proper boot device etc".
IF my original assumption that Windows was installed in and using Legacy mode (talking about the system drive, not the data drive) is correct, then make sure that drive is connected in computer and make sure that is the one set first in the boot order priority after setting mode to Legacy.
This computer is a home build and I'm pretty sure windows was installed in UEFI with the bios set to "UEFI and legacy" as the setting. The SSD shows up in the bios and I have it all configured to boot from that drive and have tried booting in legacy only mode to no avail. When the storage drive is enabled the system loads grub regardless of boot order and grub complains that it can't find Mint. When I disable the storage drive in the bios I get the error - "Reboot and select proper boot device etc".
gold_finger wrote: Do you happen to have any live Linux DVD/USB that you can use to boot with while both Windows hard drives are in the computer? It can be Mint or any other distro -- just let us know which one you have if it's not Mint. If you have a Mint DVD/USB, boot with it, open a terminal and enter the following commands:

Code: Select all

sudo parted --list
sudo os-prober
Copy/Paste full output of those command using directions shown here.
Yes I have Mint 17.1 live DVD running on the system at the moment. Here's the output;

Code: Select all

mint@mint:~ > sudo parted --list
Model: ATA CT250BX100SSD1 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  250GB  250GB  primary  ntfs


Model: ATA ST2000DM001-1ER1 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  106MB   105MB   primary  ntfs         boot
 2      106MB   1000GB  1000GB  primary  ntfs
 3      1000GB  2000GB  1000GB  primary  ntfs


Error: Can't have a partition outside the disk!                           

mint@mint:~ > sudo os-prober
mint@mint:~ > 

Thanks for your help. It's much appreciated. I'm completely stuck and desperately need to be working in win 7 right now!
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by gold_finger »

al35mm wrote:So when I removed the Mint SSD and replaced the native win 7 SSD (that's never met Linux before), grub was on the storage drive and must have done something to mess with that win 7 SSD.
Grub could not have changed any partitioning scheme on the Windows SSD you put in afterwards -- literally can't (doesn't have ability to) do that.
al35mm wrote:According to the win 7 install disk, the win 7 SSD is using MBR when it should be GPT for UEFI.
Windows 7, 8, 8.1 and 10 all can be installed in either UEFI or Legacy mode on computers using UEFI firmware. To install in UEFI mode, disks must be using GPT format and OS must be 64-bit version. To install in Legacy mode, disks must use MBR/msdos format and OS can be either 32-bit or 64-bit. Not sure, but suspect computer booted the Windows install disk in UEFI mode, therefore wanted to fix things in that mode and refused when it saw disk was using MBR partitions.
al35mm wrote:This computer is a home build and I'm pretty sure windows was installed in UEFI with the bios set to "UEFI and legacy" as the setting.
Output you posted shows both SSD and storage drive are using MBR partitions, therefore Win7 was installed in Legacy mode. (Also, there is no EFI System Partition on either drive which is required for any UEFI-mode installed system.)
al35mm wrote:The SSD shows up in the bios and I have it all configured to boot from that drive and have tried booting in legacy only mode to no avail. When the storage drive is enabled the system loads grub regardless of boot order and grub complains that it can't find Mint. When I disable the storage drive in the bios I get the error - "Reboot and select proper boot device etc".
Think I see the problem in your output. Your SSD does not have boot flag set for the Windows partition (/dev/sda1), so even though you set computer to look there first for booting it doesn't see boot flag and moves on to next drive to try booting. I'm assuming it used to have that partition set with boot flag and I honestly don't know why/how that got removed.

Boot again with Mint 17.1 DVD, open GParted and make sure the SSD is showing in window. (Upper-right corner of GParted window has a drop-down list where you can select which hard drive shows in window. It automatically opens to /dev/sda, but if for some reason this session doesn't read your SSD as /dev/sda use that drop-down menu to switch to it.) Right-click on /dev/sda1 and choose "Manage flags". Check box to set the "Boot" flag on that partition. Then I believe you'll need to hit the "Apply" button along top of GParted interface to finalize it.

I think that will fix problem and computer should now boot Windows SSD again. Let's get that working first before attempting to remove grub from /dev/sdb (the storage drive).

If that doesn't work, try booting Windows install disk again to fix MBR with it. Most computers give you a way to get into either the main UEFI Settings/Setup Menu or a special Boot Menu (used only for current boot session). Those choices can be made by either hitting different special keys during power-up, or by hitting one special key that then gives you a choice for Settings/Setup or Boot menus. Look for clues on what keys may apply in your situation by any messages that may show on screen right after power-up, but before grub menu. (If no luck seeing messages, find user manual for your motherboard with search engine.) Have Windows install DVD/USB plugged-in before powering on, then invoke the Boot Menu, not the Settings/Setup Menu. That should then bring up a list of devices you can boot from and it should show a choice to boot the DVD/USB in either UEFI or Legacy mode -- pick Legacy mode.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6696
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by kukamuumuka »

Super Grub 2 should be able to boot Windows, and when Windows is booted, you can set the active partition via Windows disk management.
http://www.supergrubdisk.org/category/d ... sk-stable/

An another choice to boot Windows is to use Grub4Dos boot-CD or USB.
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

gols_finger, I changed the flag to boot via gparted. All I got then when trying to boot was "BOOTMGR is missing" error.

administrollaattori, super grub 2 didn't help.

I have been trying various fixes for the BOOTMGR missing issue, but nothing has worked.
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by gold_finger »

Boot again with your Mint DVD and try the following instead.

Open a terminal and confirm which drive is the SSD (probably /dev/sda again) with this command:

Code: Select all

sudo parted --list
Assuming for this example that SSD is still /dev/sda. If not replace the "a" in "sda" with correct letter, (eg. /dev/sdb) when running command below. Run this command to install generic boot loader that should be able to boot Windows. (Make sure you type it exactly as posted below, or simply copy/paste the command to make sure there are no typos.)

Code: Select all

sudo dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sda
Restart without Mint DVD and hopefully Windows now boots.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
User avatar
prestonR
Level 5
Level 5
Posts: 843
Joined: Wed Jan 07, 2015 12:24 pm
Location: Harare

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by prestonR »

To install in UEFI mode, disks must be using GPT format
I've read this many times; it is not quite true.

If, in a 2 drive setup, sda has a gpt and contains the EFI partition, you can install Mint in UEFI mode to sdb if that drive has an msdos partition table, as long as grub goes to the EFI partition on sda.
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

prestonR wrote:
To install in UEFI mode, disks must be using GPT format
I've read this many times; it is not quite true.

If, in a 2 drive setup, sda has a gpt and contains the EFI partition, you can install Mint in UEFI mode to sdb if that drive has an msdos partition table, as long as grub goes to the EFI partition on sda.
Thanks for the heads up. Right now I am not bothered about UEFI. I just want to get back into windows :)
Last edited by al35mm on Fri Jun 09, 2017 9:31 pm, edited 1 time in total.
al35mm
Level 1
Level 1
Posts: 9
Joined: Mon Sep 28, 2015 6:04 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by al35mm »

gold_finger wrote:Boot again with your Mint DVD and try the following instead.

Open a terminal and confirm which drive is the SSD (probably /dev/sda again) with this command:

Code: Select all

sudo parted --list
Assuming for this example that SSD is still /dev/sda. If not replace the "a" in "sda" with correct letter, (eg. /dev/sdb) when running command below. Run this command to install generic boot loader that should be able to boot Windows. (Make sure you type it exactly as posted below, or simply copy/paste the command to make sure there are no typos.)

Code: Select all

sudo dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sda
Restart without Mint DVD and hopefully Windows now boots.
This did not work. Here's my console output;

Code: Select all

mint@mint:~ > sudo parted --list
Model: ATA CT250BX100SSD1 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  250GB  250GB  primary  ntfs         boot


Error: Can't have a partition outside the disk!                           

mint@mint:~ > sudo dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sda
dd: failed to open ‘/usr/lib/syslinux/mbr/mbr.bin’: No such file or directory
mint@mint:~ > 

User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by gold_finger »

On Mint 18 Xfce, what I'm working on, the location of the mbr.bin file is in /usr/lib/syslinux/mbr/ directory. I thought it was there in Mint 17.1 also, but apparently not. Use following command to list the contents of just /usr/lib/syslinux/ directory and see if file called mbr.bin is in the output.

Code: Select all

ls /usr/lib/syslinux/
If it is, change dd command to this:

Code: Select all

sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda
You likely won't see any visible feedback as command is executed and it may take several seconds or more to complete. You'll know dd is done when returned to regular command prompt. At that point go ahead and close terminal, restart without Mint DVD, cross your fingers, and maybe we'll finally have success.


If still no success boot again with Mint DVD and post back a screenshot of window in GParted. You keep getting an error message saying "Can't have a partition outside of disk" when you run the parted --list command. Maybe GParted can shed some light on why you're getting that message and perhaps that has something to do with difficulties booting Windows.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6696
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub converted GPT win 7 ssd to MBR on UEFI system - help!

Post by kukamuumuka »

al35mm wrote:gols_finger, I changed the flag to boot via gparted. All I got then when trying to boot was "BOOTMGR is missing" error.

administrollaattori, super grub 2 didn't help.

I have been trying various fixes for the BOOTMGR missing issue, but nothing has worked.
You could look inside windows-partitions and see if bootmgr is around. If not, you need to copy bootmgr from an another source.
Post Reply

Return to “Installation & Boot”