[opensuse] grub2 installation onto mdraid raid device
Hello: Here is what I would like to do: I have a system with two linux OSs, both are installed on mdraid raid1. I would like to install grub2 on the root partitions/devices of the given OSs, and a grub2 on MBR. The MBR grub2 would only chainload the other grub2 on the root partition. Is this possible, how? I tried to install grub2 on /dev/md2 using grub-install /dev/md2 and grub-setup /dev/md2 but apparently it hasn't succeeded, I can not chainload it. I would not like to have the real loader on MBR. Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 10 Nov 2014 02:01:09 +0100 (CET)
Istvan Gabor
Hello:
Here is what I would like to do: I have a system with two linux OSs, both are installed on mdraid raid1. I would like to install grub2 on the root partitions/devices of the given OSs, and a grub2 on MBR. The MBR grub2 would only chainload the other grub2 on the root partition. Is this possible, how?
Not really. grub2 does not support installation of core.img on Linux MD device. What is possible is to build core.img but not install it as first stage (grub2-install --no-bootsector) and build special core.img that will load and boot directly another /boot/grub2/i386-pc/core.img from Linux MD and use it as first stage loader. I'm not sure if either is directly supported by YaST. If you are interested to do it manually, I could explain how.
I tried to install grub2 on /dev/md2 using grub-install /dev/md2 and grub-setup /dev/md2 but apparently it hasn't succeeded, I can not chainload it.
I would not like to have the real loader on MBR.
Thanks,
Istvan
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Istvan Gabor
Here is what I would like to do:
Not really. grub2 does not support installation of core.img on Linux MD device. What is possible is to build core.img but not install it as first stage (grub2-install --no-bootsector) and build special core.img that will load and boot directly another /boot/grub2/i386-pc/core.img from Linux MD and use it as first stage loader. I'm not sure if either is directly supported by YaST. If you are interested to do it manually, I could explain how.
Thanks, Andrei. Yes, please, am interested. I also would like to know what is the correct method to install grub2 on the raid MBR. I read that I should install it on the devices that form the array, eg: grub-install /dev/sda, grub-install /dev/sdb. But I am not sure if this method is current or obsolete. And what is the case when I have partition arrays and not the whole disks are arranged to form the array? Eg. /dev/sda1 and /dev/sdb1 forms /dev/md0 etc. Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Wed, 12 Nov 2014 17:01:11 +0100 (CET)
Istvan Gabor
Istvan Gabor
írta: Here is what I would like to do:
Looking at it second time - why would you want it? What are you trying to achieve? At the end grub-install does exactly the same - it installs mini-bootloader in MBR that chainloads full grub from Linux MD boot partition.
Not really. grub2 does not support installation of core.img on Linux MD device. What is possible is to build core.img but not install it as first stage (grub2-install --no-bootsector) and build special core.img that will load and boot directly another /boot/grub2/i386-pc/core.img from Linux MD and use it as first stage loader. I'm not sure if either is directly supported by YaST. If you are interested to do it manually, I could explain how.
Thanks, Andrei. Yes, please, am interested. I also would like to know what is the correct method to install grub2 on the raid MBR. I read that I should install it on the devices that form the array, eg: grub-install /dev/sda, grub-install /dev/sdb. But I am not sure if this method is current or obsolete. And what is the case when I have partition arrays and not the whole disks are arranged to form the array? Eg. /dev/sda1 and /dev/sdb1 forms /dev/md0 etc.
To install grub2 in raid MBR you simply run grub2-install /dev/sda grub2-install /dev/sdb assuming your /boot is on mdXX=(sda1,sdb1) (or any other partitions on these disks). That is what YaST does anyway. So again - what are you trying to accomplish? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
Istvan Gabor írta:
Here is what I would like to do:
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve: Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the given OS on the root device of the OS. I installed another instance of the boot loader on MBR. This boot loader only linked/loaded the other boot loader on the root device. I lie this approach to make clear separations of different OSs. The mbr boot loader only list major types of OSs I can select. Eg: openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000 Here I select the major flavor. In the second boat loader I can select different options too. Eg in case of openSUSE 11.2: openSUSE 11.2 default openSUSE 11.2 pae openSUSE 11.2 custom kernel I don't want to put all different options in one menu/boot loader. It is also easier to dd the OS partitoin if the boot options/boat loader on the root partition. Please note that the above menu points are only examples. I did similar thing previously with lilo and grub legacy on non-raid devices. I would like to know how to make similar structure using grub2 and on mdraid raid devices.
Not really. grub2 does not support installation of core.img on Linux MD device. What is possible is to build core.img but not install it as first stage (grub2-install --no-bootsector) and build special core.img that will load and boot directly another /boot/grub2/i386-pc/core.img from Linux MD and use it as first stage loader. I'm not sure if either is directly supported by YaST. If you are interested to do it manually, I could explain how.
Thanks, Andrei. Yes, please, am interested. I also would like to know what is the correct method to install grub2 on the raid MBR. I read that I should install it on the devices that form the array, eg: grub-install /dev/sda, grub-install /dev/sdb. But I am not sure if this method is current or obsolete. And what is the case when I have partition arrays and not the whole disks are arranged to form the array? Eg. /dev/sda1 and /dev/sdb1 forms /dev/md0 etc.
To install grub2 in raid MBR you simply run
grub2-install /dev/sda grub2-install /dev/sdb
assuming your /boot is on mdXX=(sda1,sdb1) (or any other partitions on these disks). That is what YaST does anyway.
So again - what are you trying to accomplish?
I wanted to know this only for setting up my system until figuring out how to do what I wanted originally, see above. Thanks again, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, Nov 19, 2014 at 4:29 PM, Istvan Gabor
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
Istvan Gabor írta:
Here is what I would like to do:
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve:
Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the given OS on the root device of the OS. I installed another instance of the boot loader on MBR. This boot loader only linked/loaded the other boot loader on the root device. I lie this approach to make clear separations of different OSs. The mbr boot loader only list major types of OSs I can select. Eg:
openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000
This bootloader would need to store configuration somewhere. Configuration can be either embedded or stored on disk. Embedding makes it more difficult to change configuration in the future. Where was configuration of your MBR bootloader kept in the past? I would suggest having dedicated partition for first-stage bootloader and its configuration that can then be edited using normal editor. This partition can be on Linux MD. Is it acceptable? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov írta:
On Wed, Nov 19, 2014 at 4:29 PM, Istvan Gabor wrote:
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
Istvan Gabor írta:
Here is what I would like to do:
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve:
Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the >>given OS on the root device of the OS. I installed another instance of the boot loader >>on MBR. This boot loader only linked/loaded the other boot loader on the root device. I >>lie this approach to make clear separations of different OSs. The mbr boot loader only >>list major types of OSs I can select. Eg:
openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000
This bootloader would need to store configuration somewhere. Configuration can be either embedded or stored on disk. Embedding makes it more difficult to change configuration in the future.
I don't know the embedding method. I stored my configuration files in a separated directory on one of the OSs.
Where was configuration of your MBR bootloader kept in the past?
It was /boot/grub-chain on one of the linux OSs, and it had menu.lst etc. I installed grub using the grub shell, for the chainloader eg.: # grub GNU GRUB version 0.97 ... ... grub> root (hd0,0) ... grub> setup --force-lba --prefix=/boot/grub-chain (hd0) (hd0,0) ... grub> quit
I would suggest having dedicated partition for first-stage bootloader and its configuration that can then be edited using normal editor.
It's not clear for me what dedicated partitions means in this case. A separate /boot partition for all OSs, or only for grub2 bootloader?
This partition can be on Linux MD. Is it acceptable?
Probably. I'd like to see how this would be. Do I have to repartition my drives or is it enough to add a new partition (I have empty space for new partitions). Thanks. Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Thu, 20 Nov 2014 11:22:46 +0100 (CET)
Istvan Gabor
Andrei Borzenkov írta:
On Wed, Nov 19, 2014 at 4:29 PM, Istvan Gabor wrote:
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
Istvan Gabor írta:
>Here is what I would like to do:
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve:
Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the >>given OS on the root device of the OS. I installed another instance of the boot loader >>on MBR. This boot loader only linked/loaded the other boot loader on the root device. I >>lie this approach to make clear separations of different OSs. The mbr boot loader only >>list major types of OSs I can select. Eg:
openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000
This bootloader would need to store configuration somewhere. Configuration can be either embedded or stored on disk. Embedding makes it more difficult to change configuration in the future.
I don't know the embedding method. I stored my configuration files in a separated directory on one of the OSs.
Where was configuration of your MBR bootloader kept in the past?
It was /boot/grub-chain on one of the linux OSs, and it had menu.lst etc.
Then that's easy. 1. Install grub2 grub2-install --boot-directory=/boot/chain /dev/sda grub2-install --boot-directory=/boot/chain /dev/sdb 2. Create configuration with menu For each installed OS: - list of modules for partition access grub2-probe -t partmap /boot/grub2/i386-pc/core.img msdos msdos - list of modules for Linux MD/LVM grub2-probe -t abstraction /boot/grub2/i386-pc/core.img diskfilter mdraid1x - list of modules for filesystems (may be redundant, but still ...) grub2-probe -t fs /boot/grub2/i386-pc/core.img ext2 - filesystem UUID grub2-probe -t fs_uuid /boot/grub2/i386-pc/core.img cdae3bb7-7462-4b86-bc30-ff7e48f815d0 - file name on /boot filesystem grub2-mkrelpath /boot/grub2/i386-pc/core.img /grub2/i386-pc/core.img cat << \EOF > /boot/chain/grub2/grub.cfg
menuentry "openSUSE 13.2 first incarnation" { insmod part_msdos insmod diskfilter insmod mdraid1x insmod ext2 search --no-floppy --set --fs-uuid cdae3bb7-7462-4b86-bc30-ff7e48f815d0 multiboot /grub2/i386-pc/core.img } EOF
Repeat for each OS. Sprinkle with gfxterm or cryptsetup if needed. P.S. grub2-mkconfig does mostly the same :)
I would suggest having dedicated partition for first-stage bootloader and its configuration that can then be edited using normal editor.
It's not clear for me what dedicated partitions means in this case. A separate /boot partition for all OSs, or only for grub2 bootloader?
Only for grub bootloader. It makes sure you can reinstall your OS and bootloader is not affected.
This partition can be on Linux MD. Is it acceptable?
Probably. I'd like to see how this would be. Do I have to repartition my drives or is it enough to add a new partition (I have empty space for new partitions).
You do not really *need* new partition if you do not want. But yes, adding new partition would be enough. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov írta:
В Thu, 20 Nov 2014 11:22:46 +0100 (CET) Istvan Gabor
пишет: Andrei Borzenkov írta:
On Wed, Nov 19, 2014 at 4:29 PM, Istvan Gabor wrote:
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
Istvan Gabor írta:
>>Here is what I would like to do: >
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve:
Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the >>given OS on the root device of the OS. I installed another instance of the boot loader >>on MBR. This boot loader only linked/loaded the other boot loader on the root device. I >>lie this approach to make clear separations of different OSs. The mbr boot loader only >>list major types of OSs I can select. Eg:
openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000
This bootloader would need to store configuration somewhere. Configuration can be either embedded or stored on disk. Embedding makes it more difficult to change configuration in the future.
I don't know the embedding method. I stored my configuration files in a separated directory on one of the OSs.
Where was configuration of your MBR bootloader kept in the past?
It was /boot/grub-chain on one of the linux OSs, and it had menu.lst etc.
Then that's easy.
1. Install grub2
grub2-install --boot-directory=/boot/chain /dev/sda grub2-install --boot-directory=/boot/chain /dev/sdb
Andrei, I am now at the stage of installing grub2 on software raid. First I would like to install grub2 onto /dev/md0 raid array. This is the root partition of openSUSE 13.2 and it has /boot directory (that is, /boot is not on a separate partition). md0 is a mirror raid made of /dev/sdb11 and /dev/sdc11 md0 : active raid1 sdc11[1] sdb11[0] 62918464 blocks super 1.0 [2/2] [UU] bitmap: 1/1 pages [4KB], 65536KB chunk How can I install grub on this, possibly from oS 13.2? Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Sat, 3 Jan 2015 01:28:59 +0100 (CET)
Istvan Gabor
Andrei Borzenkov írta:
В Thu, 20 Nov 2014 11:22:46 +0100 (CET) Istvan Gabor
пишет: Andrei Borzenkov írta:
On Wed, Nov 19, 2014 at 4:29 PM, Istvan Gabor wrote:
Andrei Borzenkov írta:
В Wed, 12 Nov 2014 17:01:11 +0100 (CET) Istvan Gabor пишет:
> Istvan Gabor írta: > > >>Here is what I would like to do: > >
Looking at it second time - why would you want it? What are you trying to achieve? At >the end grub-install does exactly the same - it installs mini-bootloader in MBR that >chainloads full grub from Linux MD boot partition.
Thanks. Here is what I would lie to achieve:
Previously, when I used lilo or grub 1/legacy I always installed the boot loader for the >>given OS on the root device of the OS. I installed another instance of the boot loader >>on MBR. This boot loader only linked/loaded the other boot loader on the root device. I >>lie this approach to make clear separations of different OSs. The mbr boot loader only >>list major types of OSs I can select. Eg:
openSUSE 12.2 openSUSE 12.1 openSUSE 11.2 Gentoo Windows XP Windows 2000
This bootloader would need to store configuration somewhere. Configuration can be either embedded or stored on disk. Embedding makes it more difficult to change configuration in the future.
I don't know the embedding method. I stored my configuration files in a separated directory on one of the OSs.
Where was configuration of your MBR bootloader kept in the past?
It was /boot/grub-chain on one of the linux OSs, and it had menu.lst etc.
Then that's easy.
1. Install grub2
grub2-install --boot-directory=/boot/chain /dev/sda grub2-install --boot-directory=/boot/chain /dev/sdb
Andrei,
I am now at the stage of installing grub2 on software raid.
First I would like to install grub2 onto /dev/md0 raid array. This is the root partition of openSUSE 13.2 and it has /boot directory (that is, /boot is not on a separate partition). md0 is a mirror raid made of /dev/sdb11 and /dev/sdc11
md0 : active raid1 sdc11[1] sdb11[0] 62918464 blocks super 1.0 [2/2] [UU] bitmap: 1/1 pages [4KB], 65536KB chunk
How can I install grub on this, possibly from oS 13.2?
Unfortunately, you cannot (with exception of fake raid that is recognized by grub). You need to install grub2 outside of MD RAID. This should be possible using yast during installation, on summary screen you need to go to bootloader details and check "Enable Redundancy for MD Array" which then writes bootloader to MBR of both disks. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrei Borzenkov
-
Istvan Gabor