Difference between revisions of "R-Pi configuration file"

From eLinux.org
Jump to: navigation, search
(Modification to reflect the fact that config.txt may not be editable from Windows)
(Edited Windows instructions in case the /boot partition is not mounted)
Line 6: Line 6:
  
 
While booting up, the Raspberry Pi reads some configuration parameters from the SD card.
 
While booting up, the Raspberry Pi reads some configuration parameters from the SD card.
These parameters are stored in a file named [[RPiconfig|config.txt]] and located in the /boot partition at /boot/config.txt. You can edit this configuration file from a Mac, from a Linux PC, or from within the Raspberry Pi itself. Depending on the partitioning scheme of your SD card, this file may not be visible to Windows PCs. In this case, you will need use another operating system to edit the configuration file.
+
These parameters are stored in a file named [[RPiconfig|config.txt]] and located in the /boot partition at /boot/config.txt. You can edit this configuration file from a Mac, from a Linux PC, or from within the Raspberry Pi itself. Depending on the partitioning scheme of your SD card, the /boot partition may not be visible to Windows PCs. In this case, you will need use either a Mac, a Linux PC or the Raspberry Pi to edit the configuration file.
  
 
This configuration file contains instructions which are necessary to setup the display.
 
This configuration file contains instructions which are necessary to setup the display.
Line 12: Line 12:
 
you can edit the configuration file. If the display is working but you wish to make minor adjustments,
 
you can edit the configuration file. If the display is working but you wish to make minor adjustments,
 
you may find it more convenient to edit the file from within the Raspberry Pi itself.
 
you may find it more convenient to edit the file from within the Raspberry Pi itself.
 
=How to edit from a Windows PC=
 
This method is most useful if you cannot see anything on the display of the Raspberry Pi.
 
 
*Shut down your Raspberry Pi, remove the power and remove the SD card.
 
 
*Put the SD card in your PC's card reader and wait for the folder to open automatically.
 
 
*If the folder does not open automatically, open "My Computer" and then open the drive marked "SD".
 
 
*Look to see if there is a file called config (or possibly config.txt).
 
 
*If this file exists, open it with Notepad. If not, create the file with Notepad. Note: Do not use the Wordpad editor or Microsoft Word to edit the file.
 
(One way to do this, in XP, is to right-click where you see the other files, select New and then Text document.
 
Then change "New Text Document" to "config").
 
 
*Open config.txt using Notepad, and add the necessary configuration parameters.
 
 
*Save the file (menu item File, Save)
 
 
*Exit Notepad
 
 
*In Windows Explorer, go to "My Computer". Right-click on the SD card and select "Safely Remove".
 
 
*Remove the SD card from the PC and insert it in the Raspberry Pi.
 
  
 
=How to edit from OSX=
 
=How to edit from OSX=
Line 70: Line 45:
  
 
'''NOTE:''' You may find that your changes to config.txt disappear after a reboot. This is a very rare problem and seems to depend on the type of SD card. In this case, use a Windows/Linux/OSX PC to edit the file, see instructions above.
 
'''NOTE:''' You may find that your changes to config.txt disappear after a reboot. This is a very rare problem and seems to depend on the type of SD card. In this case, use a Windows/Linux/OSX PC to edit the file, see instructions above.
 +
 +
=How to edit from a Windows PC=
 +
This method is most useful if you cannot see anything on the display of the Raspberry Pi.
 +
Note: Depending on the partitioning scheme of your SD card, you may not be able to edit the configuration file using Windows.
 +
 +
*Shut down your Raspberry Pi, remove the power and remove the SD card.
 +
 +
*Put the SD card in your PC's card reader and wait for the folder to open automatically.
 +
 +
*If the folder does not open automatically, open "My Computer" and then open the drive marked "SD".
 +
 +
*Look to see if there is a file called config (or possibly config.txt).
 +
 +
*If this file exists, open it with Notepad. If not, create the file with Notepad (One way to do this, in XP or Windows 7, is to right-click where you see the other files, select New and then Text document. Then change "New Text Document" to "config"). Note: Do not use the Wordpad editor or Microsoft Word to edit the file. If you are creating the file, make sure you create it in the /boot partition (approximate size 56 MB). Depending on the partition scheme of your SD card, you may not be able to access the /boot partition using Windows. If you create the file in a partition other than the /boot one, it will not be taken into account by Raspberry Pi.
 +
 +
*Change the necessary configuration parameters.
 +
 +
*Save the file (menu item File, Save)
 +
 +
*Exit Notepad
 +
 +
*In Windows Explorer, go to "My Computer". Right-click on the SD card and select "Safely Remove".
 +
 +
*Remove the SD card from the PC and insert it in the Raspberry Pi.
  
 
=An example configuration file=
 
=An example configuration file=

Revision as of 21:33, 23 November 2013


How to edit the boot configuration file for Raspberry Pi

A quick overview

While booting up, the Raspberry Pi reads some configuration parameters from the SD card. These parameters are stored in a file named config.txt and located in the /boot partition at /boot/config.txt. You can edit this configuration file from a Mac, from a Linux PC, or from within the Raspberry Pi itself. Depending on the partitioning scheme of your SD card, the /boot partition may not be visible to Windows PCs. In this case, you will need use either a Mac, a Linux PC or the Raspberry Pi to edit the configuration file.

This configuration file contains instructions which are necessary to setup the display. If you have severe problems with the display, you will need to connect the SD card to a PC so that you can edit the configuration file. If the display is working but you wish to make minor adjustments, you may find it more convenient to edit the file from within the Raspberry Pi itself.

How to edit from OSX

This method is most useful if you cannot see anything on the display of the Raspberry Pi.

  • Shut down your Raspberry Pi, remove the power and remove the SD card.
  • Put the SD card in your Mac's card reader and wait for the card to appear on the Desktop.
  • Open the card in Finder.
  • Look to see if there is a file called config (or possibly config.txt).
  • If this file exists, open it with TextEdit. If not, create a new file in Textedit as Plain Text format.
  • Add the necessary configuration parameters.
  • Save the file as "config" and quit TextEdit.
  • In Finder eject the SD card by dragging it to the Trash or clicking the eject button in the Finder window.
  • Remove the SD card from the PC and insert it in the Raspberry Pi.

How to edit from the Raspberry Pi

This method is most useful if you can see the display of the Raspberry Pi and you wish to make minor adjustments.

  • Reboot the Raspberry Pi and enter your username and password.
  • To edit the configuration file, enter the command
sudo nano /boot/config.txt
  • Type in the necessary configuration parameters
  • Save the edited file
Press Control-x
Press y
Press [enter]
  • After exiting the editor, restart using the command
sudo reboot

NOTE: You may find that your changes to config.txt disappear after a reboot. This is a very rare problem and seems to depend on the type of SD card. In this case, use a Windows/Linux/OSX PC to edit the file, see instructions above.

How to edit from a Windows PC

This method is most useful if you cannot see anything on the display of the Raspberry Pi. Note: Depending on the partitioning scheme of your SD card, you may not be able to edit the configuration file using Windows.

  • Shut down your Raspberry Pi, remove the power and remove the SD card.
  • Put the SD card in your PC's card reader and wait for the folder to open automatically.
  • If the folder does not open automatically, open "My Computer" and then open the drive marked "SD".
  • Look to see if there is a file called config (or possibly config.txt).
  • If this file exists, open it with Notepad. If not, create the file with Notepad (One way to do this, in XP or Windows 7, is to right-click where you see the other files, select New and then Text document. Then change "New Text Document" to "config"). Note: Do not use the Wordpad editor or Microsoft Word to edit the file. If you are creating the file, make sure you create it in the /boot partition (approximate size 56 MB). Depending on the partition scheme of your SD card, you may not be able to access the /boot partition using Windows. If you create the file in a partition other than the /boot one, it will not be taken into account by Raspberry Pi.
  • Change the necessary configuration parameters.
  • Save the file (menu item File, Save)
  • Exit Notepad
  • In Windows Explorer, go to "My Computer". Right-click on the SD card and select "Safely Remove".
  • Remove the SD card from the PC and insert it in the Raspberry Pi.

An example configuration file

This example show how to reduce the size of the display to prevent text spilling off the edge of the screen.


overscan_left=20

overscan_right=20

overscan_top=20

overscan_bottom=20

What configuration options are available?

For a list of all the configuration options available, click here

References