Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Paritioning and boot loader confusion [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
PanzerKanzler
Guru
Guru


Joined: 04 Dec 2005
Posts: 376
Location: Belgravia, London

PostPosted: Sat Mar 14, 2015 3:58 pm    Post subject: Paritioning and boot loader confusion [SOLVED] Reply with quote

I am going to make a fresh install, and while reading up on the installation procedure I got really confused about partitioning and boot loaders.

For the past ten years, I have happily been using grub and the following simple partition layout
Quote:

/dev/sda1 ~30G for everything except swap and /home
/dev/sda2 remainder of disk for /home, minus space for swap
/dev/sda3 ~6G swap

I would like to continue using this simple layout (i.e no extra partitions for /boot, grub, efi, tooth fairy, ...), but I would like to use an actively maintained boot loader. Since grub2 has replaced (legacy) grub as the handbook default, I am considering using that.

However, the handbook suggests creating a 2M partition for grub2. Is this really mandatory for using grub2, or can I somehow opt out of it? Unfortunately it did not become much clearer after reading "BIOS with GPT" at http://wiki.gentoo.org/wiki/GRUB2.

If it is not possible to use grub2 without giving it a separate partition, is it best for me to switch to lilo or use (legacy) grub despite it not being maintained?
_________________
If you've got nothing nice to say, you're probably not alone...


Last edited by PanzerKanzler on Sat Mar 14, 2015 6:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1655
Location: United Kingdom

PostPosted: Sat Mar 14, 2015 4:39 pm    Post subject: Reply with quote

It is not necessary to have a separate partition for GRUB 2. You can have /boot on the same partition as root with GRUB 2 installed.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Sat Mar 14, 2015 4:45 pm    Post subject: Reply with quote

It's not mandatory. You can install grub2 just like grub-legacy.

Main reasons for having bootloaders on separate partitions is to
- keep boot software separate from other software, separate from mkfs'ing the root partition on a reinstall
- work around BIOS/firmware problems (keep it below 1024 for CHS problems)
- keep it on an OS agnostic partition so you can change the options (like if you had a dual boot system you could change the default boot option regardless what os you're booted in)

If you need none of these and the boot loader does not require its own format, then you don't need.

I do have grub2 installed on one of my machines on a single partition disk (grub2, root, and swap on same partition) so it does work...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Sat Mar 14, 2015 4:46 pm    Post subject: Reply with quote

What's so wrong about bootloader not being maintained? Is it going to turn green and eat your breakfeast?

Quote:
Is this really mandatory for using grub2, or can I somehow opt out of it? Unfortunately it did not become much clearer after reading "BIOS with GPT"

Quote:
I would like to continue using this simple layout (i.e no extra partitions for /boot, grub, efi, tooth fairy, ...

this part seems to be ment for UEFI, which you said you don't want. So simply don't bother with it. You can install grub2 in MBR or on a partition just like any other bootloader.
I wouldn't call it simple though, I find "over-engineered" a better fit.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Sat Mar 14, 2015 5:17 pm    Post subject: Reply with quote

PanzerKanzler,

The 2Mb partition for grub2 is useful but not essential when you use a GPT partition table.

Both grubs like to install some code outside of the disc sectors allocated for filesystems.
With an MSDOS partition table, there is free space before the first partition.
With a GPT partition table, this space does not exist. The GPT starts in sector 1, thus the 2M partition (not formatted) satisfies the requirement for some private space.

If this space is not available, the fallback is to use a block list to load the rest of grub. However, this is ugly as the block list is written when you install grub to the MBR.
When you go the block list route, whenever grub is updated, so goes to a new location on the filesystem, you *must* reinstall grub to the MBR to rewrite the block list.

This apparently optional code is used to read the filesystem to load the rest of grub. If this code is presest, grub moving around ot nte filesystem does not matter.
Keep in mind that an 'overwrite' is accomplished by writiting the new file before removing tho old file, its not an overwrite in place.

With grub2 on GPT, its a really good idea to give grub2 its 2Mb of private space.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
PanzerKanzler
Guru
Guru


Joined: 04 Dec 2005
Posts: 376
Location: Belgravia, London

PostPosted: Sat Mar 14, 2015 5:25 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
It is not necessary to have a separate partition for GRUB 2. You can have /boot on the same partition as root with GRUB 2 installed.

The question was not about a separate /boot partition, but about a separate grub2 partition (which seems not to have a mount point?). But it is good to hear that I can continue having /boot on the same partition as root.

eccerr0r wrote:
It's not mandatory. You can install grub2 just like grub-legacy.

This sounds promising, it is essentially what I wanted to know.

eccerr0r wrote:
If you need none of these and the boot loader does not require its own format, then you don't need.

None of the reasons you listed are relevant for me, but how do I know whether the boot loader requires its own format? I suppose it does not, but I'm no sure.
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Sat Mar 14, 2015 5:34 pm    Post subject: Reply with quote

PanzerKanzler,

Any filesystem you may put on the 2Mb grub partion is ignored/overwritten.
Its all private to grub.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
PanzerKanzler
Guru
Guru


Joined: 04 Dec 2005
Posts: 376
Location: Belgravia, London

PostPosted: Sat Mar 14, 2015 5:52 pm    Post subject: Reply with quote

NeddySeagoon: Thank you for the explanation, it made things a lot clearer. I have planned on using GPT, so I will actually consider using the extra grub2 partition despite my initial suspicions.

Most information about boot loaders seem to be aimed at people with setups such as raid, disk encryption and/or dual booting. I thought that maybe the extra grub2 partition could have something to do with any this, but I now understand there is actually a valid reason for it.
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Sat Mar 14, 2015 5:55 pm    Post subject: Reply with quote

PanzerKanzler wrote:
eccerr0r wrote:
If you need none of these and the boot loader does not require its own format, then you don't need.

None of the reasons you listed are relevant for me, but how do I know whether the boot loader requires its own format? I suppose it does not, but I'm no sure.

As an example if you were booting Windows with Grub/Grub2. You can't install grub on NTFS and thus would need its own format and thus partition.

As grub understands most Linux partitions, they can share. However it looks like grub-legacy does not support btrfs, so if you want to use btrfs root, you would need to have a separate partition that grub-legacy understands. I believe grub2 supports btrfs and can go back to the status quo.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum