RDS
Posts: 736
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

config.txt file

Fri Mar 03, 2017 9:51 am

I need to change a setting in the config.txt file within /boot but I get the following error message

Code: Select all

Can't open file to write
I have have overcome this in the past by copying the file using the Terminal window.
That seemed a very long way round.
Is there an easier way of getting permission?

User avatar
hansotten
Posts: 324
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: config.txt file

Fri Mar 03, 2017 9:58 am

You have no permsission as user pi to write to system files, for obvious reasons, to prevent accidental damage to the system.

To get access you can elevate your level so admin level with the sudo command temporarely

sudo nano /boot/config.txt
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

runboy93
Posts: 352
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: config.txt file

Fri Mar 03, 2017 10:00 am

Most important thing on linux world, sudo! Remember it always.

User avatar
DougieLawson
Posts: 36524
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: config.txt file

Fri Mar 03, 2017 12:07 pm

runboy93 wrote:Most important thing on linux world, sudo! Remember it always.
Use it sparingly.

Too many folks find sudo and run everything with root privileges. When you've run sudo rm -rf / just once you soon learn why sudo should be used sparingly.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

fred44nl
Posts: 292
Joined: Sat Jun 25, 2016 11:59 am
Location: Scharendijke, NL

Re: config.txt file

Fri Mar 03, 2017 12:21 pm

DougieLawson wrote:When you've run sudo rm -rf / just once you soon learn why sudo should be used sparingly.
sounds like "Format C: " :shock:
headless RPi 3B running from usbhdd.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12400
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: config.txt file

Fri Mar 03, 2017 12:24 pm

fred44nl wrote:
DougieLawson wrote:When you've run sudo rm -rf / just once you soon learn why sudo should be used sparingly.
sounds like "Format C: " :shock:
Yeah, it means remove recursively. It deletes every file on your system.

RDS
Posts: 736
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: config.txt file

Fri Mar 03, 2017 2:05 pm

@hansotten
Thank you

and thanks to all for the warnings.
(I just wanted to change the set up so that it always starts in HDMI mode. I have done this on all my Pi's (4 off total to make headless running better)

W. H. Heydt
Posts: 11063
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: config.txt file

Fri Mar 03, 2017 2:47 pm

mahjongg wrote:
fred44nl wrote:
DougieLawson wrote:When you've run sudo rm -rf / just once you soon learn why sudo should be used sparingly.
sounds like "Format C: " :shock:
Yeah, it means remove recursively. It deletes every file on your system.
On a clear disk, you can seek forever.

User avatar
TracyLBaker
Posts: 39
Joined: Sat Feb 18, 2017 3:44 pm
Location: Phoenix, AZ

Re: config.txt file

Fri Mar 03, 2017 8:51 pm

mahjongg wrote:
fred44nl wrote:
DougieLawson wrote:When you've run sudo rm -rf / just once you soon learn why sudo should be used sparingly.
sounds like "Format C: " :shock:
Yeah, it means remove recursively. It deletes every file on your system.
rm -rf / means remove recursively (the r part) and forcefully (the f part) -- it all means remove all directories, beginning at the root of the file system (the / part) and don't ask "are you sure?"

The / refers to the root of the file system -- sorta like C: in Windows.
Red Hat Academy Professor - Estrella Mountain Community College
5 Pi 3 Model B+s: 1 headless media/NFS/SMB server - Raspbian Jessie, 1 Kali Linux w/fruitywifi, 1 headless CentOS 7 webserver (Apache, SELinux, firewalld, autofs, etc...), 2 in waiting

Return to “Beginners”