GRUB: Difference between revisions

From Q
Jump to navigation Jump to search
Tgurr (talk | contribs)
No edit summary
Tgurr (talk | contribs)
No edit summary
Line 1: Line 1:
== GRUB 2 ==
== Packages ==
 
=== Packages ===


Exherbo: {{Package|sys-boot/grub}}
Exherbo: {{Package|sys-boot/grub}}
Line 12: Line 10:
</pre>
</pre>


=== Installation ===
== Installation ==
==== EFI ====
=== EFI ===
{{Root|mount /boot}}
{{Root|mount /boot}}


Line 32: Line 30:
</pre>
</pre>


===== SET ACTIVE =====
==== SET ACTIVE ====


{{Root|efibootmgr --bootnum 0004 --active}}
{{Root|efibootmgr --bootnum 0004 --active}}


===== DELETE =====
==== DELETE ====


{{Root|efibootmgr --bootnum 0004 --delete-bootnum}}
{{Root|efibootmgr --bootnum 0004 --delete-bootnum}}
Line 51: Line 49:
</pre>
</pre>


==== Standard, single drive GPT/MBR (SATA/IDE/SCSI) ====
=== Standard, single drive GPT/MBR (SATA/IDE/SCSI) ===


{{Root|grub-install --recheck --no-floppy /dev/sda}}
{{Root|grub-install --recheck --no-floppy /dev/sda}}


=== Configuration ===
== Configuration ==


{{Note|Manual grub2 configuration should always happen in {{Path|/etc/default/grub}} and/or {{Path|/etc/grub.d/40_custom}}.}}
{{Note|Manual grub2 configuration should always happen in {{Path|/etc/default/grub}} and/or {{Path|/etc/grub.d/40_custom}}.}}
Line 61: Line 59:
{{File|/etc/default/grub|
{{File|/etc/default/grub|
<pre>
<pre>
GRUB_DISTRIBUTOR="Exherbo"
GRUB_DISTRIBUTOR="exherbo"
GRUB_DEFAULT="Exherbo GNU/Linux, current kernel"
</pre>
</pre>
}}
}}


==== Standard, single drive GPT (SATA/IDE/SCSI) ====
=== Standard, single drive GPT (SATA/IDE/SCSI) ===


{{Code|Assuming following GPT partition layout|
{{Code|Assuming following GPT partition layout|
Line 77: Line 74:
}}
}}


=== Generate grub.cfg ===
== Generate grub.cfg ==


{{Warning|Running the following command will overwrite any changes in grub.cfg you manually made.}}
{{Warning|Running the following command will overwrite any changes in grub.cfg you manually made.}}
Line 85: Line 82:
{{Root|umount /boot}}
{{Root|umount /boot}}


=== Optional: Additional Kernel Parameters ===
== Optional: Additional Kernel Parameters ==


{{File|/etc/default/grub|
{{File|/etc/default/grub|
Line 95: Line 92:
Regenerate your grub.cfg for the changes to take effect.
Regenerate your grub.cfg for the changes to take effect.


=== Optional: Theme ===
== Optional: Theme ==


{{File|/etc/default/grub|
{{File|/etc/default/grub|
Line 114: Line 111:
Regenerate your grub.cfg for the changes to take effect.
Regenerate your grub.cfg for the changes to take effect.


=== Optional: Serial Console ===
== Optional: Serial Console ==


{{File|/etc/default/grub|
{{File|/etc/default/grub|

Revision as of 11:43, 27 March 2017

Packages

Exherbo: sys-boot/grub

Gentoo: sys-boot/grub

/etc/portage/make.conf

GRUB_PLATFORMS="efi-64"

Installation

EFI

# mount /boot
# mount /boot/efi
# grub-install --efi-directory=/boot/efi --no-floppy --recheck
# efibootmgr
BootCurrent: 0001
BootOrder: 0004,0000,0001,0002,0003
Boot0000* EFI SCSI Hard Drive
Boot0001* EFI IDE CD/DVD Drive
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)
Boot0004* exherbo

SET ACTIVE

# efibootmgr --bootnum 0004 --active

DELETE

# efibootmgr --bootnum 0004 --delete-bootnum
# efibootmgr
BootCurrent: 0001
BootOrder: 0000,0001,0002,0003
Boot0000* EFI SCSI Hard Drive
Boot0001* EFI IDE CD/DVD Drive
Boot0002* EFI Network
Boot0003* EFI Internal Shell (Unsupported option)

Standard, single drive GPT/MBR (SATA/IDE/SCSI)

# grub-install --recheck --no-floppy /dev/sda

Configuration

Note: Manual grub2 configuration should always happen in /etc/default/grub and/or /etc/grub.d/40_custom.
File: /etc/default/grub
GRUB_DISTRIBUTOR="exherbo"

Standard, single drive GPT (SATA/IDE/SCSI)

Code: Assuming following GPT partition layout
/dev/sda1	1   MiB		EF02	BIOS boot	BIOS boot partition
/dev/sda2	100 MiB	/boot	8300	ext4		Linux filesystem
/dev/sda3	512 MiB		8200	swap		Linux swap
/dev/sda4	25  GiB	/	8300	ext4		Linux filesystem

Generate grub.cfg

Warning: Running the following command will overwrite any changes in grub.cfg you manually made.
# grub-mkconfig -o /boot/grub/grub.cfg
# umount /boot

Optional: Additional Kernel Parameters

File: /etc/default/grub
GRUB_CMDLINE_LINUX="acpi=off"

Regenerate your grub.cfg for the changes to take effect.

Optional: Theme

File: /etc/default/grub
GRUB_THEME=/boot/efi/EFI/grub/themes/starfield/theme.txt
GRUB_TERMINAL_OUTPUT=gfxterm

If your display resolutions isn't automatically detected you can manually force a specific resolution.

File: /etc/default/grub
GRUB_GFXMODE=1600x1200

Regenerate your grub.cfg for the changes to take effect.

Optional: Serial Console

File: /etc/default/grub
GRUB_TERMINAL=serial
GRUB_SERIAL=COMMAND="serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,57600"

Regenerate your grub.cfg for the changes to take effect.

If you want to be able to login to your system via the serial console you need to edit /etc/inittab.

File: /etc/inittab

Uncomment the s0 entry and change the speed to your needs.

# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty 57600 ttyS0 vt100
#s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100