Skip to main content

3 Ways to Edit the boot/config.txt File on Raspberry Pi

The post 3 Ways to Edit the boot/config.txt File on Raspberry Pi appeared first on BardTech.

edit-config-raspi

You’re in the middle of a Raspberry Pi project, when all of a sudden you realize there’s something wrong: fixing it means editing the config.txt file, which is found in the /boot/ directory.

But what is the easiest way to access this file while the Raspberry Pi is still running? And if you have to shut down to retrieve the microSD card, how should you edit it? Here’s everything you need to know.

Why You Need config.txt on Raspberry Pi

Edit config.txt on the Raspberry Pi

The Raspberry Pi’s default operating system (and most of the alternatives ) rely on some configuration parameters that are read when the computer boots from the microSD card. These are stored in the config.txt document, found in the /boot/ folder.

Such instructions might adjust the way the display is detected and the desktop displayed; config.txt can even be used to overclock your Raspberry Pi (or return to default clock settings).

Both of these settings are logged in config.txt as neither can be changed on a running Raspberry Pi. If the display isn’t detected, you cannot alter any desktop settings.

Similarly, if the Pi has been overclocked and won’t boot, or repeatedly restarts, you won’t be able to access raspi-config to reset it. Instead, config.txt is provided to give you the option of resetting your Raspberry Pi’s clock speed.

It’s also possible to alter the USB boot mode from within config.txt, just as it is to tweak audio settings.

1. Access config.txt From Within Raspbian

If you need to edit the config.txt file while Raspbian is running, you should be able to browse to it. You’ll find the /boot/ folder in the root directory of the microSD card. Once you’ve found it, simply double click to open, and edit it in your default text editor.

However, if you’re planning to edit the file, it’s a good idea to retain the original. Make a copy of the file using your file manager, giving it a different, but descriptive name. Once you’ve done this, you’ll easily be able to restore the original should run into trouble with the edited version.

You can also create a copy in the terminal using

mv config.txt backupconfig.txt

Again, give your copy a meaningful name. Note that when editing the config.txt file, no changes will be applied until you reboot your Raspberry Pi.

2. Edit config.txt Remotely

Rarely connect a keyboard to your Raspberry Pi? As long as the computer is on the network, you should be able to edit the config.txt file remotely. Do this by connecting via SSH (or VNC or RDP) and browsing to the /boot/ directory. You’ll need to use the

cd /

command to step up a level from the default /home/ directory in Raspbian. Here, use

ls

to list the contents of the root directory. Find /boot/ then

cd /boot

open it, again listing the contents. Here, you should find config.txt. To read or edit the text file, use the nano text editor, which comes preinstalled (although others are available ).

sudo nano config.txt

Once the changes have been made, press Ctrl + X to save and exit. Remember to reboot your Raspberry Pi after making changes.

sudo reboot

3. Edit config.txt on Your PC

Linux, Windows, and macOS computers should be able to access the config.txt file via the microSD card. This means shutting down your Raspberry Pi (safely, in order to avoid data corruption) and ejecting the SD card. Insert it into your computer’s card reader to check the contents.

Edit config.txt on Linux PC

If you need to edit the config.txt file on a Linux PC, find the disk listed in your default file manager when inserted. It should be listed as two devices, the main volume (typically “1.8GB Volume” as per the size of the default Raspbian partition), and boot.

Edit Raspbian's config.txt file on a Linux PC

As you might have guessed, this is the volume you need to access. It is essentially the /boot/ directory mounted as a drive. Open this to find config.txt. Save any changes you make in your default text editor, then use the Eject button in the file manager to safely eject the SD card.

Edit config.txt on Windows 10

Inserting the Raspberry Pi’s SD card on a Windows computer should result in it being instantly mounted, and accessible via Windows Explorer. However, while two partitions will be displayed on the device, only one, boot, will be accessible in Windows.

Select this, then find config.txt. Use the default Notepad text editor to make edits (or an alternative, such as Notepad++), then save and exit when you’re done.

To safely eject the SD card, right-click the drive in My Computer, and select Eject.

Edit config.txt on macOS

