Raspi resets itself when rebooted, loses all modifications
When I reboot my raspberry pi (Raspbian) all files + directories that I create, modify or delete; are reset back to how they were (if they existed).
I discovered this when I wanted to remove a program from crontab. When I rebooted the pi, the program still ran, and crontab wasn't as I had last saved it. Crontab had reverted back to it's previous state. If I create a file, ~/foo.txt, it'll be gone when I reboot the pi. If I modify an existing file, it'll revert back once the pi reboots. I can create, modify and run bash scripts, but they go when I reboot. The last modification date on the files in ~/ are back in July and I can't remember what I may have done that long ago. I don't see any unusual commands in ~/.bash_history (also reverts when the pi reboots) The pi is running as a simple headless server. Thanks for any help. |
would be nice to describe what did you install exactly and how. Did you make any special configuration?
|
Hi.
uname -a returns Quote:
Quote:
My other pis don't exhibit this 'feature'. I can't see anything in history that's been installed, or modified that would've caused the problem. |
Try to inspect any process and cron tabs? ps might yield some strange processes there. Can you 'touch' a few files and see what happens after rebooting?
|
If I create a file, it will be gone after reboot.
If I modify a file, it will revert to it's previous state after reboot. If I delete a file, it will return after reboot. My problem is that I don't know what processes might be causing this issue. I suspect that it's either something in the shut down process, or the boot up process, but am not well-versed in those processes. thanks. |
Quote:
what is in /etc/fstab? |
/etc/fstab
Quote:
|
what I can imagine is: the card is readonly and you modified only a virtual filesystem, not the original one on the card.
But there can be other reasons. Probably you can find related info in /var/log (after boot). |
OK.
I double, double-checked the SD card write-protect switch, and it is definitely not write-protected. Here's the output of ls -alt /var/log | head -n 20 Quote:
Thanks |
Are you sure you're not writing to a tmp directory (ie /tmp, /var/tmp)? Can you post output of mount?
|
Certainly,
Quote:
|
I would check messages, syslog, probably kern.log and daemon.log and bootlog too (and dmesg).
Once upon a time I had a reader wich "automagically" pushed the switch on the card to readonly every time I inserted a card into it. So I probably I would try another reader to check the card itself. |
Ok, now we're hitting the limits of my Linux knowledge.
What am I looking for in these logs? |
I have no idea, but error messages: lines containing the words error, failed, cannot or similar. If you are in doubt probably you can post them.
|
I noticed that / is pointed at /dev/root. I'm quite curious to know if /dev/root (which must be a symlink) actually points to the intended root device.
Code:
ls -l /dev/root |
All times are GMT -5. The time now is 07:48 AM. |