prime_jp Posted November 27, 2016 Posted November 27, 2016 Hi. The following happened. When power is suddenly cut off in emmc, the file contents created by fopen (), fprintf (), fflush() and fclose () are not saved after rebooting. It seems that it has not been physically written out while being cached. If display the file before cutting off the power, the contents are correctly saved. In addition, if it is normally reboot it is saved correctly.
martinayotte Posted November 27, 2016 Posted November 27, 2016 This can occurs on any Linux or even on other OS where files a cached and written to disk in background after a certain amount of time. If you wish to ensure that files are not cache any more, the "sync" command will force the caching to be written on disk. Power failure will always produce such behaviour, even on PC or Mac.
prime_jp Posted November 28, 2016 Author Posted November 28, 2016 martinayotte, Thank you very much. When sync () is described after fclose (), it can operate normally.Since raspbian was able to operate without problems, I thought whether it was a problem on the system.It seemed that there was no problem with raspbian, it happened by chance.
Vladyslav Vladyslav Posted April 5, 2018 Posted April 5, 2018 (edited) Hey, Guys, I m having the same problem here, for example i have done git clone command to get the rep cloned, after that i did reboot and all files were gone, I have also had pi pc plus, any ideas ? thx P.S Sync doesn t help. Edited April 5, 2018 by Vladyslav Vladyslav
Igor Posted April 6, 2018 Posted April 6, 2018 9 hours ago, Vladyslav Vladyslav said: any ideas Failed SD card?
burak Posted April 20, 2018 Posted April 20, 2018 It might be that your armbian starts on "virtual read-only" mode. Check that first please. Normally, it should be printed on the screen when you boot your board. In that case all changes are gone after a reboot. You need to run `armbian-config` and disable virtual read-only mode.
Recommended Posts