SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in LinuxSAMUEL OJO
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)shimosawa
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Ahmed El-Arabawy
 
Formation Linux - Initiation
Formation Linux - InitiationFormation Linux - Initiation
Formation Linux - Initiationrobertpluss
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchysritolia
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scriptingAkshay Siwal
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 

Was ist angesagt? (20)

Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions
 
Linux OS presentation
Linux OS presentationLinux OS presentation
Linux OS presentation
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Formation Linux - Initiation
Formation Linux - InitiationFormation Linux - Initiation
Formation Linux - Initiation
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchy
 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scripting
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

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