User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

config.txt gets corrupted

Wed Jul 04, 2012 7:33 am

I have found that if I put too much stuff and comments in my config.txt file that When I reboot I end up with gobble-dee-gook at the end of the file and my setting not being read. Is anyone else having this problem? is there a finite word limit?
echo "Something Useful" > /dev/null

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: config.txt gets corrupted

Wed Jul 04, 2012 7:36 am

how much stuff ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Re: config.txt gets corrupted

Wed Jul 04, 2012 7:43 am

I have since changed it, but this is about what it looked like give or take a tine of text.

Code: Select all

#VIDEO MODE SECTION THIS MIGHT NOT BE NEEDED
#hdmi_group=0   CEA
#hdmi_group=1   DMT
hdmi_group=1
hdmi_mode=4

#OVERCLOCKING SECTION
#THIS IS STABLE FOR ME
# stock is 700
arm_freq=800

#stock is 400
sdram_freq=500

#stock is 250
gpu_freq=300

# I prolly don't need this here but it is an option
#this if if you want a stock screen
#disable_overscan=1

#TV MODES
#sdtv_mode=0    Normal NTSC
#sdtv_mode=1    Japanese version of NTSC – no pedestal
#sdtv_mode=2    Normal PAL
#sdtv_mode=3    Brazilian version of PAL – 525/60 rather than 625/50, different subcarrier
sdtv_mode=2 


# Make display smaller to stop text spilling off the screen
overscan_left=12
overscan_right=6
overscan_bottom=0
overscan_top=0
echo "Something Useful" > /dev/null

User avatar
jojopi
Posts: 3271
Joined: Tue Oct 11, 2011 8:38 pm

Re: config.txt gets corrupted

Wed Jul 04, 2012 7:57 am

Super-Nathan wrote:I have found that if I put too much stuff and comments in my config.txt file that When I reboot I end up with gobble-dee-gook at the end of the file and my setting not being read. Is anyone else having this problem? is there a finite word limit?
Are you rebooting cleanly ("sudo shutdown -r now" or "sudo reboot") or uncleanly (cycle power, "sudo reboot -f" or -n)?

Is the junk at the end of the file after all the stuff you typed in, or instead of some of it?

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: config.txt gets corrupted

Wed Jul 04, 2012 8:07 am

You're running the wheezy beta I assume? Did you update the firmware at all? What SD card are you using? I was actually able to reproduce this issue in the wheezy alpha, but not after the kernel was rebuilt with https://github.com/raspberrypi/linux/co ... a2faa59cf8

User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Re: config.txt gets corrupted

Wed Jul 04, 2012 8:16 am

I am running Arch, updated daily, with a rpi-update 2-3 days ago.

I have been known to do both power-cycle shutdowns and clean shutdowns (I have the Raspi connected to a relay controlled outlet in my home that is switched by an Arduino connected to my server, so I can cycle power while I am at work via ssh)

The Gobble-dee-gook is at the end AND instead of the last 1/4 of the text.
echo "Something Useful" > /dev/null

User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Re: config.txt gets corrupted

Wed Jul 04, 2012 8:37 am

This has happened so far 4 times, at different stages in updates

My SD Card is a Samsung 32 GB class 10
echo "Something Useful" > /dev/null

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: config.txt gets corrupted

Wed Jul 04, 2012 11:36 am

After editing anything on the /boot partition, you MUST reboot cleanly to force the filesystem to be synced.

Reboot using this command
sudo reboot

Also, remember to press Enter after the last line of the file, don't leave the last line unterminated.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: config.txt gets corrupted

Wed Jul 04, 2012 12:55 pm

bredman wrote:After editing anything on the /boot partition, you MUST reboot cleanly to force the filesystem to be synced.
Or you could type: sync
(usual recommendation is to do "sync" three times, but that's probably just superstition)

Or (maybe, because I don't have a Pi available to test), you could do: umount /boot
bredman wrote: Reboot using this command
sudo reboot
Or "init 0". By the way, is it actually true that something like "reboot -f" will reboot it without flushing the buffers. That seems odd to me.
bredman wrote: Also, remember to press Enter after the last line of the file, don't leave the last line unterminated.
And don't edit the file on a Windows box. This has already been shown to be a problem...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
jojopi
Posts: 3271
Joined: Tue Oct 11, 2011 8:38 pm

Re: config.txt gets corrupted

Wed Jul 04, 2012 3:12 pm

Joe Schmoe wrote:By the way, is it actually true that something like "reboot -f" will reboot it without flushing the buffers. That seems odd to me.
"reboot -f" does sync, but "reboot -fn" does not. Plain "reboot", which triggers an orderly shutdown and umounts, is still much preferred.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: config.txt gets corrupted

Wed Jul 04, 2012 3:14 pm

Plus the wheezy beta image onwards mount /boot with sync which should make it hard to corrupt the filesystem unless you actually turn the device off while performing a write operation.

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: config.txt gets corrupted

Wed Jul 04, 2012 8:27 pm

asb wrote:Plus the wheezy beta image onwards mount /boot with sync which should make it hard to corrupt the filesystem unless you actually turn the device off while performing a write operation.
Hi

I managed to corrupt my config.txt file whilst trying to sort out the overscan. I used sudo shutdown -r now to restart after each edit. On one reboot looking at the end of the file I had lost the last five lines which had been replaced with one line of random characters containing things like ^B^B^N

This was on 1st July at around 12 noon. I had previously done a rpi-update at around 11am. This was all using the wheezy image.

Cheers

Paul
Procrastination - The Thief of Time.

Return to “Troubleshooting”