Difference between revisions of "GRUB"
From Alessandro's Wiki
(Reverted edits by Ypebezimyx (Talk) to last version by 10.8.0.1) |
Porcelinux (talk | contribs) |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
=== | = Grub 2 = | ||
* command that generates and prints out configuration: | |||
grub2-mkconfig | |||
* save configuration | |||
grub2-mkconfig -o /boot/grub/grub.cfg | |||
* regenerate EFI file | |||
mv /boot/efi/EFI/fedora/grub.cfg /tmp/grub.cfg | |||
dnf reinstall grub2-common | |||
* get OS's list of labels | |||
grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 | |||
Fedora | |||
Ubuntu 12.04.2 LTS (12.04) | |||
Gentoo Base System release 2.1 | |||
* show actual default entry | |||
grub2-editenv list | |||
saved_entry=Fedora Linux, with Linux 3.6.6-1.fc17.i686.PAE | |||
* alter default entry | |||
grub2-set-default "Gentoo Base System release 2.1" | |||
* check... | |||
grub2-editenv list | |||
saved_entry=Gentoo Base System release 2.1 | |||
== Other Operative Systems disappeared == | |||
From debian 12, an option in grub config will disable the scan for other OS's thus making impossible to boot from them. | |||
how to fix: | |||
* open the config | |||
vi /etc/default/grub | |||
* un-comment or add this line: | |||
GRUB_DISABLE_OS_PROBER=false | |||
* regenerate grub config: | |||
update-grub | |||
== Boot after update == | |||
ALERT! /dev/mapper/ubuntu--vg-root does npt exist. Dropping to a shell! | |||
(initram-fs)# vgchange -ay | |||
= Grub 1.X = | |||
[http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10 Link a una documentazione...] | [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10 Link a una documentazione...] | ||
==== | ==== Installing GRUB in the Master Boot Record ==== | ||
* Con ''grub-install'' | * Con ''grub-install'' | ||
| Line 14: | Line 56: | ||
/sbin/grub-install --root-directory=/ /dev/md0 | /sbin/grub-install --root-directory=/ /dev/md0 | ||
* find grub copies: | |||
grub> find /grub/stage1 | |||
* or... | |||
grub> find /boot/grub/stage1 | |||
* | * ''grub'' (/usr/sbin/grub) | ||
grub> device (hd0) /dev/sdb (/dev/hdb for ide) | |||
grub> root (hd0,0) (La partizione di boot, Disco 0 Partizione 0) | grub> root (hd0,0) (La partizione di boot, Disco 0 Partizione 0) | ||
grub> setup (hd0) (Installa GRUB nel MBR) | grub> setup (hd0) (Installa GRUB nel MBR) | ||
Latest revision as of 09:30, 21 August 2025
Grub 2
- command that generates and prints out configuration:
grub2-mkconfig
- save configuration
grub2-mkconfig -o /boot/grub/grub.cfg
- regenerate EFI file
mv /boot/efi/EFI/fedora/grub.cfg /tmp/grub.cfg dnf reinstall grub2-common
- get OS's list of labels
grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2 Fedora Ubuntu 12.04.2 LTS (12.04) Gentoo Base System release 2.1
- show actual default entry
grub2-editenv list saved_entry=Fedora Linux, with Linux 3.6.6-1.fc17.i686.PAE
- alter default entry
grub2-set-default "Gentoo Base System release 2.1"
- check...
grub2-editenv list saved_entry=Gentoo Base System release 2.1
Other Operative Systems disappeared
From debian 12, an option in grub config will disable the scan for other OS's thus making impossible to boot from them. how to fix:
- open the config
vi /etc/default/grub
- un-comment or add this line:
GRUB_DISABLE_OS_PROBER=false
- regenerate grub config:
update-grub
Boot after update
ALERT! /dev/mapper/ubuntu--vg-root does npt exist. Dropping to a shell!
(initram-fs)# vgchange -ay
Grub 1.X
Installing GRUB in the Master Boot Record
- Con grub-install
grub-install /dev/hda
o meglio... (se si sta installando il sistema)
chroot /mnt/sysimage/
- con la directory boot sta nella /
/sbin/grub-install --root-directory=/boot /dev/md1
- con la directory boot è una partizione
/sbin/grub-install --root-directory=/ /dev/md0
- find grub copies:
grub> find /grub/stage1
- or...
grub> find /boot/grub/stage1
- grub (/usr/sbin/grub)
grub> device (hd0) /dev/sdb (/dev/hdb for ide) grub> root (hd0,0) (La partizione di boot, Disco 0 Partizione 0) grub> setup (hd0) (Installa GRUB nel MBR) grub> quit (Esci dalla shell GRUB)
Immagine sfondo grub
1. xpm.gz file 2. 640x480 3. 14 colors 4. copiare in /boot/grub 5. gzip myfile.xpm
VGA modes
| 640x480 800x600 1024x768 1280x1024 ----+------------------------------------- 256 | 0x301 0x303 0x305 0x307 32k | 0x310 0x313 0x316 0x319 64k | 0x311 0x314 0x317 0x31A 16M | 0x312 0x315 0x318 0x31B