SlideShare a Scribd company logo
Recipe of a Linux LiveCD
By
Buddhika Siddhisena
2
Agenda
What is a LiveCD
Why run a LiveCD
Understanding the Linux Boot process
Understanding the Linux LiveCD Boot process
How hardware detection could work
Achieving Data Persistence on LiveCD
Short survey of popular LiveCDs
3
What is a LiveCD
Is a CD that contains an Operating System (OS), capable of booting off
directly, without first having to be installed.
Will generally have automatic hardware detection, as the OS boots.
May contain more data than the physical size of a CDROM (~700MB) by
using on-the-fly decompression of the file system.
Generally slower to boot when compared to HDD, mainly due to slower
access times of CDROM drives.
May offer the ability to remember configuration settings by saving them
on to a drive (USB, floppy or HDD).
May offer it to be installed to the hard disk permanently
4
Why run a LiveCD
Provides an alternative way to try out a new OS/distribution.
Can be used to instantly convert any desktop to your desktop! And you
can't get blamed for doing so.
Can be a valuable resource for recovering data, resetting passwords etc.
Can be used to distribute a demo versions of software thats guaranteed to
work with minimum hassle.
And endless other possibilities....
5
Understanding the Linux Boot process
As the machine boots the BIOS looks for a bootable media depending on
the boot sequence.
BIOS loads the bootloader from a special area in the disk called the
Master Boot Record (MBR). On linux it is usually either LILO or GRUB.
LILO (or GRUB) will attempt to load the kernel and optionally an initial
RAM disk (initrd), if specified.
Control is passed to the kernel as it decompresses the initrd and mounts it
as the root device.
6
Understanding the Linux Boot process
The kernel executes /linuxrc from the root device. It will perform various
pre-boot tasks such as loading of additional drivers.
Once linuxrc exits control is passed back to the kernel which will then
mount the real root device as the root file system.
/sbin/init from the real root system is executed which uses /etc/inittab
configuration to boot rest of the system.
/etc/inittab defines the default runlevel (usually 3 or 5) and as part of
the boot process all scripts in /etc/rcX.d/ are executed.
7
Linux boot process in a nutshell
Power supply ON
PC BIOS starts
BIOS looks for a bootable media
according to the setting and
loads a program(=LILO) written
on MBR of a hard drive, and then
LILO gains control.
LILO loads a
kerne(vmlinuz)and
an initial RAM
disk(initrd)Kerne
l gains control
Kernel expands
initrd and
mounts it as a
temporary root
file system
If an executable /linuxrc exists
in the initrd, the kernel
executes it.
After the /linuxrc is
finished, the kernel
mounts a real root
file system which may
be /dev/hda1
/sbin/init executes
/etc/rc.d/rc.sysinit
according to a
description of
/etc/inittab.
Next, init executes
/etc/rc.d/rc with
a default run level as
an argument
For example, in run level 3, /etc/rc.d/rc
executes shell scripts like
SnnXXXX(nn=number) under /etc/rc.d/rc3.d
directory in order of S00XXXX to S99XXXX
with a start argument
8
Understanding the Linux LiveCD Boot process
BIOS finds a bootable CDROM and loads the bootloader (usually
ISOLINUX which is based on the Syslinux bootloader)
ISOLINUX will load the initrd and the kernel image and transfer control
to the kernel.
The kernel decompresses initrd and mounts it as root and executes the
/linuxrc script from the LiveCD.
9
Understanding the Linux LiveCD Boot process
It will load kernel modules required, attempt to guess the CDROM device and
mount it. Finally linuxrc will change the real root device of the kernel to that
of initrd, or LiveCD and exit.
#!/bin/sh
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Attempting to Mount CD-ROM
(mount -t iso9660 /dev/hdb /mnt/cdrom && ln -s /dev/hdb /dev/cdrom) ||
(mount -t iso9660 /dev/hdc /mnt/cdrom && ln -s /dev/hdc /dev/cdrom) ||
(mount -t iso9660 /dev/hdd /mnt/cdrom && ln -s /dev/hdd /dev/cdrom) ||
(mount -t iso9660 /dev/hda /mnt/cdrom && ln -s /dev/hda /dev/cdrom) ||
(echo 'cannot mount CD-ROM, dropping you to a shell';sh)
echo 0x0100 > /proc/sys/kernel/real-root-dev
umount /proc
Hardware detection scripts will take over as a runlevel service to
configure the rest of the system.
10
Hardware detection process
Scripts can use tools such as lspci, /proc/bus/pci/devices, /proc/bus/usb/devices
etc. to determine the system hardware.
bud@babytux bud $ /sbin/lspci
0000:00:01.0 PCI bridge: ATI Technologies Inc: Unknown device 7010
0000:00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev
03)0000:00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-
Link Controller Audio Device (rev 02)
0000:00:09.0 Network controller: Harris Semiconductor Prism 2.5 Wavelan
chipset(rev 01)
0000:00:10.0 IDE interface: ALi Corporation M5229 IDE (rev c4)
0000:00:12.0 Ethernet controller: National Semiconductor Corporation
DP83815 (MacPhyter) Ethernet Controller
0000:01:05.0 VGA compatible controller: ATI Technologies Inc: Unknown
device 4337
Then by using a database or some sort of pattern matching we can load
the correct kernel modules to drive those devices.
Check out the Linux PCID Repository at http://pciids.sourceforge.net/ or the
file /usr/share/misc/pci.ids
11
Hardware detection process
Other tools such as kudzu(http://rhlinux.redhat.com/kudzu/) that comes
with Redhat or discover(http://hackers.progeny.com/discover/) can
also be used
Configuring X windows can be done using tools such using XFree86 and
tools such as ddcprobe or read-edid to detect monitor refresh rates.
# XFree86 -configure
# get-edid | parse-edid
Usually the /etc, /home and /tmp directories will reside on an ramdisk
and will be symlinked from the LiveCD to be able to save settings
Certain files in the /dev directory should also reside on a ram disk.
(e.g. /dev/tty*, /dev/pts/* etc.)
12
Achieving Data Persistence on LiveCD
Data persistence can be achieved by running a shell script to store the
content of /home or /etc on a USB flash or HDD.
#!/bin/sh
mount /dev/sda1 /mnt/usb
tar -zcvf /mnt/usb/home.tar.gz /home
tar -zcvf /mnt/usb/etc.tar.gz /etc
When booting the live CD using ISOLinux, it is possible to pass
parameters to the kernel, even once that the kernel doesn't understand
boot: linux26 vga=791 home=/mnt/sda etc=/mnt/sda
A bootup script could read this value by examining /proc/cmdline
# cat /proc/cmdline
13
Short survey of popular LiveCDs
Knoppix - Knoppix is a Live Linux CD based on Debian GNU/Linux
Excellent hardware detection
Uses on the fly transparent decompression to store 2.5GB or data
Easy to remaster and make your own LiveCD (e.g. Gnoppix, Damn Small
Linux(DSO), Sinhala Knoppix)
http://www.knoppix.net
Mepis – Based on Debian GNU/Linux
Very Good harware detection.
Uses on the fly decompression to store about 1.1GB or data
Contains some non-free software such as Flash, Java, RealPlayer etc.
Easy to install to the HDD
http://www.mepis.org/
SLAX – Slackware based LiveCD
Fast, works well on slightly older hardware
Fits on to a mini CD since the image is only 185MB
http://slax.linux-live.org/
14
Short survey of popular LiveCDs
LNX/BBC – Portable card-sized distribution
Design to fit to a credit card size CD
http://www.lnx-bbc.org
Mandrake Move – A live CD based on Mandrake Linux
Commercial and free edition available.
http://www.mandrakesoft.com/products/mandrakemove
FreeBSD LiveCD – A LiveCD based FreeBSD OS
http://livecd.sourceforge.net/
15
Thank You!

More Related Content

DOCX
Run wordcount job (hadoop)
PDF
Install Archlinux in 10 Steps (Sort of) :)
PDF
Fossetcon14
ODP
Os Bernier
PDF
Asiabsdcon14
PPT
Andresen 8 21 02
PPT
Linux conf-admin
PDF
Tlf2014
Run wordcount job (hadoop)
Install Archlinux in 10 Steps (Sort of) :)
Fossetcon14
Os Bernier
Asiabsdcon14
Andresen 8 21 02
Linux conf-admin
Tlf2014

What's hot (20)

PDF
Lavigne bsdmag july
PDF
Linux Common Command
PDF
[ArabBSD] Unix Basics
PPT
Linuxppt
PDF
Linux fundamental - Chap 03 file
PDF
Raspberry Pi 101
PDF
2.Accessing the Pi
PDF
Asiabsdcon14 lavigne
PDF
Ilf2011
PDF
Linux fundamental - Chap 10 fs
PDF
Ha opensuse
PDF
Linux LVM Logical Volume Management
PPTX
Advanced Level Training on Koha / TLS (ToT)
PDF
Lavigne sept11 bsdmag
PDF
Clase4 (consola linux)
PDF
Linux fundamental - Chap 04 archive
PDF
vbsd2013
PDF
eurobsd2013
PDF
Summit demystifying systemd1
Lavigne bsdmag july
Linux Common Command
[ArabBSD] Unix Basics
Linuxppt
Linux fundamental - Chap 03 file
Raspberry Pi 101
2.Accessing the Pi
Asiabsdcon14 lavigne
Ilf2011
Linux fundamental - Chap 10 fs
Ha opensuse
Linux LVM Logical Volume Management
Advanced Level Training on Koha / TLS (ToT)
Lavigne sept11 bsdmag
Clase4 (consola linux)
Linux fundamental - Chap 04 archive
vbsd2013
eurobsd2013
Summit demystifying systemd1
Ad

Viewers also liked (7)

PDF
Beyond desktop/server with GNU/Linux (archived)
PDF
Contributing to FOSS (archived)
PPS
Sub Prime Mortgage Mess
PDF
Yoo Torture Memo Pt2
PDF
Foss Gadgematics
PDF
FOSS in Sri Lanka (archived)
PDF
Opensource opportunity
Beyond desktop/server with GNU/Linux (archived)
Contributing to FOSS (archived)
Sub Prime Mortgage Mess
Yoo Torture Memo Pt2
Foss Gadgematics
FOSS in Sri Lanka (archived)
Opensource opportunity
Ad

Similar to Recipe of a linux Live CD (archived) (20)

DOC
6 stages of linux boot process
PPTX
introduction to computer Linux essential.pptx
DOCX
6 stages of linux boot process
PPT
101 1.2 boot the system
PPT
Linux filesystemhierarchy
PPTX
Linux basics
PPTX
Linux basics
PDF
FreeBSD Portscamp, Kuala Lumpur 2016
DOCX
6 stages of linux boot process
DOCX
6 stages of linux boot process
PPT
Linux Conf Admin
PPT
Linux conf-admin
PPTX
Introduction to Operating Systems.pptx
PPTX
First Responder Course - Session 10 - Static Evidence Collection [2004]
PPT
Basic Linux Internals
PPT
Linux Booting Process
PPT
PPT
Ch12 system administration
PPT
Unix Administration 2
PPT
101 2.1 design hard disk layout v2
6 stages of linux boot process
introduction to computer Linux essential.pptx
6 stages of linux boot process
101 1.2 boot the system
Linux filesystemhierarchy
Linux basics
Linux basics
FreeBSD Portscamp, Kuala Lumpur 2016
6 stages of linux boot process
6 stages of linux boot process
Linux Conf Admin
Linux conf-admin
Introduction to Operating Systems.pptx
First Responder Course - Session 10 - Static Evidence Collection [2004]
Basic Linux Internals
Linux Booting Process
Ch12 system administration
Unix Administration 2
101 2.1 design hard disk layout v2

More from Bud Siddhisena (15)

PDF
JIT qa-docker
PPTX
Building apis that don’t suck!
PDF
Why should you android (archived)
PDF
Virtualization, The future of computing (archived)
PDF
Building the Next big thing (archived)
PDF
GNU/Linux for a better home (archived)
PDF
Gaming on linux (archived)
PDF
Choosing your GNU/Linux distribution (archived)
PDF
PDF
Remembering steve
PDF
Scale Apache with Nginx
PDF
Introduction to firewalls through Iptables
PPT
FOSS and Security
PDF
Secure your IT infrastructure with GNU/Linux
PDF
Kernel Configuration and Compilation
JIT qa-docker
Building apis that don’t suck!
Why should you android (archived)
Virtualization, The future of computing (archived)
Building the Next big thing (archived)
GNU/Linux for a better home (archived)
Gaming on linux (archived)
Choosing your GNU/Linux distribution (archived)
Remembering steve
Scale Apache with Nginx
Introduction to firewalls through Iptables
FOSS and Security
Secure your IT infrastructure with GNU/Linux
Kernel Configuration and Compilation

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Modernizing your data center with Dell and AMD
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Modernizing your data center with Dell and AMD
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
Electronic commerce courselecture one. Pdf
Dropbox Q2 2025 Financial Results & Investor Presentation

Recipe of a linux Live CD (archived)

  • 1. Recipe of a Linux LiveCD By Buddhika Siddhisena
  • 2. 2 Agenda What is a LiveCD Why run a LiveCD Understanding the Linux Boot process Understanding the Linux LiveCD Boot process How hardware detection could work Achieving Data Persistence on LiveCD Short survey of popular LiveCDs
  • 3. 3 What is a LiveCD Is a CD that contains an Operating System (OS), capable of booting off directly, without first having to be installed. Will generally have automatic hardware detection, as the OS boots. May contain more data than the physical size of a CDROM (~700MB) by using on-the-fly decompression of the file system. Generally slower to boot when compared to HDD, mainly due to slower access times of CDROM drives. May offer the ability to remember configuration settings by saving them on to a drive (USB, floppy or HDD). May offer it to be installed to the hard disk permanently
  • 4. 4 Why run a LiveCD Provides an alternative way to try out a new OS/distribution. Can be used to instantly convert any desktop to your desktop! And you can't get blamed for doing so. Can be a valuable resource for recovering data, resetting passwords etc. Can be used to distribute a demo versions of software thats guaranteed to work with minimum hassle. And endless other possibilities....
  • 5. 5 Understanding the Linux Boot process As the machine boots the BIOS looks for a bootable media depending on the boot sequence. BIOS loads the bootloader from a special area in the disk called the Master Boot Record (MBR). On linux it is usually either LILO or GRUB. LILO (or GRUB) will attempt to load the kernel and optionally an initial RAM disk (initrd), if specified. Control is passed to the kernel as it decompresses the initrd and mounts it as the root device.
  • 6. 6 Understanding the Linux Boot process The kernel executes /linuxrc from the root device. It will perform various pre-boot tasks such as loading of additional drivers. Once linuxrc exits control is passed back to the kernel which will then mount the real root device as the root file system. /sbin/init from the real root system is executed which uses /etc/inittab configuration to boot rest of the system. /etc/inittab defines the default runlevel (usually 3 or 5) and as part of the boot process all scripts in /etc/rcX.d/ are executed.
  • 7. 7 Linux boot process in a nutshell Power supply ON PC BIOS starts BIOS looks for a bootable media according to the setting and loads a program(=LILO) written on MBR of a hard drive, and then LILO gains control. LILO loads a kerne(vmlinuz)and an initial RAM disk(initrd)Kerne l gains control Kernel expands initrd and mounts it as a temporary root file system If an executable /linuxrc exists in the initrd, the kernel executes it. After the /linuxrc is finished, the kernel mounts a real root file system which may be /dev/hda1 /sbin/init executes /etc/rc.d/rc.sysinit according to a description of /etc/inittab. Next, init executes /etc/rc.d/rc with a default run level as an argument For example, in run level 3, /etc/rc.d/rc executes shell scripts like SnnXXXX(nn=number) under /etc/rc.d/rc3.d directory in order of S00XXXX to S99XXXX with a start argument
  • 8. 8 Understanding the Linux LiveCD Boot process BIOS finds a bootable CDROM and loads the bootloader (usually ISOLINUX which is based on the Syslinux bootloader) ISOLINUX will load the initrd and the kernel image and transfer control to the kernel. The kernel decompresses initrd and mounts it as root and executes the /linuxrc script from the LiveCD.
  • 9. 9 Understanding the Linux LiveCD Boot process It will load kernel modules required, attempt to guess the CDROM device and mount it. Finally linuxrc will change the real root device of the kernel to that of initrd, or LiveCD and exit. #!/bin/sh echo Mounting /proc filesystem mount -t proc /proc /proc echo Attempting to Mount CD-ROM (mount -t iso9660 /dev/hdb /mnt/cdrom && ln -s /dev/hdb /dev/cdrom) || (mount -t iso9660 /dev/hdc /mnt/cdrom && ln -s /dev/hdc /dev/cdrom) || (mount -t iso9660 /dev/hdd /mnt/cdrom && ln -s /dev/hdd /dev/cdrom) || (mount -t iso9660 /dev/hda /mnt/cdrom && ln -s /dev/hda /dev/cdrom) || (echo 'cannot mount CD-ROM, dropping you to a shell';sh) echo 0x0100 > /proc/sys/kernel/real-root-dev umount /proc Hardware detection scripts will take over as a runlevel service to configure the rest of the system.
  • 10. 10 Hardware detection process Scripts can use tools such as lspci, /proc/bus/pci/devices, /proc/bus/usb/devices etc. to determine the system hardware. bud@babytux bud $ /sbin/lspci 0000:00:01.0 PCI bridge: ATI Technologies Inc: Unknown device 7010 0000:00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03)0000:00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC- Link Controller Audio Device (rev 02) 0000:00:09.0 Network controller: Harris Semiconductor Prism 2.5 Wavelan chipset(rev 01) 0000:00:10.0 IDE interface: ALi Corporation M5229 IDE (rev c4) 0000:00:12.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller 0000:01:05.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4337 Then by using a database or some sort of pattern matching we can load the correct kernel modules to drive those devices. Check out the Linux PCID Repository at http://pciids.sourceforge.net/ or the file /usr/share/misc/pci.ids
  • 11. 11 Hardware detection process Other tools such as kudzu(http://rhlinux.redhat.com/kudzu/) that comes with Redhat or discover(http://hackers.progeny.com/discover/) can also be used Configuring X windows can be done using tools such using XFree86 and tools such as ddcprobe or read-edid to detect monitor refresh rates. # XFree86 -configure # get-edid | parse-edid Usually the /etc, /home and /tmp directories will reside on an ramdisk and will be symlinked from the LiveCD to be able to save settings Certain files in the /dev directory should also reside on a ram disk. (e.g. /dev/tty*, /dev/pts/* etc.)
  • 12. 12 Achieving Data Persistence on LiveCD Data persistence can be achieved by running a shell script to store the content of /home or /etc on a USB flash or HDD. #!/bin/sh mount /dev/sda1 /mnt/usb tar -zcvf /mnt/usb/home.tar.gz /home tar -zcvf /mnt/usb/etc.tar.gz /etc When booting the live CD using ISOLinux, it is possible to pass parameters to the kernel, even once that the kernel doesn't understand boot: linux26 vga=791 home=/mnt/sda etc=/mnt/sda A bootup script could read this value by examining /proc/cmdline # cat /proc/cmdline
  • 13. 13 Short survey of popular LiveCDs Knoppix - Knoppix is a Live Linux CD based on Debian GNU/Linux Excellent hardware detection Uses on the fly transparent decompression to store 2.5GB or data Easy to remaster and make your own LiveCD (e.g. Gnoppix, Damn Small Linux(DSO), Sinhala Knoppix) http://www.knoppix.net Mepis – Based on Debian GNU/Linux Very Good harware detection. Uses on the fly decompression to store about 1.1GB or data Contains some non-free software such as Flash, Java, RealPlayer etc. Easy to install to the HDD http://www.mepis.org/ SLAX – Slackware based LiveCD Fast, works well on slightly older hardware Fits on to a mini CD since the image is only 185MB http://slax.linux-live.org/
  • 14. 14 Short survey of popular LiveCDs LNX/BBC – Portable card-sized distribution Design to fit to a credit card size CD http://www.lnx-bbc.org Mandrake Move – A live CD based on Mandrake Linux Commercial and free edition available. http://www.mandrakesoft.com/products/mandrakemove FreeBSD LiveCD – A LiveCD based FreeBSD OS http://livecd.sourceforge.net/