If you’re using a Mac, you should find the card appears on your desktop when it is detected. Use the Finder to browse the contents, looking for a file called config (without the TXT file extension). Read and edit the file in the TextEdit app, ensuring that any changes you make are saved when you exit. To eject the card, drag the desktop icon to the Trash, or click Eject in Finder.

Whichever method you use to edit the config.txt from the microSD card read on your PC, remember to safely eject the device before returning it to your Raspberry Pi.

Tweaking Your Raspberry Pi Even Further

The config.txt file is just one of several ways to edit your Raspberry Pi’s general configuration. You’re probably already aware of the raspi-config screen, accessed via the terminal. There’s even a desktop-based Raspberry Pi Configuration Tool, found in the Preferences menu on Raspbian Jessie and Raspbian Stretch.

Tweaking the Pi’s configuration can save a lot of time if you get it right. To help ensure the computer is set up as you intend, why not take a look at the PiBakery ? This is a software tool that uses a block-based approach to help you preconfigure various Raspberry Pi settings in Raspbian, from the Wi-Fi SSID and password to running custom scripts.

Read the full article: 3 Ways to Edit the boot/config.txt File on Raspberry Pi

Original Content By MakeUseOf

The post 3 Ways to Edit the boot/config.txt File on Raspberry Pi appeared first on BardTech.



Tags: DIY, Linux, Raspberry Pi, Raspbian, config, raspberry

Original link: here
via BardTech

Comments

Popular posts from this blog

How to change the PIM of a VeraCrypt volume

The developers of VeraCrypt introduced Personal Iterations Multiplier (PIM) functionality in the encryption program in version 1.12 . PIM stands for "Personal Iterations Multiplier". It is a parameter that was introduced in VeraCrypt 1.12 and whose value controls the number of iterations used by the header key derivation function. PIM is used by volumes even if the creator of the volume did not specify a value. It is an optional component that improves security: it adds another step to the authentication process similarly to two-factor authentication. The main difference is that the PIM value is fixed and not generated on the fly when requested. An attacker needs to know the master password and the PIM, if not set to default, to breach the encryption successfully and access the content of the drive or partition. A couple of good reasons exist to change the PIM value: It was leaked or stolen. The default value is used and that is not as secure as using a custom PIM. Yo...

Huawei Mate 20 Pro launched in India with Kirin 980 for ₹69,990 ($988)

For years, the highest-end Android flagship used to be defined by Samsung’s Galaxy Note series as the “best-of-the-best” Android phones. Google entered the premium smartphone segment in 2016 with the Google Pixel . In addition, one company that has been steadily improving its flagship phones is Huawei. Huawei has also been steadily increasing the prices of its flagship phones at the same rate. Indian consumers, however, were left out as Huawei had not opted to launch any Mate series phone in India before. This year, as the company’s strategy has changed, high-end flagship smartphone buyers now have another option to choose from. The Huawei P20 Pro was launched in India in April . Now, Huawei has launched the Huawei Mate 20 Pro in India—the first ever launch of a Mate series phone in the country. The Huawei Mate 20 Pro is the successor of the Huawei Mate 10 Pro . It’s positioned as a higher-end variant of the standard Huawei Mate 20. It should be noted that Huawei didn’t launch the s...

The 5 Best Free IPTV Apps to Watch Live TV on Android

It’s easier than ever to watch on-demand TV shows and movies on your Android device. But what about live TV? Yes, there are services like Sling and PlayStation Vue. However, if you know where to look, you don’t need to subscribe to their expensive plans. You can use free IPTV instead; you just need an IPTV app and an IPTV source. What Is an IPTV App? IPTV apps are a bit like Kodi; they are empty shells that can’t stream any content without some user input. You have the responsibility for adding channels, playlists, and other sources. Typically, you cannot use the apps to watch Netflix, Hulu, or direct content from other third-party providers. Here, we’re not interested in the best on-demand streaming apps or places to watch TV online. We are only looking at the IPTV apps themselves. Specifically, we want to know what the best IPTV apps on Android are. 1. Lazy IPTV Our first pick is Lazy IPTV. It supports M3U playlists in open-view, ZIP, and GZ formats. The app can also read pl...