3 ways to edit file boot / config.txt on Raspberry Pi

What is the fastest way to access the file config.txt in the / boot directory / when Raspberry is still running? If you have to turn off to get back the microSD card, how will it be edited?

When you are working on any project and you find a bug, you will have to fix it by editing the file config.txt in the / boot / directory .What is the fastest way to access this file when Raspberry is still running?If you have to turn off to get back the microSD card, how will it be edited?

Why should config.txt be used on Raspberry Pi?

The default OS of Raspberry Pi (and many other OSs running on Pi) depends on some parameters (and will be read) when the computer boots from the microSD card.They are saved on the file config.txt, located in the / boot / directory .

Changes on this file can change the way the screen is displayed and displayed, and you can even use config.txt to overclock the Raspberry Pi (or set the default clock rate).

Both settings on the above config.txt cannot be performed while running Raspberry Pi.If the machine cannot determine the display, you cannot change any settings.

Similarly, if Pi is overclocked or unable to boot or restart constantly, you cannot access raspi-config to reset. Instead, the config.txt file will help you to change the clock speed of Raspberry Pi. In addition, you can change USB boot mode from config.txt.

Access config.txt from Raspbian

If you need to edit config.txt while running Raspbian, you must open them. Find the / boot directory in the root directory of the microSD card, then find the file and double click to open it, edit it on the editor.

Retaining the original is also essential.Copy the file, then put another name to differentiate it, then edit and reuse the original if the revision fails.Copying can be done with the following command in the terminal.

 mv config.txt backupconfig.txt 

Note that when editing the config.txt file, the change will not be applied if you have not restarted the Raspberry Pi.

Edit remote config.txt

You rarely connect the keyboard to the Raspberry Pi?As long as the computer has a network, it is possible to edit this config.txt file remotely.Connect via SSH (or VNC, or RDP) and open the / boot directory .You will have to use the command:

 cd / 

to go to the wider directory of the / home / default folder on Raspbian.Then use the command:

 ls 

to list the root directory list.Then find / boot / and use the command:

 cd /boot 

to reopen, then list the content again.Here you will see the file config.txt.To read or edit, use the built-in nano text editing tool (alternative tools can be used).

 sudo nano config.txt 

When done, change Ctrl + O to save and Ctrl + X to exit.Remember to restart the computer.

 sudo reboot 

Edit config.txt on PC

Linux, Windows and macOS can all access config.txt via microSD card.You will need to turn off the Raspberry Pi (to avoid data corruption), remove the card and plug in the computer card reader to check the content.

Edit config.txt on Linux

If you need to edit the file config.txt on Linux, find the drive in the default file manager after inserting the card.It will consist of 2 devices which are the main part (usually 1.8GB, equal to the size of a default Raspbian partition) and boot.

3 ways to edit file boot / config.txt on Raspberry Pi Picture 13 ways to edit file boot / config.txt on Raspberry Pi Picture 1
The file config.txt in the boot directory

The / boot / directory itself will be where the drive is located. Open it, you will see the file config.txt to find. Save changes on the default editor and use the Eject button in the file manager to remove the SD card from the device.

Edit config.txt on Windows 10

After plugging Raspberry SD card into Windows, you can open it right in Windows Explorer.However, there will be 2 fragments displayed on the device and only one of them, namely boot, is Windows accessible.

Select it, then find config.txt.Use Notepad to edit (or Notepad ++), then save and exit. Remember to right click on this drive on My Computer and select Eject before removing the card.

Edit config.txt on macOS

If you use a Mac, you will see the card appear on the desktop as soon as the machine recognizes it.Use Finder to find the file named config (no TXT extension). Then edit with TextEdit, save and exit. To remove a card, drag the icon on the desktop to Trash or select Eject in the Finder.

Whichever way to edit the file config.txt from the microSD card read on the PC, remember to pull the card in the correct way before returning it to the Raspberry Pi.

Edit more

The config.txt file is just one of many ways to change the configuration for Raspberry Pi.Maybe you know raspi-config, access via terminal.There is also a Raspberry Pi Configuration Tool in the Raspbian Jessie and Raspbian Stretch Preferences folder.

See more:

  1. 11 Raspberry Pi acceleration tricks
  2. How to transform Raspberry Pi into SNES Classic
  3. Create your own wireless printer with Raspberry Pi
4 ★ | 54 Vote