Understanding the Linux /boot directory
When I first began using Linux quite some time ago, I remember thinking to myself WTF is all this stuff in /boot. There were files related to grub, a file called vmlinuz, and several ASCII text files with cool sounding names. After reading through the Linux kernel HOWTO, the /boot directory layout all came together, and understanding the purpose of each file has helped me better understand how things work, and allowed me to solve numerous issues in a more expedient manner. Given a typical CentOS or Fedora host, you will probably see something similar to the following in /boot:
. |-- System.map-2.6.29.5-191.fc11.x86_64 |-- System.map-2.6.30 |-- config-2.6.29.5-191.fc11.x86_64 |-- config-2.6.30 |-- efi | `-- EFI | `-- redhat | `-- grub.efi |-- grub | |-- device.map | |-- e2fs_stage1_5 | |-- fat_stage1_5 | |-- ffs_stage1_5 | |-- grub.conf | |-- iso9660_stage1_5 | |-- jfs_stage1_5 | |-- menu.lst -> ./grub.conf | |-- minix_stage1_5 | |-- reiserfs_stage1_5 | |-- splash.xpm.gz | |-- stage1 | |-- stage2 | |-- ufs2_stage1_5 | |-- vstafs_stage1_5 | `-- xfs_stage1_5 |-- initrd-2.6.29.5-191.fc11.x86_64.img |-- initrd-2.6.30.img |-- vmlinuz-2.6.29.5-191.fc11.x86_64 `-- vmlinuz-2.6.30
For each kernel release, you will typically see a vmlinuz, System.map, initrd and config file. The vmlinuz file contain the actual Linux kernel, which is loaded and executed by grub. The System.map file contains a list of kernel symbols and the addresses these symbols are located at. The initrd file is the initial ramdisk used to preload modules, and contains the drivers and supporting infrastructure (keyboard mappings, etc.) needed to manage your keyboard, serial devices and block storage early on in the boot process. The config file contains a list of kernel configuration options, which is useful for understanding which features were compiled into the kernel, and which features were built as modules. I am going to type up a separate post with my notes on grub, especially those related to solving boot related issues.
This article was posted by Matty on 2009-07-02 03:55:00 -0400 -0400
Copyright Matty 2002 — 2020
Linux /boot folder
This is the first post on our series of Linux Directory structure posts. From today onwords we will deep dive you in some of the important directories in Linux. Knowing about these directories a Linux user will know what each directory meant for. Lets start with alphabetical order. Our first Directory is /boot
/boot
/boot is an important folder in Linux. /boot folder contains all the boot related info files and folders such as grub.conf, vmlinuz image aka kernel etc. In this post we will try to explore what each file is used for. This is just an informative post and no configuration of these files are covered. This folder contains following files in most of the Linux distributions. We taken Redhat based machines as an example when writing this post.
/boot/config-2.6.18-194.17.1.el5 file
/boot/config-2.6.18-194.17.1.el5 file: This config file contains kernel configuration settings. You no need to edit this file when compiling kernel. This file is created when we are building a kernel with “make menuconfig” command. The settings in this file get changed depending on the options we select in “make menuconfig” command. The contents of this file is are setting related to modules to be loaded at the time of boot into the kernel. Want to compile your own kernel? Have a look at our older post .
/boot/initrd-2.6.18-194.17.1.el5.img file
/boot/initrd-2.6.18-194.17.1.el5.img file: Initrd in other words called as Initializing RAM Disk which loads temporary file system in to RAM at the time of booting process before actual file system mounting. This file is loaded by your kernel image file at the time of booting. This initrd image knows only one configuration file /etc/inittab file. The inittab file contains what are run levels, what init has to do in each run level and what is the default runlevel etc.
/boot/initrd-2.6.18-194.17.1.el5.img file
/boot/vmlinuz-2.6.18-194.17.1.el5 file: vmlinuz is a compressed Linux Kernel image which is used at the time of booting Linux operating system. Vmlinuz stands for virtual memory Linux kernel zipped. /boot/System.map-2.6.18-194.17.1.el5 file: This is a map file used by kernel. This file contains memory location mapped to the kernel variables or functions. Again this file is used by vmlinuz kernel image at the time of booting to set symbol names. A good info on system.map can be found at Wikipedia article.
/boot/grub/grub.conf
/boot/grub/grub.conf or menu.lst file: This file is used for boot loader grub to load grub related configuration so that this is used at the time of booting. Please stay tuned to learn about /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin in next post.
Surendra Anne
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container — June 30, 2020
- Anisble: ERROR! unexpected parameter type in action: Fix — June 29, 2020
- FREE: JOIN OUR DEVOPS TELEGRAM GROUPS — August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) — August 27, 2018
- How to use ohai/chef-shell to get node attributes — July 19, 2018
Linux boot directory files
This directory contains everything required for the boot process except for configuration files not needed at boot time (the most notable of those being those that belong to the GRUB boot-loader) and the map installer. Thus, the /boot directory stores data that is used before the kernel begins executing user-mode programs. This may include redundant (back-up) master boot records, sector/system map files, the kernel and other important boot files and data that is not directly edited by hand. Programs necessary to arrange for the boot loader to be able to boot a file are placed in /sbin. Configuration files for boot loaders are placed in /etc. The system kernel is located in either / or /boot (or as under Debian in /boot but is actually a symbolically linked at / in accordance with the FSSTND).
Backup master boot record.
This is installed as the basic boot sector. In the case of most modern distributions it is actually a symbolic link to one of four files /boot/boot-bmp.b, /boot/boot-menu.b, /boot/boot-text.b, /boot/boot-compat.b which allow a user to change the boot-up schema so that it utilises a splash screen, a simple menu, a text based interface or a minimal boot loader to ensure compatibility respectively. In each case re-installation of lilo is necessary in order to complete the changes. To change the actual ‘boot-logo’ you can either use utilities such as fblogo or the more refined bootsplash.
Used to boot non-Linux operating systems.
Installed kernel configuration. This file is most useful when compiling kernels on other systems or device modules. Below is a small sample of what the contents of the file looks like.
CONFIG_X86=y CONFIG_MICROCODE=m CONFIG_X86_MSR=m CONFIG_MATH_EMULATION=y CONFIG_MTRR=y CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_SCSI_DEBUG=m CONFIG_I2O=m CONFIG_ARCNET_ETH=y CONFIG_FMV18X=m CONFIG_HPLAN_PLUS=m CONFIG_ETH16I=m CONFIG_NE2000=m CONFIG_HISAX_HFC_PCI=y CONFIG_ISDN_DRV_AVMB1_C4=m CONFIG_USB_RIO500=m CONFIG_QUOTA=y CONFIG_AUTOFS_FS=m CONFIG_ADFS_FS=m CONFIG_AFFS_FS=m CONFIG_HFS_FS=m CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_UMSDOS_FS=m CONFIG_FBCON_VGA=m CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_SOUND=m CONFIG_SOUND_CMPCI=m CONFIG_AEDSP16=m
As you can see, it’s rather simplistic. The line begins with the configuration option and whether it’s configured as part of the kernel, as a module or not at all. Lines beginning with a # symbol are comments and are not interpreted during processing.
Used to boot to the 0S/2 operating system.
Contains the location of the kernel.
Normally the kernel or symbolic link to the kernel.
This subdirectory contains the GRUB configuration files including boot-up images and sounds. GRUB is the GNU GRand Unified Bootloader, a project which intends to solve all bootup problems once and for all. One of the most interesting features, is that you don’t have to install a new partition or kernel, you can change all parameters at boot time via the GRUB Console, since it knows about the filesystems.
Maps devices in /dev to those used by grub. For example, (/dev/fd0) is represented by /dev/fd0 and (hd0, 4) is referenced by /dev/hda5.
Grub boot-up welcome message.
Grub boot-up background image.