LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2016, 06:04 PM   #1
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 50
How to get grub2 to boot a distro in a logical partition


I have read somewhere that GRUB2 is not able to boot an OS on a logical partition. So how is it possible to multi-boot with grub given that we are limited to 4 primary partitions?

Is it that a separate /boot partition needs to be created on a primary partition or is it something to do with chainloading?

Currently I have grub booting from the mbr and I believe it is located in sda1. It can see a Windows OS in sdb1 (i.e another hard disk) which previously had access to the mbr. If I want to install further linux distros onto the sdb hard disk, how can I do this if grub can't see distros in a logical partition?

I've looked on the net, but can't find an easy answer to what seems to be a simple problem.
 
Old 02-09-2016, 06:14 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Total rubbish.
Even grub legacy didn't care. I have (several actually) systems that only have logical partitions.

Some lame installers (Linux as well as M$oft) demand a primary partition, but that is because of the devs on that particular distro - nothing to do with grub. For gpt disk, the discussion is moot as they are all primary.
 
Old 02-09-2016, 06:49 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
I have read somewhere that GRUB2 is not able to boot an OS on a logical partition.
Wherever you read that is a good place to avoid in the future as it is absolutely false. I currently have 11 Linux operating system on logical partitions and they all boot with no problems. I don't use and have never used a separate boot partition, it isn't necessary but some choose to have it.

Quote:
Currently I have grub booting from the mbr and I believe it is located in sda1.
Not sure what you mean by that. If you are using the older MBR method to boot, Grub will have a tiny amount of code in the MBR but most of it is on the / partition in the boot directory. Are you aware that the manuals for Grub Legacy and Grub2 are available to read online, if you want the facts from the source.
 
Old 02-09-2016, 09:14 PM   #4
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by syg00 View Post
Total rubbish.
Even grub legacy didn't care. I have (several actually) systems that only have logical partitions.

Some lame installers (Linux as well as M$oft) demand a primary partition, but that is because of the devs on that particular distro - nothing to do with grub. For gpt disk, the discussion is moot as they are all primary.
I see. I have noticed there are many defenders of grub. For a newbie like me, grub is essentially a menu screen allowing multi-boot.

However, it seems grub has to deal with the twin challenges of BIOS and Linux who may have conflicting demands. Also, it may even need to fight with Windows to own the MBR securely (idk).
It's amazing to see so much complication caused by different interest groups over - what seems to the users eyes - is a simple menu screen.
Nonetheless, it is good to see software from the GNU project fighting for its principles. However, the logo of grub1 (perhaps a vigilant Stallman) is replaced with the grub2 logo which shows a less energised individual https://en.wikipedia.org/wiki/GNU_GRUB.
 
Old 02-09-2016, 09:40 PM   #5
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by yancek View Post
Wherever you read that is a good place to avoid in the future as it is absolutely false. I currently have 11 Linux operating system on logical partitions and they all boot with no problems. I don't use and have never used a separate boot partition, it isn't necessary but some choose to have it.
So that means I can put an OS onto a logical partition and grub2 will automatically see it on boot?
I don't have to add code to any files?

Quote:
Not sure what you mean by that. If you are using the older MBR method to boot, Grub will have a tiny amount of code in the MBR but most of it is on the / partition in the boot directory. Are you aware that the manuals for Grub Legacy and Grub2 are available to read online, if you want the facts from the source.
Ah, yes. I should've written 'grub2' as opposed to 'grub'. However, I haven't found anything about the relationship between grub2 in an mbr and a bootable partition.
Although 'fdisk -l' places an asterisk under the boot header for the location of the actual boot file, I'm not sure if that is reliable after reading various websites
 
Old 02-09-2016, 09:51 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
grub{legacy,2} ignores the boot flag. Some BIOS require there to be one, but grub doesn't care
 
Old 02-10-2016, 08:31 AM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
However, it seems grub has to deal with the twin challenges of BIOS and Linux who may have conflicting demands. Also, it may even need to fight with Windows to own the MBR securely (idk).
Grub (GRand Unified Bootloader) is a bootloader used to boot various operating systems and not "a menu screen". It doesn't deal with the BIOS. You boot the computer and the power on self test is run, the BIOS then looks to a specific location on the first hard disk set to boot priority in the BIOS and turns the booting over to the code on the drive. Doesn't matter what the bootloader is or what the operating system is. If you use a windows-only system, you have windows code. If you use Linux, you have Linux code.

Quote:
So that means I can put an OS onto a logical partition and grub2 will automatically see it on boot?
No, it's not magic. If you install a Linux operating system with the Grub bootloader to a machine with other operating systems already on it and install the Grub bootloader to the MBR, during the installation process of the bootloader, it should detect these operating systems. If, on the other hand, you already have Grub installed with another Linux operating system and you install an additional Linux system, the Grub from the original will obviously have no way of knowing an additional system has been installed so you need to run either sudo update-grub or grub-mkconfig commands which search the system for new operating systems.

Quote:
However, I haven't found anything about the relationship between grub2 in an mbr and a bootable partition.
The code in the MBR simply points to the partition where boot files are. It's too small to do much else. You should be able to find all the information you want from the Grub2 Manual at the link below.

http://www.gnu.org/software/grub/manual/grub.html

Quote:
Although 'fdisk -l' places an asterisk under the boot header for the location of the actual boot file, I'm not sure if that is reliable after reading various websites
The asterisk identifies the partition which is active/bootable and this is necessary for a windows system to boot. I've never seen or experienced this being needed with any Linux system although it may be.

Last edited by yancek; 02-10-2016 at 03:35 PM.
 
1 members found this post helpful.
Old 02-10-2016, 02:35 PM   #8
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by yancek View Post
No, it's not magaic. If you install a Linux operating system with the Grub bootloader to a machine with other operating systems already on it and install the Grub bootloader to the MBR, during the installation process of the bootloader, it should detect these operating systems. If, on the other hand, you already have Grub installed with another Linux operating system and you install an additional Linux system, the Grub from the original will obviously have no way of knowing an additional system has been installed so you need to run either sudo update-grub or grub-mkconfig commands which search the system for new operating systems.
That is the clarification I was looking for. I think I was confused old discussions about grub legacy with grub2.
Since I already have a linux OS using the bootloader, I'm not going to add grub to a new OS during the installation phase.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing to a logical partition to boot omegaaf Linux - Newbie 13 10-01-2012 12:13 AM
Grub2 can't boot despite a seperate /boot partition rdantuma Ubuntu 2 08-13-2012 11:53 AM
trying to boot windows off logical partition cjae Linux - Newbie 2 02-21-2007 07:40 AM
Can windows boot from a logical partition? faezeh Fedora 15 04-03-2005 12:12 PM
Can't boot linux on a logical partition poison5151 Linux - Newbie 4 02-03-2004 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration