1
    JasonR:/ $ su
JasonR:/ # cd /stor*/emu*/0/WhatsApp
JasonR:/storage/emulated/0/WhatsApp # cd Media
JasonR:/storage/emulated/0/WhatsApp/Media # ls -al *.jpg
-rwxrwx--x 1 root everybody 506827 2019-02-22 11:42 DSC_20190102_130645.jpg

## I cant' move a regular file in whatsapp Images folder

cp DSC*.jpg  "WhatsApp Images"                                                 
cp: cannot create regular file 'WhatsApp Images/DSC_20190102_130645.jpg': No space left on device

## Neither can I create a 0 byte file.

JasonR:/storage/emulated/0/WhatsApp/Media # touch 1.jpeg
JasonR:/storage/emulated/0/WhatsApp/Media # cp 1.jpeg "WhatsApp Images"
cp: cannot create regular file 'WhatsApp Images/1.jpeg': No space left on device 

## du command o/p

du -sch "WhatsApp Images"
2.0G    WhatsApp Images
2.0G    total                                 

## Df command o/p. The BindFs between internal storage and SD Card can be seen.More details in Mount o/p below

JasonR:/storage/emulated/0/WhatsApp/Media # df -h "WhatsApp Images"
Filesystem                       Size  Used Avail Use% Mounted on
/mnt/media_rw/76B2-B58E/WhatsApp 109G   65G   45G  60% 

## I m listing top 5 elements in that directory

JasonR:/storage/emulated/0/WhatsApp/Media # cd "WhatsApp Images" 
ls -al | head -5                  


   <
total 3962688
drwxrwx--x  5 root everybody  2097152 2019-07-29 14:32 .
drwxrwx--x 13 root everybody    32768 2019-07-29 14:44 ..
-rwxrwx--x  1 root everybody    95402 2019-01-13 01:50 IMG-20150526-WA0005.jpg
-rwxrwx--x  1 root everybody   161097 2019-01-13 01:55 IMG-20150711-WA0000.jpg

## I can move up and restore a file within the WhatsApp Images folder.

/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150526-WA0005.jpg IMG-20150526-WA0005.jpg.old
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150526-WA0005.jpg.old IMG-20150526-WA0005.jpg
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150711-WA0000.jpg ../
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv ../IMG-20150711-WA0000.jpg .

## Just <16.5K files totally. ExFat Limit is 2,796,202 per dir

/storage/emulated/0/WhatsApp/Media/WhatsApp Images # ls -alh | wc -l
16387
JasonR:/storage/emulated/0/WhatsApp/Media/WhatsApp Images #

## MOUNT command output

mount | grep -i "Whatsapp"                                                     <
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/default/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0006)
/mnt/media_rw/76B2-B58E/WhatsApp on /storage/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0006)
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/read/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0027)
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/write/emulated/0/WhatsApp type sdcardfs 

    (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0007)
    JasonR:/storage/emulated/0/WhatsApp/Media/WhatsApp Images #

    . 

## Going into Images directory directly without a bindFs link & creating a 0 byte file Fails

JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media # cd "WhatsApp Images"
    touch 1.jpg
    touch: '1.jpg': No space left on device

    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #

## Now I 'll list some jpg's

    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #
    ls -al *.jpg | head -5
    -rwxrwx--- 1 media_rw media_rw    95402 2019-01-13 01:50 IMG-20150526-WA0005.jpg
    -rwxrwx--- 1 media_rw media_rw   161097 2019-01-13 01:55 IMG-20150711-WA0000.jpg
    -rwxrwx--- 1 media_rw media_rw   183103 2019-01-13 01:53 IMG-20150711-WA0002.jpg
    -rwxrwx--- 1 media_rw media_rw   170516 2019-01-13 01:55 IMG-20150711-WA0003.jpg
    -rwxrwx--- 1 media_rw media_rw   190117 2019-01-13 01:55 IMG-20150711-WA0004.jpg

## I can move a file inside that folder 1 level up && after moving it , it WILL let me create an additional file

    mv IMG-20150526-WA0005.jpg ../
    touch 1.jpg 

## Now with that additional file created I will move back the original file It will REFUSE this unless I delete the additional file I just created

                                                                       <
    mv ../IMG-20150526-WA0005.jpg .                                                <
    mv: cannot move '../IMG-20150526-WA0005.jpg' to './IMG-20150526-WA0005.jpg': No space left on device
    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #

    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #
    rm 1.jpg
    mv ../IMG-20150526-WA0005.jpg . 

##sounds like it cares about the #files . Issue is not space related

exFAT file system is supposed to allow more than 2 million files per folder.
so just to give you an idea of my situation.
as is well known WhatsApp will not let you specify where to store its huge volume of media and database files i.e. WhatsApp folder in user internal storage. so I have to use a bind approach to link to a folder on my exFAT MicroSD card with the same name.
all was well for almost 2 years and all of a sudden out of Nowhere I had the situation where WhatsApp images i.e. the "WhatsApp Images" folder ( WhatsApp/Media/"WhatsApp Images") will simply refuse to accept any more jpg from WhatsApp if I un-bind this relationship and have everything downloaded on my internal memory the jpg's & other media are downloaded just fine. but internal storage is crammed - I don't have space.
binding does not cause this to happen to other media i.e. video documents etc. this only happens to images folder and presumably that is related to large number of image files already in that folder.
exFAT does not have such a low ceiling for number of files you can put in a folder.
also just to complete the picture, I can write to any other folder on that micro SD card through binding on internal storage

what I did

  • renamed this folder ( folder.old )and created a new folder and moved all files into that new folder also called 'WhatsApp images' and after about a week the same issue crept up on this new folder

  • since most of the space is hogged by videos , I created a bind only for video folder ( WhatsApp videos) everything else could go to internal memory.
    the result was videos could not be downloaded. so I could bind only the parent WhatsApp folder lock stock subfolder approach fails

so my questions are:

  • exFAT does not have restrictions for such a small number of files in a folder what is causing this issue. on command line it shows up as no more space available
    I have attached screenshots of my terminal emulator

  • why does in subfolder approach not work. I'd assume that has to do with temp files created elsewhere while you download the video and then they have to be joined some place on the same partition and so the binding does not work . if at all this is in fact true then where does WhatsApp store temporary files before it joins them so this temp folder can also be linked through a bind relationship

  • In your screen shots I see mainly the path /storage/emulated/0 which is not your sd-card and therefore not an ex-fat system. Anyway your screenshots are confusing me as they are too large and show only a very small region. Please paste terminal output as text and not as image. – Robert Jul 27 at 11:03
  • ok I will connect the phone on ADB shell and then post output. BRB in a few – user1874594 Jul 27 at 11:06
  • 1
    I believe namespace separation is already on on my magisk . there are three options isolated inherit root from requestor namespace and global namespace. the second option is on. I am using app2sd Mount feature. what the output shows is even if the the folder is dismounted & attempt made to write to the the MicroSD card ( exFAT) folder the same error comes. if I I move one file then I can add additional file and I can always rename files there is no restriction for the latter if you see the use cases above. I Wonder What is causing this because AFAIK remember – user1874594 Jul 30 at 8:06
  • 1
    understand selinux has badly bitten you in the past but I do not think it is responsible for these situations because I can write to that folder if I remove files and that is is the irony. about quotas being enabled . that would be for local internal storage folders but for MicroSD card folder which is link by any bind relationship, it happens onone the less – user1874594 Jul 30 at 8:15
  • 1
    i believe there must be something in dmesg/logcat logs, but you need some expert knowledge for analysis – alecxs Jul 30 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.