Getting your system to boot with initrd and initramfs



Similar documents
EXPLORING LINUX KERNEL: THE EASY WAY!

How to Restore a Linux Server Using Bare Metal Restore

Yosemite Server Backup Installation Guide

Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

LSN 10 Linux Overview

Restoring a Suse Linux Enterprise Server 9 64 Bit on Dissimilar Hardware with CBMR for Linux 1.02

Booting and Configuring a Xen Host

ATT8231: Creating a Customized USB Thumb Drive for ZCM Imaging Methods for creating a customized bootable USB Thumb Drive

Acronis Backup & Recovery 10 Server for Linux. Quick Start Guide

RH033 Red Hat Linux Essentials or equivalent experience with Red Hat Linux..

HARFORD COMMUNITY COLLEGE 401 Thomas Run Road Bel Air, MD Course Outline CIS INTRODUCTION TO UNIX

Installing Debian with SATA based RAID

Computer Science and Engineering Linux Cisco VPN Client Installation and Setup Guide

Encrypted Root Filesystem HOWTO

Red Hat Linux Administration II Installation, Configuration, Software and Troubleshooting

Professional Xen Visualization

Firebird on Linux. Author: Philippe Makowski IBPhoenix Licence: Public Documentation License Date:

Xen Virtualization Software

VMTurbo Operations Manager 4.5 Installing and Updating Operations Manager

Acronis Backup & Recovery 10 Server for Linux. Update 5. Installation Guide

