3 ways to edit file boot / config.txt on Raspberry Pi
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.
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:
- 11 Raspberry Pi acceleration tricks
- How to transform Raspberry Pi into SNES Classic
- Create your own wireless printer with Raspberry Pi
You should read it
- What is the Raspberry Pi and how is the Raspberry Pi used?
- How to start Raspberry Pi 3 from USB
- How to set up Wi-Fi and Bluetooth on Raspberry Pi 3
- Why should people try Raspberry Pi 4?
- 10 operating systems you can run with Raspberry Pi
- Learn Pi Imager, How to Use Raspberry Pi Imager
- Create your own wireless printer with Raspberry Pi
- How to use Raspberry Pi Imager to install Raspberry Pi OS
May be interested
- How does the Raspberry Pi file system work?where are your files? why are there so many folders and subfolders? the goal of today's article is to give you an overview of the file system on your raspberry pi (as well as on any linux device).
- 5 ways to make good use of Raspberry Pi 4the latest raspberry pi 4 has the strongest hardware version, opening up completely new categories of what you can do with the application.
- 2 ways to fix the error can not boot into Windows2 ways to help you fix the error that cannot boot to win effectively. computer boot up error due to corrupt winload.exe file, please refer to the following article
- 6 ideas to utilize old Raspberry Piif you have an old raspberry pi 3b or even the original model b lying around in a drawer, get it out, because there are plenty of ways you can put an old raspberry pi to good use.
- How to add an ADC to Raspberry Pi: What you need to knowraspberry pi lacks analog input. this puts it at a disadvantage compared to microcontroller-based boards like the arduino.
- TOP 5 ISO file editing software on Windows 10/11this guide includes some unique third-party tools that you can use to mount and edit iso files easily.
- Raspberry Pi Zero vs Model A and B, how are they different?you want to buy a raspberry pi, but when you search, you have a problem: why are there so many raspberry pi models? although all of the different raspberry pi can do many similar tasks, there are tasks that specific boards will be more suitable for.
- 5 ways to copy data from Raspberry Pi to PCwhatever purpose you use raspberry pi for, at some point, you will want an easy way to get data out of pi's sd card and insert it into your pc's hard drive.
- What is the Raspberry Pi and how is the Raspberry Pi used?you can use the raspberry pi as a computer because everything needed has been built in. its broadcom bcm2835 soc processor includes cpu, gpu, ram, microsd card slot, wi-fi, bluetooth and 4 usb 2.0 ports.
- How to start Raspberry Pi 3 from USBraspberry pi is a great, versatile software suite, with a variety of capabilities like running a media center or using as a radio.