question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Potentially corrupting filesystem

See original GitHub issue

Description of the issue

I’m not certain that syncthing is the reason for my issues, but it seems likely to me, hence this report. I currently do not need further assistance in fixing.

When I reboot my phone (LineageOS 17) it seems to be checking the external SD card for corruptions right after I unlock it the first time. It says “Phone is starting” and then does any of these:

  • Finishes starting and everything works perfectly well
  • Somehow crashes and goes into a bootloop (probably not your problem)
  • Finishes starting and says “Issue with SD Card” (this notification) and does not automatically mount it.

I’ve encountered this last case three or four times in the last year and the fixes have been so far:

  • Just rebooting until the message goes away
  • Running fsck.exfat -y /dev/block/mmcblk0p1
  • If that also did not work, running chkdisk H: /F on a windows machine with the sd card mounted on H:.

Here’s why I think syncthing has to do with this:

  • I am using syncthing to sync to places on the external sdcard
  • The output of fsck.exfat said there was a .gif file in my synced folder that was empty but “marked as contiguous”
  • The output of chkdisk contained several errors that fsck did not find, stating that there was more than one entry for some of the files. They were all in the same subfolder, but only half of the files in that subfolder had this issue.

Reproduction Steps

I don’t think this is reliably reproducible.

Version Information

  • App Version: (what is this?)
  • Syncthing-Fork Wrapper Version: v1.16.0.3
  • Syncthing Version: v1.16.0
  • Android Version: Android LineageOS 17 (lineage_beryllium-userdebug 10 QQ3A.200805.001 c65720e3ac)
  • Device manufacturer: Xiaomi
  • Device model: Pocophone F1

Device platform info

[ro.product.board]: [sdm845]
[ro.product.brand]: [Xiaomi]
[ro.product.cpu.abi]: [arm64-v8a]
[ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [arm64-v8a]
[ro.product.device]: [beryllium]
[ro.product.first_api_level]: [27]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [Xiaomi]
[ro.product.model]: [POCO F1]
[ro.product.name]: [beryllium]
[ro.product.odm.brand]: [Xiaomi]
[ro.product.odm.device]: [beryllium]
[ro.product.odm.manufacturer]: [Xiaomi]
[ro.product.odm.model]: [POCO F1]
[ro.product.odm.name]: [beryllium]
[ro.product.system.brand]: [Xiaomi]
[ro.product.system.device]: [beryllium]
[ro.product.system.manufacturer]: [Xiaomi]
[ro.product.system.model]: [POCO F1]
[ro.product.system.name]: [beryllium]
[ro.product.vendor.brand]: [Xiaomi]
[ro.product.vendor.device]: [beryllium]
[ro.product.vendor.manufacturer]: [Xiaomi]
[ro.product.vendor.model]: [POCO F1]
[ro.product.vendor.name]: [beryllium]

CHKDISK output

C:\WINDOWS\system32>chkdsk H: /F
Der Typ des Dateisystems ist exFAT.
Volumeseriennummer : 6F63-1277
Dateien und Ordner werden überprüft...
Die Volumebezeichnung lautet android.
Es gibt mehr als einen Eintrag "MY DEMONS - STARSET (LYRICS).MP3" im Ordner "\Music\2017\march\".
Der Eintrag wurde nach "MY DEMONS - STARSET (LYRICS).MP3-1" umbenannt
Beim Überprüfen der Dateien im Verzeichnis "\Music\2017\march\" (78) wurde eine Beschädigung festgestellt.
Es gibt mehr als einen Eintrag "STARSET - LAST TO FALL (OFFICIAL AUDIO).MP3" im Ordner "\Music\2017\march\".
Der Eintrag wurde nach "STARSET - LAST TO FALL (OFFICIAL AUDIO)-1" umbenannt
Beim Überprüfen der Dateien im Verzeichnis "\Music\2017\march\" (84) wurde eine Beschädigung festgestellt.

(skipping some more files like this. There were also some that did not rename entries, and only “wurde eine Beschädigung festgestellt.” And there were also errors about whatever “Querverbindung” is supposed to be .

Beim Überprüfen der Volumebitmap wurde eine Beschädigung festgestellt.
Dateizuordnungen werden von Windows überprüft...
\Android\media\com.github.catfriend1.syncthingandroid\.stversions\eric_thesis_handin\Code\measurePy\env\Lib\site-packages\sklearn\preprocessing\_function_transformer.pyc ist auf Zuordnungseinheit 426689 querverbunden.
Querverbindung durch Kopieren aufgelöst
\Android\media\com.github.catfriend1.syncthingandroid\.stversions\eric_thesis_handin\Code\measurePy\env\Lib\site-packages\sklearn\preprocessing\_encoders.py ist auf Zuordnungseinheit 24455 querverbunden.
Querverbindung durch Kopieren aufgelöst
Die Datei- und Ordnerüberprüfung ist abgeschlossen.

Es wurden Korrekturen am Dateisystem vorgenommen.
Es sind keine weiteren Aktionen erforderlich.

 485265664 KB Speicherplatz auf dem Datenträger insgesamt
 379503104 KB in 83949 Dateien
    728832 KB in 5680 Indizes
         0 KB in fehlerhaften Sektoren
       640 KB vom System benutzt
 105033088 KB auf dem Datenträger verfügbar

    131072 Bytes in jeder Zuordnungseinheit
   3791138 Zuordnungseinheiten auf dem Datenträger insgesamt
    820571 Zuordnungseinheiten auf dem Datenträger verfügbar

Fin

Thanks for having a look, if you think it’s possible that syncthing is causing the filesystem checks to fail / the filesystem to become corrupted. I have no way of telling if syncthing is indeed the culprit, all I know is that all the broken files were inside a synced folder.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lucidBrotcommented, Jul 5, 2021

Okay, thanks! For future visitors, the thread is at https://forum.syncthing.net/t/potentially-corrupting-exfat-filesystem/17049

1reaction
Catfriend1commented, Jul 4, 2021

@lucidBrot Please use forum.syncthing.net instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

linux - What causes a filesystem to get corrupted? - Super User
A file system is corrupted when its internal structures are inconsistent. There are essentially two sources that can cause this: hardware ...
Read more >
Potentially Corrupting Exfat Filesystem? - Syncthing Forums
I encountered an issue with my external SD-card's filesystem being somewhat corrupted and I'm wondering if syncthing could be the culprit.
Read more >
What are the 5 most common causes of file system corruption ...
That the superblock of a file system got corrupted beyond repair. This can happen due to a bug in the filesystem or loss...
Read more >
Identifying Disk Corruption and Filesystem Errors – cPanel
The easiest way to identify potential disk or filesystem problems is to check dmesg, and /var/log/messages. You can do this by running the ......
Read more >
MDK MIDDLEWARE: Filesystem Corruption after power failure
Another reason of potential corrupted FS caused by power failure is due to NOR flash itself.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found