-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb040d2
commit 1f60370
Showing
1 changed file
with
56 additions
and
1 deletion.
There are no files selected for viewing
57 changes: 56 additions & 1 deletion
57
102 - Linux Installation and Package Management/102.2 - Install a boot manager.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
# 102.2 Install a boot manager | ||
# 102.2 Install a boot manager | ||
|
||
## GRUB - Grand Unified Boot Loader | ||
|
||
***Arquivos de configuração*** | ||
Legacy: | ||
- /boot/grub/menu.lst | ||
- /boot/grub/grub.conf/cfg | ||
|
||
Grub2: | ||
- /boot/grub/grub.cfg | ||
- /etc/default/grub | ||
- /etc/grub.d/ | ||
|
||
O arquivo principal que é utilizado no boot é o grub.cfg. Porém não damos manutenção nele diretamente nesse arquivo, pois ele tem muitas regras e se alguma não for respeitada o grub pode falhar. Para isso, o /etc/default/grub nos permite alterar as informações mais importantes no grub. Após feitas as modificações, basta usar o commando ```update-grub``` que ele atualizará o arquivo principal. | ||
|
||
**Referência ao disco** | ||
Legacy: | ||
- sda1 = sd0,0 | ||
- sda2 = sd0,1 | ||
- sdb1 = sd1,0 | ||
|
||
Grub2: | ||
- sda1 = sd0,1 (ou sd0,msdos1) | ||
- sda2 = sd0,2 | ||
- sdb1 = sd1,1 | ||
|
||
**Comandos** | ||
Legacy: | ||
- ```grub-install /dev/sda``` | ||
- ```grub-install '(hd0)'``` | ||
|
||
Grub2: | ||
- ```grub-install <device>``` | ||
- ```update-grub``` | ||
- ```grub-mkconfig -o /boot/grub/grub.cfg``` | ||
|
||
**Principais diferenças dos parâmetros** | ||
- Uso de chaves | ||
- Menuentry ao invés de title | ||
- set root aos invés de apenas root | ||
- linux ao invés de kernel | ||
- parâmetros em maiúsculo | ||
|
||
## Gerando um backup do MBR | ||
Podemos querer ter um backup do MBR e evitar problemas caso ele seja sobrescrito ou apagado em algum momento. Para isso podemos utilizar os seguintes comandos: | ||
|
||
**Gerando o backup** | ||
```shell | ||
dd if=/dev/sda of=copy.mbr bs=1 count=512 | ||
``` | ||
|
||
**Utilizando o backup** | ||
```shell | ||
dd if=copy.mbr of=/dev/sda | ||
``` |