No space left on device. Too many files in collection.media?

1,686 views
Skip to first unread message

igor...@gmail.com

unread,
Sep 25, 2013, 4:41:25 PM9/25/13
to anki-a...@googlegroups.com
Since couple days ago I am having trouble syncing my collection to my phone. It gives me java.io.IOException:open failed. ENOSPC (No space left on device).
My collection is stored on external SD card. My phone is Samsung Galaxy S4.
There are 18339 files in collection.media directory. 139.75Mb. There are plenty of space on my SD card available (about 40 Gb still available on 64 Gb card). So it cannot be space. Perhaps, the file system has a limitation on the number of files in a single directory?
My other Android installation on Samsung Note Tablet has no such problems (but internal storage is used there that is a different file system type).

I tried disabling syncing media in Anki and sync worked fine.
I tried rsyncing collection.media from my computer to the phone manually with an rsync client instead of Anki and it also gives me  "No space left on device" message. So it is probably not Anki's problem but some kind of file system limitation on the number of files in a directory or something like that. If so, splitting media collection into several directories would help (perhaps by introducing profiles?) but as far as I know Anki does not support that? I always thought that introducing a single directory for all the media in the latest version was a horrible idea, it just does not scale. I expect my collection to grow several times of the current size during the next year.  Not having profiles on Android device is also a big problem for me since both my children and I use Anki to study several languages and it would be nice to have separate profile for each person/language pair.

At first glance, external SD card is mounted as vfat which, I believe (if it is the same as fat32) has limitation of 65,534 files per directory but I heard statements that if file names are long (which they are, since they are automatically generated by AwesomeTTS), it is less than that.

Does it make sense to move Anki to internal storage which seems to be ext4 and would not suffer from such limitations?

Anybody knows if Samsung S4 would support external SD card formatted as ext4?



Xiao Sun

unread,
Sep 25, 2013, 6:57:06 PM9/25/13
to anki-a...@googlegroups.com, igor...@gmail.com
I had the same issues before, I made thread about it and there are issue trackers opened on this issue. I upgraded to the Note 2 and bought the Sandisk 64GB sdcard specially for this problem. The sdcard should come in exFat, and my Note 2 can read it natively, so I should expect your S4 will be able to read exFat formatted sdcard. exFat will solve this issue of file number limit.

I am not sure abou ext4, I know exFat will work for sure, and is native supported by all Galaxy devices after the S3.

Xiao Sun

unread,
Sep 27, 2013, 4:26:50 AM9/27/13
to anki-a...@googlegroups.com, igor...@gmail.com
I just moved all anki files and media to my Note 2 internal storage, everything works fine. This way is better since AD lags big time when I am torrenting movies to my sdcard at the same time.

Flavio Lerda

unread,
Sep 27, 2013, 5:30:19 AM9/27/13
to anki-a...@googlegroups.com, igor...@gmail.com
Just something to be aware of.

If you copy your deck to internal storage:
- you will not be able to access them if the application cannot be started
- they will be deleted if you "clear data"
- they will be deleted if you uninstall the app

All the above are not the case if you use external storage.

Igor: your understanding of the problem with VFAT seems correct to me.

If you have long file names, you can expect the number of media
to be limited by the file system.

Lastly, ext4 should not have this problem.

Flavio


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

yoannjap

unread,
Oct 12, 2013, 11:03:09 PM10/12/13
to anki-a...@googlegroups.com, igor...@gmail.com
Ok, I've read all of this, because I had exactly the same problem. Too many files in collection.media folder.
    - So first I tried to reformat my SD card to ext4 format with my PC-Ubuntu. But of course my motorola forced me to reformat it in when I pluged it into back. OK I discovered I had two solutions :
          * Install a custom rom (like CyanogenMod) to have native access to Ext4 SD card,
          * Partitionning my SD card from my smartphone, and dowloading an app (Link2SD) which could mount and recognize it.
    - Ok, I chose the second solution, partitionning (with a fat32 partition, and another ext4 one). Because I can't do the first due to the core not revealed by motorola. F****.
    - But I still have a problem : because in the new version (released october 8th) of AnkiDroid, your can specify the path of database directory. So of course I copied and pasted the 'AnkiDroid' directory from /mnt/sdcard to my new partition created in /data/sdext2. But when I do this, I get an error of corrupted database, and I can't do nothing (I can't even recover the first path), and I have to uninstall and reinstall AnkiDroid :/

So would a great guy or girl have an idea on how to move AnkiDroid AND its database directory to my new partition ?
Or another solution which I wouldn't have thought about ???

Thanks one million times, because if I have a smartphone it is : phoning 50%, mailing 10%, Anki... 40%. So if I lose Anki, I don't **ù*^ care having a smartphone :)

abcof...@gmail.com

unread,
Oct 17, 2014, 7:28:27 PM10/17/14
to anki-a...@googlegroups.com, igor...@gmail.com
I had the same problem. My phone doesn't support exFat. Though it could solve this problem. Make root on my phone and then make NTFS with Paragon app was too risky for me.
So I just moved all my sounds to \Anki\User 1\collection.media\sound  And changed all links in all cards via Browser - Find and replace.
For ex. for images:

Find:  <img src="

Replace With:  <img src="1/

In - ...(here I chose my field with pics)


For audio:

Find: [sound:

Replace With: [sound:sound/

In - ...(here I chose my field with sounds)


Before run "Find and replace" I selected the desk I need to change and all cards in it.


All the files I moved manualy to the new folder.


It works.



четверг, 26 сентября 2013 г., 0:41:25 UTC+4 пользователь igor...@gmail.com написал:
Reply all
Reply to author
Forward
0 new messages