[opensuse] A quick grub2-rescue question
I've got a PC that used to dual boot with openSUSE and Windows. The current user of the PC decided they only wanted Windows so they blew away the openSUSE partition. Not surprisingly, it no longer boots in Windows via the menu. And openSUSE is no longer and option. It now boots up to grub-rescue. Then this series of commands works: set root=(hd0,5) set prefix=(hd0,5)/boot/grub2 insmod normal normal What command can I run inside grub-rescue to save that root and prefix? Thanks Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-11-04 23:17, Greg Freemyer wrote:
I've got a PC that used to dual boot with openSUSE and Windows.
The current user of the PC decided they only wanted Windows so they blew away the openSUSE partition. Not surprisingly, it no longer boots in Windows via the menu. And openSUSE is no longer and option.
It now boots up to grub-rescue.
Then this series of commands works:
set root=(hd0,5) set prefix=(hd0,5)/boot/grub2 insmod normal normal
What command can I run inside grub-rescue to save that root and prefix?
Presumably that partition contained grub. I would instead find out the partition layout. For instance, "fdisk -l". I would consider installing a generic mbr code and mark the windows partition as bootable. You can do that from a Linux rescue disk. MsDos has/had a program that does it. "fdisk /fixmbr" perhaps. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
Carlos E. R. composed on 2016-11-04 23:31 (UTC+0100):
Greg Freemyer wrote:
What command can I run inside grub-rescue to save that root and prefix?
Presumably that partition contained grub.
I would instead find out the partition layout. For instance, "fdisk -l". I would consider installing a generic mbr code and mark the windows partition as bootable. You can do that from a Linux rescue disk. MsDos has/had a program that does it. "fdisk /fixmbr" perhaps.
Booted to Windows XP command prompt/recovery console: fixmbr Booted to PC or MS DOS: fdisk /mbr Booted to OS/2 or eCS: fdisk /newmbr It's less simple in Windows >XP involving multiple bootrec commands in rescue mode. It could possibly be easier to recreate the ostensibly removed openSUSE / partition, mount it, then restore the 512 byte MBR file saved to /boot at installation time. One easy path to repair is if the PC has an OM drive and you boot media made from ultimatebootcd.com. There's also this, maybe available from booting openSUSE installation media in rescue mode: # /usr/sbin/fixmbr --help /usr/sbin/fixmbr: invalid option -- '-' usage: /usr/sbin/fixmbr [-s] [-i <mbr-file>] <device> write 440 bytes to <device> from /usr/lib/boot/master-boot-code or use code supplied in <mbr-file>. -s will generate a new random signature for the MBR. Whatever the method of writing new MBR code, one and only one primary partition needs to be marked active/bootable, probably /dev/sda1. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-11-05 00:02, Felix Miata wrote:
There's also this, maybe available from booting openSUSE installation media in rescue mode: # /usr/sbin/fixmbr --help /usr/sbin/fixmbr: invalid option -- '-' usage: /usr/sbin/fixmbr [-s] [-i <mbr-file>] <device> write 440 bytes to <device> from /usr/lib/boot/master-boot-code or use code supplied in <mbr-file>. -s will generate a new random signature for the MBR.
Telcontar:~ # rpm -qf /usr/sbin/fixmbr master-boot-code-1.22-14.1.2.i586 Telcontar:~ #
Whatever the method of writing new MBR code, one and only one primary partition needs to be marked active/bootable, probably /dev/sda1.
Yep. What happens if there are two is undefined, but typically the first one boots. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On Fri, Nov 4, 2016 at 6:31 PM, Carlos E. R.
On 2016-11-04 23:17, Greg Freemyer wrote:
I've got a PC that used to dual boot with openSUSE and Windows.
The current user of the PC decided they only wanted Windows so they blew away the openSUSE partition. Not surprisingly, it no longer boots in Windows via the menu. And openSUSE is no longer and option.
It now boots up to grub-rescue.
Then this series of commands works:
set root=(hd0,5) set prefix=(hd0,5)/boot/grub2 insmod normal normal
What command can I run inside grub-rescue to save that root and prefix?
Presumably that partition contained grub.
I would instead find out the partition layout. For instance, "fdisk -l". I would consider installing a generic mbr code and mark the windows partition as bootable. You can do that from a Linux rescue disk. MsDos has/had a program that does it. "fdisk /fixmbr" perhaps.
I think it still does, The problem is it used to be partition 6, so grub starts up with: root=(hd0,6) etc. So, I've still got a valid grub partition, the only problem is the partition number changed from 6 to 5. Once the normal grub menu shows up, I can select Windows and boot on up. I can experiment with fdisk /fixmbr, but I'd prefer to just repair the grub setup. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-11-05 00:25, Greg Freemyer wrote:
On Fri, Nov 4, 2016 at 6:31 PM, Carlos E. R. <> wrote:
I would instead find out the partition layout. For instance, "fdisk -l". I would consider installing a generic mbr code and mark the windows partition as bootable. You can do that from a Linux rescue disk. MsDos has/had a program that does it. "fdisk /fixmbr" perhaps.
I think it still does, The problem is it used to be partition 6, so grub starts up with:
Oh. Standard MBR code can only boot primary partitions, 1 to 4. Unless that is a GPT partition, but then the boot method is different.
I can experiment with fdisk /fixmbr, but I'd prefer to just repair the grub setup.
You need leaving a small /boot partition holding grub files. At least. Maybe even a tiny Linux. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On Fri, Nov 4, 2016 at 10:23 PM, Carlos E. R.
On 2016-11-05 00:25, Greg Freemyer wrote:
On Fri, Nov 4, 2016 at 6:31 PM, Carlos E. R. <> wrote:
I would instead find out the partition layout. For instance, "fdisk -l". I would consider installing a generic mbr code and mark the windows partition as bootable. You can do that from a Linux rescue disk. MsDos has/had a program that does it. "fdisk /fixmbr" perhaps.
I think it still does, The problem is it used to be partition 6, so grub starts up with:
Oh. Standard MBR code can only boot primary partitions, 1 to 4. Unless that is a GPT partition, but then the boot method is different.
I can experiment with fdisk /fixmbr, but I'd prefer to just repair the grub setup.
You need leaving a small /boot partition holding grub files. At least. Maybe even a tiny Linux.
I'll have to experiment next week. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Отправлено с iPhone
5 нояб. 2016 г., в 2:17, Greg Freemyer
написал(а): I've got a PC that used to dual boot with openSUSE and Windows.
The current user of the PC decided they only wanted Windows so they blew away the openSUSE partition. Not surprisingly, it no longer boots in Windows via the menu. And openSUSE is no longer and option.
It now boots up to grub-rescue.
Then this series of commands works:
set root=(hd0,5) set prefix=(hd0,5)/boot/grub2 insmod normal normal
What command can I run inside grub-rescue to save that root and prefix?
Unfortunately, that's not possible. If you want to retain grub as boot loader, you need to boot from live Linux and use grub-install pointing it to new partition.
Thanks Greg
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Felix Miata
-
Greg Freemyer