How do I configure grub to boot another linux distribution off an lvm partition?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2















(I no longer have this setup so I cannot test new answers, sorry. I had to switch computers and am now only using arch; I am leaving the question as it is though since I'd love to know a solution if it occurs again, grub has been very hostile towards me these past few months)
I have fedora 23 as my main OS with custom partitioning (all physical partitions) /boot/efi=/dev/sda1 root=/dev/sda3. Then on /dev/Sda2 I just set up an LVM physical partition, and created an LVM group (arch) and volume (root) and then I installed Arch Linux (without bootloader) on /dev/arch/root



I have /dev/sda (GPT), /dev/sdb (GPT) then grub also seems to detect a hd2 and gives errors about being unable to load it (I assume this is the LVM physical partition) anyhow, I use os-prober and grub2-mkconfig to detect my arch installation, which it successfully does (and does so two times, I get two menu entries for it); but when I try to boot it I get the following errors:



error: failure reading sector 0x0fc from 'hd2'.
error: failure reading sector 0x0e0 from 'hd2'.
error: failure reading sector 0x0 from 'hd2'.
error: can't find command 'linux'.
error: can't find command 'initrd'.


I only get the sector reading errors on the first boot attempt (for the record, fsck reports the drive to be clean) any retries only give me the can't find command errors.
This is the grub.conf menuentry:



### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch (on /dev/mapper/arch-Root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-38305dfb-279b-4490-948b-480b81fef81f'
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP' 38305dfb-279b-4490-948b-480b81fef81f
else
search --no-floppy --fs-uuid --set=root 38305dfb-279b-4490-948b-480b81fef81f
fi
linux /boot/vmlinuz-linux root=UUID=38305dfb-279b-4490-948b-480b81fef81f rw quiet
initrd /boot/initramfs-linux.img



Anyone got any ideas how to fix this? Any solution that will allow me to boot into arch (besides reinstalling the bootloader from arch instead of fedora) will be fine; I don't mind getting my hands dirty editing the grub.cfg file by hand.










share|improve this question
























  • Having the same problem with antergos

    – jcuenod
    May 8 '16 at 0:13











  • Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

    – jcuenod
    May 8 '16 at 0:14











  • Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

    – jcuenod
    May 8 '16 at 0:16















2















(I no longer have this setup so I cannot test new answers, sorry. I had to switch computers and am now only using arch; I am leaving the question as it is though since I'd love to know a solution if it occurs again, grub has been very hostile towards me these past few months)
I have fedora 23 as my main OS with custom partitioning (all physical partitions) /boot/efi=/dev/sda1 root=/dev/sda3. Then on /dev/Sda2 I just set up an LVM physical partition, and created an LVM group (arch) and volume (root) and then I installed Arch Linux (without bootloader) on /dev/arch/root



I have /dev/sda (GPT), /dev/sdb (GPT) then grub also seems to detect a hd2 and gives errors about being unable to load it (I assume this is the LVM physical partition) anyhow, I use os-prober and grub2-mkconfig to detect my arch installation, which it successfully does (and does so two times, I get two menu entries for it); but when I try to boot it I get the following errors:



error: failure reading sector 0x0fc from 'hd2'.
error: failure reading sector 0x0e0 from 'hd2'.
error: failure reading sector 0x0 from 'hd2'.
error: can't find command 'linux'.
error: can't find command 'initrd'.


I only get the sector reading errors on the first boot attempt (for the record, fsck reports the drive to be clean) any retries only give me the can't find command errors.
This is the grub.conf menuentry:



### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch (on /dev/mapper/arch-Root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-38305dfb-279b-4490-948b-480b81fef81f'
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP' 38305dfb-279b-4490-948b-480b81fef81f
else
search --no-floppy --fs-uuid --set=root 38305dfb-279b-4490-948b-480b81fef81f
fi
linux /boot/vmlinuz-linux root=UUID=38305dfb-279b-4490-948b-480b81fef81f rw quiet
initrd /boot/initramfs-linux.img



Anyone got any ideas how to fix this? Any solution that will allow me to boot into arch (besides reinstalling the bootloader from arch instead of fedora) will be fine; I don't mind getting my hands dirty editing the grub.cfg file by hand.










share|improve this question
























  • Having the same problem with antergos

    – jcuenod
    May 8 '16 at 0:13











  • Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

    – jcuenod
    May 8 '16 at 0:14











  • Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

    – jcuenod
    May 8 '16 at 0:16













2












2








2


1






(I no longer have this setup so I cannot test new answers, sorry. I had to switch computers and am now only using arch; I am leaving the question as it is though since I'd love to know a solution if it occurs again, grub has been very hostile towards me these past few months)
I have fedora 23 as my main OS with custom partitioning (all physical partitions) /boot/efi=/dev/sda1 root=/dev/sda3. Then on /dev/Sda2 I just set up an LVM physical partition, and created an LVM group (arch) and volume (root) and then I installed Arch Linux (without bootloader) on /dev/arch/root



I have /dev/sda (GPT), /dev/sdb (GPT) then grub also seems to detect a hd2 and gives errors about being unable to load it (I assume this is the LVM physical partition) anyhow, I use os-prober and grub2-mkconfig to detect my arch installation, which it successfully does (and does so two times, I get two menu entries for it); but when I try to boot it I get the following errors:



error: failure reading sector 0x0fc from 'hd2'.
error: failure reading sector 0x0e0 from 'hd2'.
error: failure reading sector 0x0 from 'hd2'.
error: can't find command 'linux'.
error: can't find command 'initrd'.


I only get the sector reading errors on the first boot attempt (for the record, fsck reports the drive to be clean) any retries only give me the can't find command errors.
This is the grub.conf menuentry:



### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch (on /dev/mapper/arch-Root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-38305dfb-279b-4490-948b-480b81fef81f'
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP' 38305dfb-279b-4490-948b-480b81fef81f
else
search --no-floppy --fs-uuid --set=root 38305dfb-279b-4490-948b-480b81fef81f
fi
linux /boot/vmlinuz-linux root=UUID=38305dfb-279b-4490-948b-480b81fef81f rw quiet
initrd /boot/initramfs-linux.img



Anyone got any ideas how to fix this? Any solution that will allow me to boot into arch (besides reinstalling the bootloader from arch instead of fedora) will be fine; I don't mind getting my hands dirty editing the grub.cfg file by hand.










share|improve this question
















(I no longer have this setup so I cannot test new answers, sorry. I had to switch computers and am now only using arch; I am leaving the question as it is though since I'd love to know a solution if it occurs again, grub has been very hostile towards me these past few months)
I have fedora 23 as my main OS with custom partitioning (all physical partitions) /boot/efi=/dev/sda1 root=/dev/sda3. Then on /dev/Sda2 I just set up an LVM physical partition, and created an LVM group (arch) and volume (root) and then I installed Arch Linux (without bootloader) on /dev/arch/root



I have /dev/sda (GPT), /dev/sdb (GPT) then grub also seems to detect a hd2 and gives errors about being unable to load it (I assume this is the LVM physical partition) anyhow, I use os-prober and grub2-mkconfig to detect my arch installation, which it successfully does (and does so two times, I get two menu entries for it); but when I try to boot it I get the following errors:



error: failure reading sector 0x0fc from 'hd2'.
error: failure reading sector 0x0e0 from 'hd2'.
error: failure reading sector 0x0 from 'hd2'.
error: can't find command 'linux'.
error: can't find command 'initrd'.


I only get the sector reading errors on the first boot attempt (for the record, fsck reports the drive to be clean) any retries only give me the can't find command errors.
This is the grub.conf menuentry:



### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch (on /dev/mapper/arch-Root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-38305dfb-279b-4490-948b-480b81fef81f'
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP' 38305dfb-279b-4490-948b-480b81fef81f
else
search --no-floppy --fs-uuid --set=root 38305dfb-279b-4490-948b-480b81fef81f
fi
linux /boot/vmlinuz-linux root=UUID=38305dfb-279b-4490-948b-480b81fef81f rw quiet
initrd /boot/initramfs-linux.img



Anyone got any ideas how to fix this? Any solution that will allow me to boot into arch (besides reinstalling the bootloader from arch instead of fedora) will be fine; I don't mind getting my hands dirty editing the grub.cfg file by hand.







boot grub2 lvm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 2 '16 at 13:02







Cestarian

















asked Mar 7 '16 at 19:00









CestarianCestarian

85911225




85911225












  • Having the same problem with antergos

    – jcuenod
    May 8 '16 at 0:13











  • Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

    – jcuenod
    May 8 '16 at 0:14











  • Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

    – jcuenod
    May 8 '16 at 0:16

















  • Having the same problem with antergos

    – jcuenod
    May 8 '16 at 0:13











  • Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

    – jcuenod
    May 8 '16 at 0:14











  • Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

    – jcuenod
    May 8 '16 at 0:16
















Having the same problem with antergos

– jcuenod
May 8 '16 at 0:13





Having the same problem with antergos

– jcuenod
May 8 '16 at 0:13













Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

– jcuenod
May 8 '16 at 0:14





Have you tried adding GRUB_USE_LINUXEFI=true to your /etc/default/grub (see forums.opensuse.org/showthread.php/…)? This didn't work for me but I thought I'd suggest it.

– jcuenod
May 8 '16 at 0:14













Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

– jcuenod
May 8 '16 at 0:16





Also, if you manually edit the last two lines to be linuxefi /boot/vm.... and initrdefi /boot/init... it will at least find the commands but I'm still having problems.

– jcuenod
May 8 '16 at 0:16










2 Answers
2






active

oldest

votes


















0














I had installed Debian without LVM partitioning and next to that I installed Fedora which installed with LVM when using the guided partitioning on the remaining disk space. Since debian installed without LVM it couldn't read the fedora partitions to add a grub entry for it when running grub2-mkconfig. What worked for me was installing the lvm2 package on Debian and running update-grub.






share|improve this answer






























    -1














    You said you installed Arch without a bootloader. The errors you posted hint that there is no valid boot sector at all. IIWY I'd install Arch Linux, then install Fedora 23. The fedors installer will overwrite the boot sector with it's grub, and worst case, you can use a custom grub entry to chainload Arch.



    I'm pretty far from being a grub expert, but I did just get my laptop booting Windows 7, Solaris 11, CentOS 7, and Ubuntu 14.04 :-D I had to do some tapdancing!






    share|improve this answer























    • Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

      – Cestarian
      Mar 8 '16 at 17:27











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268240%2fhow-do-i-configure-grub-to-boot-another-linux-distribution-off-an-lvm-partition%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I had installed Debian without LVM partitioning and next to that I installed Fedora which installed with LVM when using the guided partitioning on the remaining disk space. Since debian installed without LVM it couldn't read the fedora partitions to add a grub entry for it when running grub2-mkconfig. What worked for me was installing the lvm2 package on Debian and running update-grub.






    share|improve this answer



























      0














      I had installed Debian without LVM partitioning and next to that I installed Fedora which installed with LVM when using the guided partitioning on the remaining disk space. Since debian installed without LVM it couldn't read the fedora partitions to add a grub entry for it when running grub2-mkconfig. What worked for me was installing the lvm2 package on Debian and running update-grub.






      share|improve this answer

























        0












        0








        0







        I had installed Debian without LVM partitioning and next to that I installed Fedora which installed with LVM when using the guided partitioning on the remaining disk space. Since debian installed without LVM it couldn't read the fedora partitions to add a grub entry for it when running grub2-mkconfig. What worked for me was installing the lvm2 package on Debian and running update-grub.






        share|improve this answer













        I had installed Debian without LVM partitioning and next to that I installed Fedora which installed with LVM when using the guided partitioning on the remaining disk space. Since debian installed without LVM it couldn't read the fedora partitions to add a grub entry for it when running grub2-mkconfig. What worked for me was installing the lvm2 package on Debian and running update-grub.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 17 '17 at 3:32









        Odin MugabeOdin Mugabe

        212




        212























            -1














            You said you installed Arch without a bootloader. The errors you posted hint that there is no valid boot sector at all. IIWY I'd install Arch Linux, then install Fedora 23. The fedors installer will overwrite the boot sector with it's grub, and worst case, you can use a custom grub entry to chainload Arch.



            I'm pretty far from being a grub expert, but I did just get my laptop booting Windows 7, Solaris 11, CentOS 7, and Ubuntu 14.04 :-D I had to do some tapdancing!






            share|improve this answer























            • Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

              – Cestarian
              Mar 8 '16 at 17:27
















            -1














            You said you installed Arch without a bootloader. The errors you posted hint that there is no valid boot sector at all. IIWY I'd install Arch Linux, then install Fedora 23. The fedors installer will overwrite the boot sector with it's grub, and worst case, you can use a custom grub entry to chainload Arch.



            I'm pretty far from being a grub expert, but I did just get my laptop booting Windows 7, Solaris 11, CentOS 7, and Ubuntu 14.04 :-D I had to do some tapdancing!






            share|improve this answer























            • Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

              – Cestarian
              Mar 8 '16 at 17:27














            -1












            -1








            -1







            You said you installed Arch without a bootloader. The errors you posted hint that there is no valid boot sector at all. IIWY I'd install Arch Linux, then install Fedora 23. The fedors installer will overwrite the boot sector with it's grub, and worst case, you can use a custom grub entry to chainload Arch.



            I'm pretty far from being a grub expert, but I did just get my laptop booting Windows 7, Solaris 11, CentOS 7, and Ubuntu 14.04 :-D I had to do some tapdancing!






            share|improve this answer













            You said you installed Arch without a bootloader. The errors you posted hint that there is no valid boot sector at all. IIWY I'd install Arch Linux, then install Fedora 23. The fedors installer will overwrite the boot sector with it's grub, and worst case, you can use a custom grub entry to chainload Arch.



            I'm pretty far from being a grub expert, but I did just get my laptop booting Windows 7, Solaris 11, CentOS 7, and Ubuntu 14.04 :-D I had to do some tapdancing!







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 8 '16 at 16:45









            John OliverJohn Oliver

            343




            343












            • Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

              – Cestarian
              Mar 8 '16 at 17:27


















            • Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

              – Cestarian
              Mar 8 '16 at 17:27

















            Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

            – Cestarian
            Mar 8 '16 at 17:27






            Reinstalling fedora is way too much pain, and even if it wasn't, what you're suggesting should be doable with a simple grub2-install command as far as I'm aware. If you think I can make a custom grub entry to chainload arch then please detail how and I will try.

            – Cestarian
            Mar 8 '16 at 17:27


















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268240%2fhow-do-i-configure-grub-to-boot-another-linux-distribution-off-an-lvm-partition%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay