SlideShare une entreprise Scribd logo
1  sur  22
GNU-GRUB

GNU'S Not Unix- GRand Unified Bootloader...
What will we be covering?
●

Introduction to GRUB

●

Installing GRUB

●

Exploring GRUB

●

Customizing GRUB

●

GRUB Error Recovery
Introduction...err...Features
➔

Many features and lot of flexibility

➔

Supports booting multiple operating systems

➔

Support for many boot devices
➢

➔

Hard disk (of course), cd-rom(El-Torito), network(tftp)

Support for many file systems (ext2/3, xfs, jfs,reiserfs, dos, fat16,
fat32...)

➔

Configuration File
Features (continued)
➔

➔

Support for network cards (etherboot)
Menu Interfaces for regular and command interface for
advanced users

➔

Remote control from serial console.

➔

Supports multiple executable formats

➔

Can uncompress compressed files.
Installing GRUB
From Scratch (i.e. on a blank disk)
➔

Do it from a host with GNU/GRUB installed.

➔

Create a partition on disk
fdisk /dev/sda

➔

Format and mount this partition:
mkfs.ext3 /dev/sda1
sudo mount /dev/sda1 /mnt/sda1
Installation....(Continued)
➔

Download grub tarball ftp://ftp.gnu.org/gnu/grub

➔

Compiling :)

➔

Install grub:
grub-install –root-directory=/mnt/sda1 /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
A secret:
The grub-install (Just a shell script !!! :-O)
The real heroes are :
➔

'grub-mkimage' and

➔

'grub-setup'
Exploring(The quest to learn GRUB-fu)
➔

Changes???
➔

/boot/grub

➔

/etc/grub.d

➔

/etc/default/grub

➔

Other places: /usr/lib/grub(Modules)| /usr/bin or /bin (Binaries),Docs
Exploring....(Digging In)
➔

Scanning grub.cfg(/boot/grub/grub.cfg)
Phew!!.....looks complicated....(actually non-editable)we'll come back later.

➔

Peeking in /etc/grub.d
➔

➔

10_* Native boot entries

➔

20_* Third party apps

➔

30_osprobe :Scans for other O.S.

➔

➔

00_* contains header info

40_custom : Custom templates for additional entries

Looking at /etc/default/grub....
Hmmm....looks interesting.!!! :)
Customizing GRUB
➔

Some Theory:
Custom Settings

/etc/default/grub

/etc/grub.d/

/boot/grub/grub.cfg

Custom Scripts
What can we do?
Making Custom Settings
➔

We change the /etc/default/grub file.

➔

Some of the configurations are:
➔

GRUB_DEFAULT,

➔

GRUB_TIMEOUT,

➔

GRUB_HIDDEN_TIMEOUT,

➔

GRUB_DISABLE_RECOVERY,

➔

GRUB_BACKGROUND,

➔

GRUB_THEME,

➔

.....AND MANY MORE.
Making Custom Scripts
➔

Can be done by adding scripts in

➔

Sample:
echo "Some string"
–

cat << EOF

–

menuentry "Something" {

–

set root=(hdX,Y)

–

-- boot parameters --

–

}EOF

/etc/default/grub
.....digging deeper
➔

Boot parameters
➔

Linux:
linux /boot/vmlinuz
initrd /boot/initrd.img

➔

Windows:
chainloader (hdX,Y)+1

➔

Stuck?.......
Get a peek in os-prober output!! ;-)
Grub Error Recovery
➔

Common Errors faced in GRUB
➔

GRUB Rescue
Error Recovery Contd...
➔

The Easy Way Out: A Rescue CD.

➔

The Tough Way:
set prefix=(hdx,y)/boot/grub
insmod (hdx,y)/boot/grub/linux.mod
set root=(hdx,y)
linux /boot/vmlinux-<version> root=/dev/sda5 #Change the numbers
initrd /boot/initramfs-3.0.0-1.fc16.i686.img
boot
grub-install /dev/sda5 #After booting

#Change the numbers
Error Recovery Contd....
➔

Error with UEFI
➔

Try disabling Secure-Boot

➔

Install grub-efi and shim packages
grub-mkconfig -o /boot/efi/EFI/$distr/grub.cfg

➔

Try using Boot-Repair

➔

Report a bug

Forums to the rescue.
Hacking With GRUB
➔

With GRUB users can access single user mode(root)

➔

How?
➔

➔

➔

Booting in recovery mode and going to
root
Modifying kernel arguments(Press a):
appending '1' at the last of arguments

On root prompt type passwd to change
password!!!:-D
Securing GRUB
➔

Setting a password for GRUB

➔

Editing /etc/grub.d/00_header
cat <<EOF
set superusers=”user1”
password <user> <password>
export superusers
EOF

➔

Password protect menu entries

menuentry ... --unrestricted {#all
menuentry ... --users "" { #superuser
menuentry ... --users Umar,hello {#superuser,umar,hello
Securing....Continued.
➔

Adding hashed password
$ grub-mkpasswd-pbkdf2
Enter your password:
Re-enter your password:
Your PBKDF2 is .................................

Now adding the output to 00_header (in /etc/grub.d)
➔

set superusers=”Umar”
password_pbkdf2 Umar
grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5
What we haven't covered
➔

List of command line and menu-entry commands

➔

All the bugs/errors which you may encounter.

➔

Designing of GRUB themes.

➔

GRUB environment variables/block.

➔

Booting with GRUB on a network.
Where to go from here?
➔

GNU-GRUB Documentation

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

GRUB Mailing list
help-grub@gnu.org

➔

bug-grub@gnu.org grub-devel@gnu.org

Wiki's
https://fedoraproject.org/wiki/GRUB_2
https://wiki.archlinux.org/index.php/GRUB
https://help.ubuntu.com/community/Grub2
THAT's ALL FOLKS

Contenu connexe

Tendances

Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programmingsudhir singh yadav
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistryJITU MISTRY
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux pptOmi Vichare
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Ahmed El-Arabawy
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in LinuxSAMUEL OJO
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O YourHelper1
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUXSHUBHA CHATURVEDI
 
Job Automation using Linux
Job Automation using LinuxJob Automation using Linux
Job Automation using LinuxJishnu Pradeep
 

Tendances (20)

An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Memory Forensics
Memory ForensicsMemory Forensics
Memory Forensics
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistry
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Linux
LinuxLinux
Linux
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
Job Automation using Linux
Job Automation using LinuxJob Automation using Linux
Job Automation using Linux
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 

En vedette

UEFI Spec Version 2.4 Facilitates Secure Update
UEFI Spec Version 2.4 Facilitates Secure UpdateUEFI Spec Version 2.4 Facilitates Secure Update
UEFI Spec Version 2.4 Facilitates Secure Updateinsydesoftware
 
Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)k33a
 
Implementing a UEFI BIOS into an Embedded System
Implementing a UEFI BIOS into an Embedded SystemImplementing a UEFI BIOS into an Embedded System
Implementing a UEFI BIOS into an Embedded Systeminsydesoftware
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded SystemsHimanshu Ghetia
 

En vedette (10)

Grub
GrubGrub
Grub
 
UEFI presentation
UEFI presentationUEFI presentation
UEFI presentation
 
Uefi and bios
Uefi and biosUefi and bios
Uefi and bios
 
UEFI Spec Version 2.4 Facilitates Secure Update
UEFI Spec Version 2.4 Facilitates Secure UpdateUEFI Spec Version 2.4 Facilitates Secure Update
UEFI Spec Version 2.4 Facilitates Secure Update
 
Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)
 
Bios uefi y legacy
Bios uefi y legacyBios uefi y legacy
Bios uefi y legacy
 
Implementing a UEFI BIOS into an Embedded System
Implementing a UEFI BIOS into an Embedded SystemImplementing a UEFI BIOS into an Embedded System
Implementing a UEFI BIOS into an Embedded System
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 

Similaire à Description of GRUB 2

Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut iiplarsen67
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Bud Siddhisena
 
Upgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseUpgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseGratien D'haese
 
Build Your Own Android Tablet
Build Your Own Android TabletBuild Your Own Android Tablet
Build Your Own Android TabletSGAndroidDevs
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratchjoshuasoundcloud
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devicesMender.io
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02FNian
 
Howto Make A Linux Boot Disk
Howto Make A Linux Boot DiskHowto Make A Linux Boot Disk
Howto Make A Linux Boot DiskXaver Y.R. Chen
 
Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Isham Rashik
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsVinícius Zavam
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 

Similaire à Description of GRUB 2 (20)

Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Upgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseUpgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaese
 
Build Your Own Android Tablet
Build Your Own Android TabletBuild Your Own Android Tablet
Build Your Own Android Tablet
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratch
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
Clase10 (consola linux)
Clase10 (consola linux)Clase10 (consola linux)
Clase10 (consola linux)
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Howto Make A Linux Boot Disk
Howto Make A Linux Boot DiskHowto Make A Linux Boot Disk
Howto Make A Linux Boot Disk
 
Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD Systems
 
Ubuntu presentation
Ubuntu presentationUbuntu presentation
Ubuntu presentation
 
Linux
Linux Linux
Linux
 
Linux
LinuxLinux
Linux
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
unix-rosetta
unix-rosettaunix-rosetta
unix-rosetta
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 

Dernier

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Dernier (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Description of GRUB 2

  • 1. GNU-GRUB GNU'S Not Unix- GRand Unified Bootloader...
  • 2. What will we be covering? ● Introduction to GRUB ● Installing GRUB ● Exploring GRUB ● Customizing GRUB ● GRUB Error Recovery
  • 3. Introduction...err...Features ➔ Many features and lot of flexibility ➔ Supports booting multiple operating systems ➔ Support for many boot devices ➢ ➔ Hard disk (of course), cd-rom(El-Torito), network(tftp) Support for many file systems (ext2/3, xfs, jfs,reiserfs, dos, fat16, fat32...) ➔ Configuration File
  • 4. Features (continued) ➔ ➔ Support for network cards (etherboot) Menu Interfaces for regular and command interface for advanced users ➔ Remote control from serial console. ➔ Supports multiple executable formats ➔ Can uncompress compressed files.
  • 5. Installing GRUB From Scratch (i.e. on a blank disk) ➔ Do it from a host with GNU/GRUB installed. ➔ Create a partition on disk fdisk /dev/sda ➔ Format and mount this partition: mkfs.ext3 /dev/sda1 sudo mount /dev/sda1 /mnt/sda1
  • 6. Installation....(Continued) ➔ Download grub tarball ftp://ftp.gnu.org/gnu/grub ➔ Compiling :) ➔ Install grub: grub-install –root-directory=/mnt/sda1 /dev/sda grub-mkconfig -o /boot/grub/grub.cfg A secret: The grub-install (Just a shell script !!! :-O) The real heroes are : ➔ 'grub-mkimage' and ➔ 'grub-setup'
  • 7. Exploring(The quest to learn GRUB-fu) ➔ Changes??? ➔ /boot/grub ➔ /etc/grub.d ➔ /etc/default/grub ➔ Other places: /usr/lib/grub(Modules)| /usr/bin or /bin (Binaries),Docs
  • 8. Exploring....(Digging In) ➔ Scanning grub.cfg(/boot/grub/grub.cfg) Phew!!.....looks complicated....(actually non-editable)we'll come back later. ➔ Peeking in /etc/grub.d ➔ ➔ 10_* Native boot entries ➔ 20_* Third party apps ➔ 30_osprobe :Scans for other O.S. ➔ ➔ 00_* contains header info 40_custom : Custom templates for additional entries Looking at /etc/default/grub.... Hmmm....looks interesting.!!! :)
  • 9. Customizing GRUB ➔ Some Theory: Custom Settings /etc/default/grub /etc/grub.d/ /boot/grub/grub.cfg Custom Scripts
  • 10. What can we do?
  • 11. Making Custom Settings ➔ We change the /etc/default/grub file. ➔ Some of the configurations are: ➔ GRUB_DEFAULT, ➔ GRUB_TIMEOUT, ➔ GRUB_HIDDEN_TIMEOUT, ➔ GRUB_DISABLE_RECOVERY, ➔ GRUB_BACKGROUND, ➔ GRUB_THEME, ➔ .....AND MANY MORE.
  • 12. Making Custom Scripts ➔ Can be done by adding scripts in ➔ Sample: echo "Some string" – cat << EOF – menuentry "Something" { – set root=(hdX,Y) – -- boot parameters -- – }EOF /etc/default/grub
  • 13. .....digging deeper ➔ Boot parameters ➔ Linux: linux /boot/vmlinuz initrd /boot/initrd.img ➔ Windows: chainloader (hdX,Y)+1 ➔ Stuck?....... Get a peek in os-prober output!! ;-)
  • 14. Grub Error Recovery ➔ Common Errors faced in GRUB ➔ GRUB Rescue
  • 15. Error Recovery Contd... ➔ The Easy Way Out: A Rescue CD. ➔ The Tough Way: set prefix=(hdx,y)/boot/grub insmod (hdx,y)/boot/grub/linux.mod set root=(hdx,y) linux /boot/vmlinux-<version> root=/dev/sda5 #Change the numbers initrd /boot/initramfs-3.0.0-1.fc16.i686.img boot grub-install /dev/sda5 #After booting #Change the numbers
  • 16. Error Recovery Contd.... ➔ Error with UEFI ➔ Try disabling Secure-Boot ➔ Install grub-efi and shim packages grub-mkconfig -o /boot/efi/EFI/$distr/grub.cfg ➔ Try using Boot-Repair ➔ Report a bug Forums to the rescue.
  • 17. Hacking With GRUB ➔ With GRUB users can access single user mode(root) ➔ How? ➔ ➔ ➔ Booting in recovery mode and going to root Modifying kernel arguments(Press a): appending '1' at the last of arguments On root prompt type passwd to change password!!!:-D
  • 18. Securing GRUB ➔ Setting a password for GRUB ➔ Editing /etc/grub.d/00_header cat <<EOF set superusers=”user1” password <user> <password> export superusers EOF ➔ Password protect menu entries menuentry ... --unrestricted {#all menuentry ... --users "" { #superuser menuentry ... --users Umar,hello {#superuser,umar,hello
  • 19. Securing....Continued. ➔ Adding hashed password $ grub-mkpasswd-pbkdf2 Enter your password: Re-enter your password: Your PBKDF2 is ................................. Now adding the output to 00_header (in /etc/grub.d) ➔ set superusers=”Umar” password_pbkdf2 Umar grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5
  • 20. What we haven't covered ➔ List of command line and menu-entry commands ➔ All the bugs/errors which you may encounter. ➔ Designing of GRUB themes. ➔ GRUB environment variables/block. ➔ Booting with GRUB on a network.
  • 21. Where to go from here? ➔ GNU-GRUB Documentation http://www.gnu.org/software/grub/manual/ ➔ GRUB Mailing list help-grub@gnu.org ➔ bug-grub@gnu.org grub-devel@gnu.org Wiki's https://fedoraproject.org/wiki/GRUB_2 https://wiki.archlinux.org/index.php/GRUB https://help.ubuntu.com/community/Grub2