[SOLVED] Change active MBR from /dev/sdb to /dev/sda. How?
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Change active MBR from /dev/sdb to /dev/sda. How?
I currently boot from sdb (because FreeBSD killed my boot from sda). I want to restore the GRUB-MBR to sda.
I tried "man grub-install" but the SuSE people sort of castrated that alleging that YAST could do all and more, better. Fine. When I use YAST's boot loader module it offers to restore the currently active MBR of sdb. No chance to change hard disks.
Unless you have / on sda, a script like yast will usually think it knows better than you.
There is some gimmick in grub.comf
map hd0 hd1
map hd1 hd0
To do exactly what you say in grub-speak. I would consider inserting it, or deleting it.
as for man grub-install, forget it. Grub thinks man pages don't exist; for you are the infinitely infuriating 'info grub' pages :-). Grub & tar are the only programs that come to mind which force users to use info pages. Info pages generally seem to be a maze with no way out.
Have you tried the standard method? Open a terminal as root user enter grub to get a grub prompt (grub>) then enter:
Quote:
root (hd1,3)
setup (hd0)
quit
The example above should install Grub to the mbr of sda pointing to the system partition with boot/kernel file on sdb4. You can use the geometry command at the grub prompt and compare it to your fdisk output to assure that sda is the same as (hd0), which it should be but is not always the same. geoemtry (hd0) at a grub prompt should show you info on partitions as grub sees them for sda. This is for Grub Legacy which I believe Opensuse still uses?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by business_kid
Unless you have / on sda, a script like yast will usually think it knows better than you...
Well, / is on sda, but I still don't have access to sda's MBR.
Quote:
Originally Posted by business_kid
There is some gimmick in grub.conf...
No need, I can boot. I just want my MBR restored.
Quote:
Originally Posted by business_kid
as for man grub-install, forget it. Grub thinks man pages don't exist; for you are the infinitely infuriating 'info grub' pages :-). Grub & tar are the only programs that come to mind which force users to use info pages. Info pages generally seem to be a maze with no way out.
Well and truly spoken . As an aside: the "man" and "info" texts are identical...
@ yancek Thanks a lot. I found that out after I posted though I didn't know the geometry command. And yes, SuSE uses GRUB-legacy, they will probably switch with 12.2. Again, thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.