You are on page 1of 7

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

About Forum Howtos & FAQs Low graphics Shell Scripts RSS/Feed

nixcraft - insight into linux admin work

10 boot time parameters you should know about the Linux kernel
by Vivek Gite on March 8, 2006 14 comments The Linux kernel accepts boot time parameters as it starts to boot system. This is used to inform kernel about various hardware parameter. You need boot time parameters: * Troubleshoot system * Hardware parameters that the kernel would not able to determine on its own * Force kernel to override the default hardware parameters in order to increase performance * Password and other recovery operations

The kernel command line syntax


name=value1,value2,value3 Where, name : Keyword name, for example, init, ro, boot etc

Ten common Boot time parameters


init This sets the initial command to be executed by the kernel. Default is to use /sbin/init, which is the parent of all processes. To boot system without password pass /bin/bash or /bin/sh as argument to init
init=/bin/bash

single The most common argument that is passed to the init process is the word 'single' which instructs init to boot the computer in single user mode, and not launch all the usual daemons

1 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

root=/dev/device This argument tells the kernel what device (hard disk, floppy disk) to be used as the root filesystem while booting. For example following boot parameter use /dev/sda1 as the root file system:
root=/dev/sda1

If you copy entire partition from /dev/sda1 to /dev/sdb1 then use


root=/dev/sdb1

ro This argument tells the kernel to mount root file system as read-only. This is done so that fsck program can check and repair a Linux file system. Please note that you should never ever run fsck on read/write file system. rw This argument tells the kernel to mount root file system as read and write mode. panic=SECOND Specify kernel behavior on panic. By default, the kernel will not reboot after a panic, but this option will cause a kernel reboot after N seconds. For example following boot parameter will force to reboot Linux after 10 seconds
panic=10

maxcpus=NUMBER Specify maximum number of processors that an SMP kernel should make use of. For example if you have four cpus and would like to use 2 CPU then pass 2 as a number to maxcpus (useful to test different software performances and configurations).
maxcpus=2

debug Enable kernel debugging. This option is useful for kernel hackers and developers who wish to troubleshoot problem selinux [0|1] Disable or enable SELinux at boot time. Value 0 : Disable selinux Value 1 : Enable selinux raid=/dev/mdN This argument tells kernel howto assembly of RAID arrays at boot time. Please note that When md is compiled into the kernel (not as module), partitions of type 0xfd are scanned and automatically assembled into RAID arrays. This autodetection may be suppressed with the kernel parameter "raid=noautodetect". As of kernel 2.6.9, only drives with a type 0 superblock can be autodetected and run at boot time. mem=MEMEORY_SIZE

2 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

This is a classic parameter. Force usage of a specific amount of memory to be used when the kernel is not able to see the whole system memory or for test. For example:
mem=1024M

The kernel command line is a null-terminated string currently up to 255 characters long, plus the final null. A string that is too long will be automatically truncated by the kernel, a boot loader may allow a longer command line to be passed to permit future kernels to extend this limit (H. Peter Anvin ).

Other parameters
initrd /boot/initrd.img An initrd should be loaded. the boot process will load the kernel and an initial ramdisk; then the kernel converts initrd into a "normal" ramdisk, which is mounted read-write as root device; then /linuxrc is executed; afterwards the "real" root file system is mounted, and the initrd file system is moved over to /initrd; finally the usual boot sequence (e.g. invocation of /sbin/init) is performed. initrd is used to provide/load additional modules (device driver). For example, SCSI or RAID device driver loaded using initrd. hdX =noprobe Do not probe for hdX drive. For example, disable hdb hard disk:
hdb=noprobe

If you disable hdb in BIOS, Linux will still detect it. This is the only way to disable hdb. ether=irq,iobase,[ARG1,ARG2],name Where, ether: ETHERNET DEVICES For example, following boot argument force probing for a second Ethernet card (NIC), as the default is to only probe for one (irq=0,iobase=0 means automatically detect them). ether=0,0,eth1

How to begin the enter parameters mode?


You need to enter all this parameter at Grub or Lilo boot prompt. For example if you are using Grub as a boot loader, at Grub prompt press 'e' to edit command before booting. 1) Select second line 2) Again, press 'e' to edit selected command 3) Type any of above parameters. See an example of "recovering grub boot loader password", for more information. Another option is to type above parameters in grub.conf or lilo.conf file itself. See the complete list of Linux kernel parameters i.e. /usr/src/linux/Documentation/kernel-parameters.txt file. Featured Articles: 20 Linux System Monitoring Tools Every SysAdmin Should Know

