[opensuse] Question about Grub2
Hello - am going to start a new thread for this question. In my recent set of machinations with setting up a new disk for my system, to replace one that may be failing, I encountered a problem for which I couldn't find an easy answer. It appears that when I tell the YaST boot loader setup tool to configure and create a new MBR it does so on the same disk which has the partition that contains the OS files. My system now has 4 drives installed and the BIOS only allows me to select just 3 drives (it's choice as to which 3 drives I get to choose from) to specify the order in which to search the drives for a boot loader. And my new drive now contains the partition which contains my Leap42.1 system. Because I was adding a new 4rth drive, the BIOS is not presenting the new drive to me as one of the options to use for setting up the search order, for a boot loader. I finally managed to get the BIOS to present it by disconnecting one of the other drives but that is an unacceptable solution in the long run. BTW the way I managed to boot up the Leap42.1 system was to boot up an older SuSE system located on one of the other drives and use Yast there to discover all the available OS's, create a boot menu for them, and then use the MBR/Grub menu it wrote out to select the Leap42.1 system. That works, but it took a lot of head scratching to figure out that was what I needed to do. So my question is this - is there some way to tell the YaST boot setup tool that I want to specify which drive that I want it to create an MBR on? Marc... -- "The Truth is out there" - Spooky -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
11.10.2016 05:36, Marc Chamberlin пишет:
Hello - am going to start a new thread for this question. In my recent set of machinations with setting up a new disk for my system, to replace one that may be failing, I encountered a problem for which I couldn't find an easy answer. It appears that when I tell the YaST boot loader setup tool to configure and create a new MBR it does so on the same disk which has the partition that contains the OS files. My system now has 4 drives installed and the BIOS only allows me to select just 3 drives (it's choice as to which 3 drives I get to choose from) to specify the order in which to search the drives for a boot loader. And my new drive now contains the partition which contains my Leap42.1 system. Because I was adding a new 4rth drive, the BIOS is not presenting the new drive to me as one of the options to use for setting up the search order, for a boot loader. I finally managed to get the BIOS to present it by disconnecting one of the other drives but that is an unacceptable solution in the long run.
BTW the way I managed to boot up the Leap42.1 system was to boot up an older SuSE system located on one of the other drives and use Yast there to discover all the available OS's, create a boot menu for them, and then use the MBR/Grub menu it wrote out to select the Leap42.1 system. That works, but it took a lot of head scratching to figure out that was what I needed to do.
So my question is this - is there some way to tell the YaST boot setup tool that I want to specify which drive that I want it to create an MBR on?
If BIOS does not allow booting from this drive, it does not matter whether YaST does something or not. If the problem is only boot device selection in BIOS, you can simply install bootloader on any other drive. If BIOS does not see your drive at all, then the whole /boot must be located on a drive, accessible to BIOS. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/10/2016 8:27 PM, Andrei Borzenkov wrote:
11.10.2016 05:36, Marc Chamberlin пишет:
Hello - am going to start a new thread for this question. In my recent set of machinations with setting up a new disk for my system, to replace one that may be failing, I encountered a problem for which I couldn't find an easy answer. It appears that when I tell the YaST boot loader setup tool to configure and create a new MBR it does so on the same disk which has the partition that contains the OS files. My system now has 4 drives installed and the BIOS only allows me to select just 3 drives (it's choice as to which 3 drives I get to choose from) to specify the order in which to search the drives for a boot loader. And my new drive now contains the partition which contains my Leap42.1 system. Because I was adding a new 4rth drive, the BIOS is not presenting the new drive to me as one of the options to use for setting up the search order, for a boot loader. I finally managed to get the BIOS to present it by disconnecting one of the other drives but that is an unacceptable solution in the long run.
BTW the way I managed to boot up the Leap42.1 system was to boot up an older SuSE system located on one of the other drives and use Yast there to discover all the available OS's, create a boot menu for them, and then use the MBR/Grub menu it wrote out to select the Leap42.1 system. That works, but it took a lot of head scratching to figure out that was what I needed to do.
So my question is this - is there some way to tell the YaST boot setup tool that I want to specify which drive that I want it to create an MBR on?
If BIOS does not allow booting from this drive, it does not matter whether YaST does something or not. If the problem is only boot device selection in BIOS, you can simply install bootloader on any other drive. If BIOS does not see your drive at all, then the whole /boot must be located on a drive, accessible to BIOS.
Thanks Andrei for trying to help but I guess I am somewhat confused. (And I will admit I don't fully grok the documentation on Grub2 and Yast) I don't think the issue is that BIOS is not allowing booting from my new drive, it can and I did manage to get it to do so. The problem is that the BIOS setup GUI is designed to only show up to 3 drives in the menu where one can configure the order to search them. My new drive did not initially show up as one of the possible drives to search for a boot loader, but when I disconnected one of the other drives, then my new drive did show up in that list, and I was able to move it to the first drive to search, at which point it did indeed boot up. (I could tell that it was booting up off my new drive because it presented the fancy new boot menu interface that came with Leap 42.1) But when I reconnected the drive that I had disconnected, I lost the ability to boot off the new drive and the system when back to booting up from one of the other drives. Moving SATA cables around to different ports did not make a difference in this behavior either, sigh. IMHO this is a rather poor design of the BIOS UI and apparently I have no control over which set of drives it is going to select to present for configuring the search order. I think your second comment was the jist of my original question. How do I get YaST to allow me to select a drive to install an MBR bootloader on? It seems to want to only install it on the same drive that I installed the operating system on that YaST is running under. If I understand your third statement, (and I admit I am on unsure footing here) I think you are saying that I should create a partition on one of the drives that the BIOS is seeing when I have all four drives connected? And then mount this partition at /boot ? I have thought about doing that, but it seems fraught with other issues so I have not done this. What file system do I choose for this partition? What size should it be? Is this partition to be mounted at /boot for all the different OS's that I want to boot up? If so, what guarantee is there that the contents of this partition will remain both forward and backward compatible with different OS's? And don't I still have the problem of getting an MBR written out onto a drive that the BIOS is willing to work with? To phrase that last question a different way, does YaST install the MBR on the drive that / is located on, or does YaST install the MBR on the drive that /boot is located on? Or is there some other model being used that I don't grok? If I understand the boot loader model correctly, then I believe the MBR exists outside of partitions and is just located on the first section of a drive. This means each drive can have an MBR. And the MBR contains bootloader code and a pointer to a partition/file system where a GRUB bootloader (or some other OS bootloader) is stored. And the GRUB bootloader brings up a menu via which a user can use to select an actual OS to load. But it seems to me that there is a potential disconnect here. The BIOS has to find an MBR somehow and makes it's assumptions about where to look to find it. And YaST is making assumptions about where to write an MBR based on characteristics associated with the OS that it is running under (mount points perhaps???) And what I found is that these two sets of assumptions don't necessarily overlap. Especially if I use YaST in one OS to set up a GRUB option to start a different OS on a different drive. And then start that second OS, and use YaST in that second OS to create a new MBR and a new GRUB bootloader with a new/different set of boot menu options. In my situation that new MBR was not placed on a drive that the BIOS had in it's search list, instead it was place on the new drive where the second OS was installed. Therefore the BIOS does not find it, and the new GRUB bootloader is not executed. So to get around this problem, shouldn't I simply be able to tell YaST which drive I want it to create and install an MBR on rather than have it make (wrong) assumptions? I recognize there is a risk of overwriting an existing MBR that points to a different GRUB bootloader, but in this scenario that seems like exactly what I want to do. This is all very unclear to me from my reading the documentation.... Sorry for the long effort to express my confusion.... Marc... -- "The Truth is out there" - Spooky -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-10-11 09:27, Marc Chamberlin wrote:
Thanks Andrei for trying to help but I guess I am somewhat confused. (And I will admit I don't fully grok the documentation on Grub2 and Yast)
I don't think the issue is that BIOS is not allowing booting from my new drive, it can and I did manage to get it to do so. The problem is that the BIOS setup GUI is designed to only show up to 3 drives in the menu where one can configure the order to search them. My new drive did not initially show up as one of the possible drives to search for a boot loader, but when I disconnected one of the other drives, then my new drive did show up in that list, and I was able to move it to the first drive to search, at which point it did indeed boot up. (I could tell that it was booting up off my new drive because it presented the fancy new boot menu interface that came with Leap 42.1) But when I reconnected the drive that I had disconnected, I lost the ability to boot off the new drive and the system when back to booting up from one of the other drives. Moving SATA cables around to different ports did not make a difference in this behavior either, sigh. IMHO this is a rather poor design of the BIOS UI and apparently I have no control over which set of drives it is going to select to present for configuring the search order.
Ok, so that "invisible" disk has now the system installed properly and it boots when it is visible. One reason for a disk to be invisible might be that it has the same ID as another disk :-? fdisk -l /dev/sdb ... Disk label type: dos Disk identifier: 0x00... <=== Just a wild guess. This can happen when cloning a disk. fdisk can change that ID.
I think your second comment was the jist of my original question. How do I get YaST to allow me to select a drive to install an MBR bootloader on? It seems to want to only install it on the same drive that I installed the operating system on that YaST is running under.
If I understand your third statement, (and I admit I am on unsure footing here) I think you are saying that I should create a partition on one of the drives that the BIOS is seeing when I have all four drives connected? And then mount this partition at /boot ? I have thought about doing that, but it seems fraught with other issues so I have not done this. What file system do I choose for this partition?
ext2
What size should it be?
500 MB.
Is this partition to be mounted at /boot for all the different OS's that I want to boot up?
Only for one.
And don't I still have the problem of getting an MBR written out onto a drive that the BIOS is willing to work with?
No, because you are writing to another disk that is one of the three that are visible.
To phrase that last question a different way, does YaST install the MBR on the drive that / is located on, or does YaST install the MBR on the drive that /boot is located on? Or is there some other model being used that I don't grok?
Where boot is located.
If I understand the boot loader model correctly, then I believe the MBR exists outside of partitions and is just located on the first section of a drive. This means each drive can have an MBR. And the MBR contains bootloader code and a pointer to a partition/file system where a GRUB bootloader (or some other OS bootloader) is stored.
Yes.
And the GRUB bootloader brings up a menu via which a user can use to select an actual OS to load.
Yes There is another method, one that I'm using (with help). You install a small Linux in the disk that the computer wants to boot, complete with its own grub. A single partition. Minimal X install. Or text only if you are happy with it. Less than 10 GB suffices, maybe 6. It can also be used as rescue system on emergencies. This Grub is prepared to boot other grub setups on other disks. The second grub does not use the disk mbr, it is installed on the root filesystem of that install. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 10/11/2016 09:55 AM, Carlos E. R. wrote:
One reason for a disk to be invisible might be that it has the same ID as another disk :-?
A side effect of using dd perhaps? One reason I don't use dd for copying file systems or migrating disks. Of course now I have LVM to take care of that. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-10-11 17:49, Anton Aylward wrote:
On 10/11/2016 09:55 AM, Carlos E. R. wrote:
One reason for a disk to be invisible might be that it has the same ID as another disk :-?
A side effect of using dd perhaps?
Yes.
One reason I don't use dd for copying file systems or migrating disks. Of course now I have LVM to take care of that.
On the other hand, if you want to keep Windows, you have to keep the ID. It is one of the things Windows, at least since version 7, checks to see it is running in the the same computer. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 11/10/16 07:55 AM, Carlos E. R. wrote:
One reason for a disk to be invisible might be that it has the same ID as another disk :-?
fdisk -l /dev/sdb ... Disk label type: dos Disk identifier: 0x00... <===
I have (at least) 2 disks that show the same identifier number with that command line, yet both show up in BIOS as candidates for the boot drive selection. I suspect this problem is merely a wonky BIOS rather than anything grub/fdisk/dd might have done. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
11.10.2016 10:27, Marc Chamberlin пишет:
On 10/10/2016 8:27 PM, Andrei Borzenkov wrote:
11.10.2016 05:36, Marc Chamberlin пишет:
Hello - am going to start a new thread for this question. In my recent set of machinations with setting up a new disk for my system, to replace one that may be failing, I encountered a problem for which I couldn't find an easy answer. It appears that when I tell the YaST boot loader setup tool to configure and create a new MBR it does so on the same disk which has the partition that contains the OS files. My system now has 4 drives installed and the BIOS only allows me to select just 3 drives (it's choice as to which 3 drives I get to choose from) to specify the order in which to search the drives for a boot loader. And my new drive now contains the partition which contains my Leap42.1 system. Because I was adding a new 4rth drive, the BIOS is not presenting the new drive to me as one of the options to use for setting up the search order, for a boot loader. I finally managed to get the BIOS to present it by disconnecting one of the other drives but that is an unacceptable solution in the long run.
BTW the way I managed to boot up the Leap42.1 system was to boot up an older SuSE system located on one of the other drives and use Yast there to discover all the available OS's, create a boot menu for them, and then use the MBR/Grub menu it wrote out to select the Leap42.1 system. That works, but it took a lot of head scratching to figure out that was what I needed to do.
So my question is this - is there some way to tell the YaST boot setup tool that I want to specify which drive that I want it to create an MBR on?
If BIOS does not allow booting from this drive, it does not matter whether YaST does something or not. If the problem is only boot device selection in BIOS, you can simply install bootloader on any other drive. If BIOS does not see your drive at all, then the whole /boot must be located on a drive, accessible to BIOS.
Thanks Andrei for trying to help but I guess I am somewhat confused. (And I will admit I don't fully grok the documentation on Grub2 and Yast)
I don't think the issue is that BIOS is not allowing booting from my new drive,
Really?
But when I reconnected the drive that I had disconnected, I lost the ability to boot off the new drive and the system when back to booting up from one of the other drives.
This says exactly opposite. ...
I think your second comment was the jist of my original question. How do I get YaST to allow me to select a drive to install an MBR bootloader on? It seems to want to only install it on the same drive that I installed the operating system on that YaST is running under.
Select "Custom boot partition" and chose any device you want. Do *not* select any other option.
If I understand your third statement, (and I admit I am on unsure footing here) I think you are saying that I should create a partition on one of the drives that the BIOS is seeing when I have all four drives connected?
If drive appears in BIOS when you disconnect one of other drives, it is not necessary (as long as you install in MBR of another drive and have enough space post MBR so grub2 fits into it). ...
If I understand the boot loader model correctly, then I believe the MBR exists outside of partitions and is just located on the first section of a drive.
Well, MBR is highly ambiguous. MBR stands for Master Boot Record and actually means code that is executed by BIOS. This code is in the very first sector of disk. Now this sector *also* contains partition table. But there is nothing that prevents one of partitions to start at sector 0 thus including MBR. Normally nobody does it.
This means each drive can have an MBR. And the MBR contains bootloader code and a pointer to a partition/file system where a GRUB bootloader (or some other OS bootloader) is stored. And the GRUB bootloader brings up a menu via which a user can use to select an actual OS to load.
Yes, that is correct.
But it seems to me that there is a potential disconnect here. The BIOS has to find an MBR somehow and makes it's assumptions about where to look to find it. And YaST is making assumptions about where to write an MBR based on characteristics associated with the OS that it is running under (mount points perhaps???)
YaST simply takes the very first device in the list. If EDD is available it can make educated guess which device is the very first device in BIOS order; unfortunately this (usually) is not available when booting using grub2. You can reorder devices manually though.
And what I found is that these two sets of assumptions don't necessarily overlap.
Which is why grub2 itself does not rely on or care about device order.
Especially if I use YaST in one OS to set up a GRUB option to start a different OS on a different drive.
In this case grub in one OS directly loads kernel of another OS so device order is not relevant at all.
And then start that second OS, and use YaST in that second OS to create a new MBR and a new GRUB bootloader with a new/different set of boot menu options. In my situation that new MBR was not placed on a drive that the BIOS had in it's search list, instead it was place on the new drive where the second OS was installed. Therefore the BIOS does not find it, and the new GRUB bootloader is not executed. So to get around this problem, shouldn't I simply be able to tell YaST which drive I want it to create and install an MBR on rather than have it make (wrong) assumptions?
See above. You are able to tell it, using at least two methods.
I recognize there is a risk of overwriting an existing MBR that points to a different GRUB bootloader, but in this scenario that seems like exactly what I want to do. This is all very unclear to me from my reading the documentation....
Sorry for the long effort to express my confusion.... Marc...
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/10/2016 10:36 PM, Marc Chamberlin wrote:
My system now has 4 drives installed and the BIOS only allows me to select just 3 drives (it's choice as to which 3 drives I get to choose from)
That sounds to me like a limitation of your BIOS, that there are three slot and only three slots.
So my question is this - is there some way to tell the YaST boot setup tool that I want to specify which drive that I want it to create an MBR on?
I don't know about Yast, I'm one of those people who grew up using the command line tools since I had to admin non-openSuse systems, The cli command 'mkinitrd' builds the kernel image. This gets run every time you install a new kernel, be it with Yast or zapper. This also build the Grub/grub2 menu. in due course it calls update-bootloader(8) later model openSuse, I'm sing 13.2 here and reading those manual pages, but i presume the same ordering/sequence of events applies in LEAP, makes use of 'dracut' which is a lot more flexible. part of that is that it makes it very clear which device is being used for bootthat is where the MBR gets written, where the initrd gets written. Please realise that in the grub2 entry under each menu you can set the root device in a number of ways. One of the tools that dracut/mkinitrd employs is 'os-prober'. (That too is configurable but lets keep things simple for now.) The result of this is that the boot menu in grub2.cfg can contain entries for every device, every partition on every device. I'm not sure how, or even if, yast handles this, but at the CLI level it all becomes very visible. The config files, the parameters, the sequence of operations is all very clear. There's an article from long ago about the relative attitudes of Windows style admins and Linux style admins. http://www.zdnet.com/article/why-many-mcses-wont-learn-linux/ Personally I think it goes deeper than jsut patterns vs 'sui generis' and even deeper than understanding principles knowing how to operate a GUI. Of course here's this http://imgs.xkcd.com/comics/real_programmers.png Marc, there's a point where what you're trying to do is beyond what Yast was intended for and it becomes massively more simple to use the CLI tools so you can see what you're doing and instruct the system to do EXACTLY what you want. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Anton Aylward
-
Carlos E. R.
-
Darryl Gregorash
-
Marc Chamberlin