Raspberry Pi

Raspberry Pi: What is cmdline.txt and How to Use it

If you are a Raspberry Pi user you might have noticed that right after the first boot, the system doesn’t only have the OS files but it also includes multiple configuration files such as config.txt and cmdline.txt. In this article, we will investigate the details of the cmdline.txt file, what it is and how to use it for Raspberry Pi’s Linux kernel setting.

What is cmdline.txt and How to Use it on Raspberry Pi

cmdline.txt is present in the boot partition folder of the Raspberry Pi SD card and is known as a configuration file which is used to pass the Linux-kernel Parameters for the Raspberry Pi’s system boot.

In the Raspberry Pi system, the kernel parameters in cmdline.txt are set by Raspberry Pi OS. The cmd file has different parameters which we will investigate further. To access the cmdline.txt file in Raspberry Pi, use the below-mentioned command:

sudo nano /boot/cmdline.txt

 

After running the above command, the “cmdline.txt” file will open in the nano editor and all its parameters are editable:

What are the Parameters of cmdline.txt?

The default parameters of cmdline.txt file is:

Now let’s look into each of these one by one:

1: Console

The console is the first parameter in cmdline.txt file. The console is the information about the “display interface” of the Raspberry Pi system. The Raspberry Pi kernel starts at tty1, and the serial port is also present but usually, the user doesn’t need to change both.

2: Root

Each Partition in Linux-based systems has a unique partition ID (PARTUUID) and the partition ID for Raspberry Pi operating system is present in the root parameter.

3: rootfstype

The partition format for the Raspberry Pi file system is present in rootfstype parameter. Although the Raspberry Pi supports both NTFS and ext4 formats, but it is recommended to use the ext4 format for Raspberry Pi partitions as ext4 is more compatible with Linux-based systems.

4: rootwait

The rootwait parameter in the cmdline.txt file is used to inform the Linux kernel to wait for the Raspberry Pi system partition to become accessible because unlike other systems, Raspberry Pi does not have internal storage and the system takes time to access data from the SD card.

5: splash

The splash parameter in the cmdline.txt is to display the splash screen on boot. If a user does not want a splash screen, they can remove the splash parameter from cmdline.txt file and will see a black screen at the boot instead of the splash screen.

6: plymouth.ignore-serial-consoles

The plymouth parameter acts as a display manager during the boot process of the Raspberry Pi system. This parameter ensures that plymouth doesn’t display anything on the serial consoles while the system is on boot.

Final Words

cmdline.txt file is used to pass the Linux kernel parameter for the system’s boot. In Raspberry Pi, the user uses the cmdline.txt file to configure the system’s kernel parameter for the first boot and to specify the partition format, serial display, and others. Each of the parameters of cmdline.txt file is discussed in detail in the above-mentioned guidelines.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.