3 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

20 Linux Server Hardening Security Tips My 10 UNIX Command Line Mistakes The Novice Guide To Buying A Linux Laptop 10 Greatest Open Source Software Of 2009 Top 5 Email Client For Linux, Mac OS X, and Windows Users Top 20 OpenSSH Server Best Security Practices Top 10 Open Source Web-Based Project Management Software Top 5 Linux Video Editor Software { 14 comments read them below or add one } 1 Anonymous March 9, 2006 Hey, nice list but dont forget vga=ask It will help if you have problems releated to vga card (change the startup video mode) Reply 2 Anonymous March 9, 2006 What maybe lack in this article is: How to begin the enter parameters mode? I guess that, with knoppix, I can enter these in the cheatcodes field, at start. But what about a regular lilo or grub boot, and typing this parameters on the fly, without put fingers into lilo.conf or menu.lst? Reply 3 monk March 9, 2006 >What maybe lack in this article is: How to begin the enter parameters mode? Thanks, just little info added as per your suggestion :) Reply 4 Anonymous March 23, 2006 If lilo boot screen doesnt come with the boot: prompt is possible to obtain it with the shift key, or, in case of framebuffer enabled, tab key. Reply 5 Golam Kibria December 30, 2007 I want to know the details command step by step. Reply 6 Hareesh January 1, 2008 Great, A few more are there like apm=off, acpi=off, nodma,etc

4 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

Reply 7 Kresten Hartvig Klit January 23, 2008 Thank you for a very distinct and clear survey at the kernel parameters. I can use that! Reply 8 Mahnaz April 14, 2008 Hi thank you for the usefull docs my linux is too fast and i am beginner and need too recognize every line during system boot,how can I change the time and have enough time to see every line of system boot!!!?? Could you add this item to your helpfull site? Thank you. Regards Mahnaz Reply 9 fest3er April 26, 2008 There are two ways to re-view boot messages. First, you can you the command dmesg|less to see much of what appears on the console when linux boots. Second, you can cd /var/log and look at the contents of the files. Specifically, messages, daemon and syslog will contain more information about what the system does during boot and during operation. Reply 10 John May 1, 2008 So what is the option to stop it or at least prompt you during the loading of hardware drivers? my ubuntu 8 upgrade is hanging on the broadcom wireless driver. Debug/recovery mode shows me the hang Reply 11 cepal July 4, 2008 for disabling selinux you need to use selinux=0, the equal sign is a bit missing on your site Reply 12 Veerendra Jonnalagadda August 22, 2009 how does Linux handle new hardware that we found but not initialised like windows show New Hardware Found and also how does it handle their device ID and Vendor Ids.. at the boot time Regards Veerendra Jonnalagadda Reply 13 darkfader April 18, 2011

5 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

it depends on the filesystem whether you can run fsck while its mounted r/w. some can do it[*], the majority cant. I dont know what makes the technical difference which allows them to do it. [*]most notable veritas vxfs, and to less fun extent xfs, zfs of course. Reply 14 Brian Micek May 15, 2011 With Redhat and Fedora Linux, the initrd filesystem might pause the system boot forever waiting for a LUKs password if any encrypted LUKs devices are detected. This could include a USB memory stick accidentally plugged into the system. The symptoms of this problem are your computer will not boot unattended which might be undesirable. You can undo this behavior with the kernel command argument: rd_NO_LUKS Reply Leave a Comment Name * E-mail * Website

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title=""> Notify me of followup comments via e-mail.

Previous post: Simulation of the night sky using a graphical Linux desktop planetarium for KDE Next post: Less is more: the hidden treasure of less command Sign up for our daily email newsletter:

6 of 7

7/5/2011 10:01 AM

10 boot time parameters you should know about the Linux kernel

http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know...

Related Posts
Linux Limiting or restricting SMP CPU activation in SMP mode How to: OpenBSD reset root password Linux: How to change the text size or character size in runlevel 3 (text mode)

2004-2011 nixCraft. All rights reserved. Cannot be reproduced without written permission. Privacy Policy | Terms of Service | Questions or Comments | Copyright Info | Sitemap

7 of 7

7/5/2011 10:01 AM

You might also like