How To Install Storegrid Server On Linux On A Microsoft Ubuntu 7.5 (Amd64) Or Ubuntu (Amd86) (Amd77) (Orchestra) (For Ubuntu) (Permanent) (Powerpoint

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

CS197U: A Hands on Introduction to Unix

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5 Manage Backup and Recovery

The BackTrack Successor

RAID Software Suite for Linux

Embedded Linux development training 4 days session

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Linux Embedded devices with PicoDebian Martin Noha

Linux Overview. The Senator Patrick Leahy Center for Digital Investigation. Champlain College. Written by: Josh Lowery

PARALLELS SERVER 4 BARE METAL README

Getting started with ARM-Linux

Linux + Windows 95 mini HOWTO

A simple name for your cluster brain

SECURE YOUR NETWORK WITH FIREWALL BUILDER

Package Management. Michael Tsai 2016/4/27

Load Balancing - Single Multipath Route HOWTO

Kaspersky Endpoint Security 8 for Linux INSTALLATION GUIDE

Survey of Filesystems for Embedded Linux. Presented by Gene Sally CELF

IT6204 Systems & Network Administration. (Optional)

Red Hat Linux 7.2 Installation Guide

Linux System Administration on Red Hat

PARALLELS SERVER BARE METAL 5.0 README

HTTP-FUSE PS3 Linux: an internet boot framework with kboot

NI Real-Time Hypervisor for Windows

Software Developer Program. Application Build Environment Manual

Creating a Linux Virtual Machine using Virtual Box

The Linux System. o Updating without touching the user's files and configurations.

System administration basics

Linux Template Creation Guide. How to build your own Linux VM templates for deployment in Cloudturk.

Support Notes for SUSE LINUX Enterprise Server 9 Service Pack 3 for the Intel Itanium 2 Processor Family

Avira AntiVir MailGate 3.2 Release Notes

The Virtual Environment

Skip the But it Works on My Machine Excuse with Vagrant

Table 1-1. PXE Server Side Requirements

GLS250 "Enterprise Linux Systems Administration"


Btrfs and Rollback How It Works and How to Avoid Pitfalls

Cloud-init. Marc Skinner - Principal Solutions Architect Michael Heldebrant - Solutions Architect Red Hat

Lesson 06: Basics of Software Development (W02D2

Installation 42goISP Manager

Oracle VM Server Recovery Guide. Version 8.2

Ubuntu Sever Administration

Server Monitoring. AppDynamics Pro Documentation. Version Page 1

Parallels Virtuozzo Containers 4.7 for Linux Readme

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Redhat 6.2 Installation Howto -Basic Proxy and Transparent

Planning for an Amanda Disaster Recovery System

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

RedHat (RHEL) System Administration Course Summary

Linux Disaster Recovery best practices with rear

Installing and Configuring Linux Guest Operating Systems VMware Infrastructure 3

RocketRAID 2640/2642 SAS Controller Ubuntu Linux Installation Guide

A candidate following a programme of learning leading to this unit will be able to:

Bitrix Site Manager. VMBitrix Virtual Machine. Quick Start And Usage Guide

... Alternative Linux distributions for POWER processor-based systems A review of unsupported Linux distributions running on POWER5

Kaspersky Anti-Virus 8.0 for Linux File Server Installation Guide

Getting Started in Red Hat Linux An Overview of Red Hat Linux p. 3 Introducing Red Hat Linux p. 4 What Is Linux? p. 5 Linux's Roots in UNIX p.

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

GL-250: Red Hat Linux Systems Administration. Course Outline. Course Length: 5 days

Using VMware Player. VMware Player. What Is VMware Player?

RocketRAID 174x SATA Controller Ubuntu Linux Installation Guide

Linux Kernel Tester s Guide

10 Red Hat Linux Tips and Tricks

Converting Linux and Windows Physical and Virtual Machines to Oracle VM Virtual Machines. An Oracle Technical White Paper December 2008

Enterprise Reporting Server v3.5

The Linux Boot Sequence

Linux Network Servers

Installing Multiple Linux Distributions on a Single Machine

Training on Linux System Administration, LPI Certification Level 1

Khóa học Enterprise Linux System Administration

VERSION 9.02 INSTALLATION GUIDE.

How to Install and Run Tibia on Linux Using Wine without Windows Contents

Virtual machine W4M- Galaxy: Installation guide

Over-the-top Upgrade Guide for Snare Server v7

Booting Palacios/Kitten and Palacios/Linux Over the Network Using PXE

Linux+ Guide to Linux Certification, Third Edition. Chapter 11 Compression, System Backup, and Software Installation

Installing VMware Tools on Clearswift v4 Gateways

Transcription:

Getting your system to boot with initrd and initramfs Ryan Curtin LUG@GT Ryan Curtin Getting your system to boot with initrd and initramfs - p. 1/12

Goals By the end of this presentation, hopefully, you should be able to: Know the basic history of initrd and initramfs, and why they exist Know how to configure GRUB / LILO to use an initrd or initramfs Unpack and look inside an initrd or initramfs Use standard tools to generate a new initrd or initramfs Modify an initrd and initramfs by hand or through configuration files Know how to configure a kernel to avoid using an initrd or initramfs Ryan Curtin Getting your system to boot with initrd and initramfs - p. 2/12

History of initrd and initramfs» History of initrd and initramfs» Internals of an initrd» /linuxrc or /init - the initialization script» So what makes initrd and initramfs different? The idea of an initrd has been around almost as long as Linux itself, going back to the 1.xx kernels a It exists to load modules that are required by the kernel at boot-time, but not compiled into the kernel The concept exists today in 2.6 kernels as initramfs and is used by distributions such as Fedora, Red Hat, Ubuntu, and Debian (there are more, of course) a http://ussg.iu.edu/hypermail/linux/kernel/9602/1289.html Ryan Curtin Getting your system to boot with initrd and initramfs - p. 3/12

Internals of an initrd» History of initrd and initramfs» Internals of an initrd» /linuxrc or /init - the initialization script» So what makes initrd and initramfs different? The initrd is usually a cpio archive passed through gzip Inside the archive is a straightforward simple directory hierarchy, similar to the standard Linux filesystem hierarchy You can crack open an archive with $ gzip -dc initrd.img cpio -idv /linuxrc and /init contain the script that is run to boot the system Ryan Curtin Getting your system to boot with initrd and initramfs - p. 4/12

/linuxrc or /init - the initialization script» History of initrd and initramfs» Internals of an initrd» /linuxrc or /init - the initialization script» So what makes initrd and initramfs different? /linuxrc or /init is the first executable started once the initrd or initramfs is loaded by the kernel /linuxrc is used in the older initrd /init is used in the newer initramfs This executable is usually a shell script; Debian uses /bin/sh but Red Hat uses /bin/nash; it does not matter which shell/interpreter is used Ryan Curtin Getting your system to boot with initrd and initramfs - p. 5/12

So what makes initrd and initramfs different?» History of initrd and initramfs» Internals of an initrd» /linuxrc or /init - the initialization script» So what makes initrd and initramfs different? Both initrd and initramfs exist to solve the same problem; however, initramfs is used by modern 2.6 kernels whereas initrd was used by older 2.4 (and earlier) kernels initramfs uses a dynamically-allocated RAM filesystem; initrd uses a statically-allocated RAM disk A filesystem driver is required to read a initrd image at boot-time; initramfs requires only a lightweight ramfs driver, which is built-in by default in 2.6 kernels initramfs makes NFS-mounted root filesystems easier; DHCP and logins may be necessary to mount an NFS share as root Ryan Curtin Getting your system to boot with initrd and initramfs - p. 6/12

The Red Hat way» The Red Hat way» The Debian way» The Gentoo way» By hand The Red Hat utility for generating an initramfs is mkinitrd This utility seems to use the term initrd and initramfs interchangeably, as it produces an initramfs General syntax: mkinitrd -allow-missing -f initrd.img kernel-version The mkinitrd command is referenced by /sbin/new-kernel-pkg /sbin/installkernel /etc/modprobe.conf controls the modules that are put into the initramfs. Ryan Curtin Getting your system to boot with initrd and initramfs - p. 7/12

The Debian way» The Red Hat way» The Debian way» The Gentoo way» By hand The Debian utility for creating an initramfs is the slightly-more-aptly-named mkinitramfs Another utility is updateinitramfs, which can update the initramfs for all kernels on your machine yaird will also generate an initramfs, but it is less tested than the other Debian tools A comparison of methods - yaird will generate a rather small initramfs by default; initramfs-tools will not initramfs-tools will create an initramfs no matter what; yaird will stop if it cannot be sure that the generated initramfs will work An initramfs generated by initramfs-tools will have an emergency shell if it fails; yaird does not include this unless you explicitly specify it Ryan Curtin Getting your system to boot with initrd and initramfs - p. 8/12

The Gentoo way» The Red Hat way» The Debian way» The Gentoo way» By hand A kernel configured by hand generally does not require an initramfs - the install guide encourages you to compile everything you need into the kernel A kernel created with genkernel will also create an initramfs mkinitrd is in the Portage tree; this could also be used Gentoo-Wiki has an extensive article about configuring your own initramfs - http://gentoo-wiki.com/howto_initramfs Ryan Curtin Getting your system to boot with initrd and initramfs - p. 9/12

By hand» The Red Hat way» The Debian way» The Gentoo way» By hand When the initrd filesystem is done, it should contain (for proper startup) An /init script (necessary) The shell necessary to run the /init script and its dependencies Any modules that need to be loaded to mount the root filesystem Pack up the filesystem with $ find./ > file_list $ cpio -o < file_list > initrd.cpio $ gzip initrd.cpio $ rm file_list Ryan Curtin Getting your system to boot with initrd and initramfs - p. 10/12

» GRUB - sample grub.conf excerpt title Debian GNU/Linux, kernel 2.6.18-4-686 root (hd0,0) kernel /vmlinuz-2.6.18-4-686 root=/dev/hda3 ro initrd /initrd.img-2.6.18-4-686 LILO - sample lilo.conf excerpt image=/vmlinuz label=linux read-only initrd=/initrd.img Ryan Curtin Getting your system to boot with initrd and initramfs - p. 11/12

» Ryan Curtin Getting your system to boot with initrd and initramfs - p. 12/12