Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
On 07/30/2010 03:21 PM, Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
It can if you set the MBR for each boot partition. For example:
#grub grub> find /grub/stage1 hd0,4 hd0,6 hd0,8
In my setup, 4 is a front-end, MBR for the entire drive and the boot partition has a single grub directory with all of the stages, splash, grub.conf and no kernel/initrc/mem/etc., nothing above the grub directory. Just make sure that the grub directory is the latest grub that supports ext4. The grub.conf file contains only chainloaders such as:
title Fedora 13 rootnoverify (hd0,6) chainloader +1 savedefault
title Ubuntu 10 rootnoverify (hd0,8) chainloader +1 savedefault
As seen above, 6 is Fedora's boot partition, 7 is Fedora's root partition, 8 is Ubuntu's boot partition (using old grub, not grub2) and 9 is Ubuntu's root partition and so on.
To get the ball rolling one must in grub do:
grub> root (hd0,4) # Master grub MBR grub> setup (hd0) grub> root (hd0,6) # Fedora grub> setup (hd0,6) grub> root (hd0,8) # Ubuntu grub> setup (hd0,8)
So you will basically get two grub menus, one for the master list (MBR) and the other for the selected OS containing it's own kernel context information.
Hope this helps.
On Fri, 30 Jul 2010 18:33:53 -0700, Daniel wrote:
On 07/30/2010 03:21 PM, Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
It can.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
It can if you set the MBR for each boot partition.
Be careful here. There is only one Master Boot Record. By definition, the MBR is the first sector of the storage medium, which also holds the partition table and is located in front of the first partition. What you refer to is the Partition Boot Sector, the first sector of a partition.
For example:
#grub grub> find /grub/stage1 hd0,4 hd0,6 hd0,8
In my setup, 4 is a front-end, MBR for the entire drive and the boot partition has a single grub directory with all of the stages, splash, grub.conf and no kernel/initrc/mem/etc., nothing above the grub directory. Just make sure that the grub directory is the latest grub that supports ext4. The grub.conf file contains only chainloaders such as:
title Fedora 13 rootnoverify (hd0,6) chainloader +1 savedefault
title Ubuntu 10 rootnoverify (hd0,8) chainloader +1 savedefault
'rootnoverify' should only be necessary, if the primary GRUB doesn't understand the filesystem used on the chainloaded partition. If the MBR's GRUB is a recent one like from Fedora 13 or Rawhide, you can use 'root' instead of 'rootnoverify'.
'savedefault' in a GRUB example without explaining it is not good. It is not needed.
Michael Schwendt wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
It can.
Well, I know it can, since I described (below) exactly how I did it.
But what puzzles me - and none of the gurus in this thread seem to have answered my question - is that I can do it interactively, but when I put exactly the same commands into grub.conf they do not work.
WHY IS THIS?
I'm using the standard grub in a standard up-to-date Fedora-13.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
Incidentally, you say it can be done. So why not just give your stanza in grub.conf that has the desired effect?
On Sat, 31 Jul 2010 13:16:10 +0200, Timothy wrote:
But what puzzles me - and none of the gurus in this thread seem to have answered my question -
But of course! There was only one question mark in your message, and the question in front of it has been answered.
is that I can do it interactively, but when I put exactly the same commands into grub.conf they do not work.
WHY IS THIS?
PEBKAC?
I'm using the standard grub in a standard up-to-date Fedora-13.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
Why don't you load the grub.conf from /dev/sda5 instead of loading kernel and initrd manually?
And even that would not be "chain-loading" or "booting from a logical partition". For either one, you would install a GRUB boot loader into the first sector of /dev/sda5.
Incidentally, you say it can be done. So why not just give your stanza in grub.conf that has the desired effect?
To boot /dev/sda5 from any GRUB, I do:
title SomeOS root (hd0,4) chainloader +1
That is under the assumption that /dev/sda5 contains a boot loader in its first sector.
On Sat, 31 Jul 2010 19:57:24 +0200 Michael Schwendt mschwendt@gmail.com wrote:
On Sat, 31 Jul 2010 13:16:10 +0200, Timothy wrote:
But what puzzles me - and none of the gurus in this thread seem to have answered my question -
But of course! There was only one question mark in your message, and the question in front of it has been answered.
is that I can do it interactively, but when I put exactly the same commands into grub.conf they do not work.
WHY IS THIS?
PEBKAC?
I'm using the standard grub in a standard up-to-date Fedora-13.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
Why don't you load the grub.conf from /dev/sda5 instead of loading kernel and initrd manually?
And even that would not be "chain-loading" or "booting from a logical partition". For either one, you would install a GRUB boot loader into the first sector of /dev/sda5.
Incidentally, you say it can be done. So why not just give your stanza in grub.conf that has the desired effect?
To boot /dev/sda5 from any GRUB, I do:
title SomeOS root (hd0,4) chainloader +1
That is under the assumption that /dev/sda5 contains a boot loader in its first sector.
Here is a /boot/grub/grub.conf which boots from a logicasl "shared" /boot partition:
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,4) # kernel /vmlinuz-version ro root=/dev/sda10 # initrd /initrd-[generic-]version.img #boot=/dev/sda5 default=0 timeout=15 splashimage=(hd0,4)/grub/splash.xpm.gz # hiddenmenu
title Desktop -- openSUSE 11.3 - 2.6.34-12 root (hd0,4) kernel /vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-ST9500420AS_5VJ1AKS0-part11 resume=/dev/disk/by-id/ata-ST9500420AS_5VJ1AKS0-part6 splash=silent quiet showopts vga=0x317 ipv6.disable=1 initrd /initrd-2.6.34-12-desktop
###Don't change this comment - YaST2 identifier: Original name: failsafe### title Failsafe -- openSUSE 11.3 - 2.6.34-12 root (hd0,4) kernel /vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-ST9500420AS_5VJ1AKS0-part11 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317 ipv6.disable=1 initrd /initrd-2.6.34-12-desktop
###Don't change this comment - YaST2 identifier: Original name: linux### title Fedora (2.6.33.6-147.fc13.x86_64) root (hd0,4) kernel /vmlinuz-2.6.33.6-147.fc13.x86_64 ro root=UUID=a8a2b010-e6d3-4493-b55a-e52a79d2ae66 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet initrd /initramfs-2.6.33.6-147.fc13.x86_64.img
title Fedora (2.6.33.3-85.fc13.x86_64) root (hd0,4) kernel /vmlinuz-2.6.33.3-85.fc13.x86_64 ro root=UUID=a8a2b010-e6d3-4493-b55a-e52a79d2ae66 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet initrd /initramfs-2.6.33.3-85.fc13.x86_64.img
title Windoze 7 rootnoverify (hd0,0) chainloader +1
You can see that the only chainloader needed is for windows, not for other linux distros.
Tom
-- Tom Taylor - retired penguin openSuSE 11.3 x86_64 Fedora 13 KDE 4.4.4 rel 2, FF 3.6.6 claws-mail 3.7.6 registered linux user 263467 linxt-At-comcast-DoT-net
Patrick O'Callaghan wrote:
PEBKAC?
What exactly does that mean?
Not sure if this is what you're asking, but PEBKAC stands for Problem Exists Between Keyboard And Chair.
I knew that.
But I didn't see the relevance to the question I asked, which was not answered and has not been - Why do I get a different result entering commands in grub interactively, and giving the same commands in grub.conf ?
On Sun, 01 Aug 2010 10:37:39 +0200, Timothy wrote:
Patrick O'Callaghan wrote:
PEBKAC?
What exactly does that mean?
Not sure if this is what you're asking, but PEBKAC stands for Problem Exists Between Keyboard And Chair.
I knew that.
But I didn't see the relevance to the question I asked,
Really?
The relevance is that maybe you make a mistake when editing your grub.conf. Nobody can tell. You haven't quoted the grub.conf entry, and you haven't given details about your partitioning either. What is the test-case for reproducibility?
which was not answered and has not been - Why do I get a different result entering commands in grub interactively, and giving the same commands in grub.conf ?
The answer doesn't change.
Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
I'm using legacy grub1 for booting from logical partitions (ext2/ext3 and now ext4) routinely long since early Fedora (maybe Redhat 7.x/8/9) versions, already without problems.
But just now on F13 i686 I run across other, maybe similar problem: I install it on /dev/sda8 (sda is 200GB SATA drive, DOS type partition table, grub installed in MBR), installation passed OK. But when booting, grub not print any error, but display stage2 message:
GNU GRUB version 0.97 (639K lower / 1047488K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.
It seems to me as if it could not find configfile. But, when I type "root (hd0,7)" and "configfile /boot/grub/grub.conf" (or "configfile /boot/grub/menu.lst"), then normally appears f13 grub splash screen with menu items and after selecting one grub correctly boot it.
- reinstalling grub ( "root (hd0,7)" and then "setup [--force-lba] (hd0)" does not help.
- when I restore grub for Fedora 12, which is installed on /dev/sda7 (in same manner: "root (hd0,7)" and then "setup (hd0)" ), then grub works fine.
- only thing which hit me is about accessing files beyond 137 GB (28 bit LBA limit), as sda8 partition lies at <117GB,144GB>. But - on other i686 PC I have F12 on /dev/sda10 (sda10 partition start on 128GB and ends at 148GB) and F13 on /dev/sda9, and both are bootable via grub1 without problems. Moreover, I think, when there would be 28-bit addressing problem, then nor handy specification should be successfull.
Some grub1 guru should be likely in Fedora/Redhat suite, as grub1 is stated as legacy and isn't supported :) ?
Franta
Frantisek Hanzlik wrote:
Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
I'm using legacy grub1 for booting from logical partitions (ext2/ext3 and now ext4) routinely long since early Fedora (maybe Redhat 7.x/8/9) versions, already without problems.
But just now on F13 i686 I run across other, maybe similar problem: I install it on /dev/sda8 (sda is 200GB SATA drive, DOS type partition table, grub installed in MBR), installation passed OK. But when booting, grub not print any error, but display stage2 message:
GNU GRUB version 0.97 (639K lower / 1047488K upper memory)[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.
It seems to me as if it could not find configfile. But, when I type "root (hd0,7)" and "configfile /boot/grub/grub.conf" (or "configfile /boot/grub/menu.lst"), then normally appears f13 grub splash screen with menu items and after selecting one grub correctly boot it.
- reinstalling grub ( "root (hd0,7)" and then "setup [--force-lba]
(hd0)" does not help.
- when I restore grub for Fedora 12, which is installed on /dev/sda7 (in
same manner: "root (hd0,7)" and then "setup (hd0)" ), then grub works fine.
- only thing which hit me is about accessing files beyond 137 GB (28 bit
LBA limit), as sda8 partition lies at<117GB,144GB>. But - on other i686 PC I have F12 on /dev/sda10 (sda10 partition start on 128GB and ends at 148GB) and F13 on /dev/sda9, and both are bootable via grub1 without problems. Moreover, I think, when there would be 28-bit addressing problem, then nor handy specification should be successfull.
Some grub1 guru should be likely in Fedora/Redhat suite, as grub1 is stated as legacy and isn't supported :) ?
Franta
I forgot to tell - all my above mentioned Fedora installations occupies one partition, I have no extra "/boot/" partitions. Franta
On 07/30/2010 06:51 PM, Frantisek Hanzlik wrote:
Frantisek Hanzlik wrote:
Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
I'm using legacy grub1 for booting from logical partitions (ext2/ext3 and now ext4) routinely long since early Fedora (maybe Redhat 7.x/8/9) versions, already without problems.
But just now on F13 i686 I run across other, maybe similar problem: I install it on /dev/sda8 (sda is 200GB SATA drive, DOS type partition table, grub installed in MBR), installation passed OK. But when booting, grub not print any error, but display stage2 message:
GNU GRUB version 0.97 (639K lower / 1047488K upper memory)[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.
It seems to me as if it could not find configfile. But, when I type "root (hd0,7)" and "configfile /boot/grub/grub.conf" (or "configfile /boot/grub/menu.lst"), then normally appears f13 grub splash screen with menu items and after selecting one grub correctly boot it.
- reinstalling grub ( "root (hd0,7)" and then "setup [--force-lba]
(hd0)" does not help.
- when I restore grub for Fedora 12, which is installed on /dev/sda7 (in
same manner: "root (hd0,7)" and then "setup (hd0)" ), then grub works fine.
- only thing which hit me is about accessing files beyond 137 GB (28 bit
LBA limit), as sda8 partition lies at<117GB,144GB>. But - on other i686 PC I have F12 on /dev/sda10 (sda10 partition start on 128GB and ends at 148GB) and F13 on /dev/sda9, and both are bootable via grub1 without problems. Moreover, I think, when there would be 28-bit addressing problem, then nor handy specification should be successfull.
Some grub1 guru should be likely in Fedora/Redhat suite, as grub1 is stated as legacy and isn't supported :) ?
Franta
I forgot to tell - all my above mentioned Fedora installations occupies one partition, I have no extra "/boot/" partitions. Franta
Well, I used a separate /boot partition because in the past somehow, grub or partition MBR got lost when something changed via an update. Maybe this a non-issue by now?
Daniel B. Thurman wrote:
Well, I used a separate /boot partition because in the past somehow, grub or partition MBR got lost when something changed via an update. Maybe this a non-issue by now?
I never met with it. But I never use LVM or device-mapper logical devices, only plain or md ones (and HW RAIDs, but it isn't probably essential)
On 07/30/2010 06:37 PM, Frantisek Hanzlik wrote:
Timothy Murphy wrote:
Can grub boot from a logical partition?
It seems from my reading that it cannot.
But I found that I could in fact boot from /dev/sda5 if I used grub interactively, starting with root (hd0,4) then using tab to look for kernel and initrd and finally booting.
However, if I put exactly the same commands in grub.conf the boot failed, with "File not found ...".
(Nb I am not using LVM, sda5 is a logical partition within the extended partition sda4.)
Can some guru explain this to me please.
I'm using legacy grub1 for booting from logical partitions (ext2/ext3 and now ext4) routinely long since early Fedora (maybe Redhat 7.x/8/9) versions, already without problems.
But just now on F13 i686 I run across other, maybe similar problem: I install it on /dev/sda8 (sda is 200GB SATA drive, DOS type partition table, grub installed in MBR), installation passed OK. But when booting, grub not print any error, but display stage2 message:
GNU GRUB version 0.97 (639K lower / 1047488K upper memory)[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.
It seems to me as if it could not find configfile. But, when I type "root (hd0,7)" and "configfile /boot/grub/grub.conf" (or "configfile /boot/grub/menu.lst"), then normally appears f13 grub splash screen with menu items and after selecting one grub correctly boot it.
- reinstalling grub ( "root (hd0,7)" and then "setup [--force-lba]
(hd0)" does not help.
- when I restore grub for Fedora 12, which is installed on /dev/sda7 (in
same manner: "root (hd0,7)" and then "setup (hd0)" ), then grub works fine.
- only thing which hit me is about accessing files beyond 137 GB (28 bit
LBA limit), as sda8 partition lies at <117GB,144GB>. But - on other i686 PC I have F12 on /dev/sda10 (sda10 partition start on 128GB and ends at 148GB) and F13 on /dev/sda9, and both are bootable via grub1 without problems. Moreover, I think, when there would be 28-bit addressing problem, then nor handy specification should be successfull.
Some grub1 guru should be likely in Fedora/Redhat suite, as grub1 is stated as legacy and isn't supported :) ?
Franta
I did not state it in my previous thread, but I am using 2 TiB drives which is well beyond the boundary - also - I have windows 2k, XP, and Vista (no problems) but very special care must be taken into consideration dealing with w2K - but that is legacy anyway.
As for grub2, grub1 does boot grub2, so as long as the MBR for that grub2 boot partition is MBR set, but as it is, it is hard to figure out just how to do this manually, as I was only able to install MBR for the grub2 boot partition via Ubuntu's LiveCD installer and have yet to learn from the Ubuntu community just how to do that.