Fedora 38 - I/O zipping error using find command

I used the olive tree’s app called webdav server pro to assign a http://ipaddress:8080 to mount my galaxy s8’s internal storage in fedora 38. When I use the command

I cd into the root folder of my android

/run/user/1000/gvfs/dav:host=,port=8080,ssl=false (which becomes the current working directory)

and then tried this command to zip the DCIM/Camera folder

find ./sdcard/DCIM/Camera -exec zip -0 /home/username/Documents/archive.zip {} +

after some lines I get this error:

zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

Why does this happen how can to fix this? Can anyone try the same method that I use on their android phones?

thx a bunch!

This command could result in a massive amount of IO, because every file has to be added separately and the archive closed. Should work theoretically, but is it not better to pipe the find output to zip with the “-@” argument in order to read the filenames from stdin ?

find ./sdcard/DCIM/Camera -type f | zip -0 -@ /home/username/Documents/archive.zip 

I just tested this with my pixel 7 recently after I was on vacation and I used the same command in the 1st post and it zipped each file sucessfully even the .mp4 files but I think that’s just luck because it’s barely used.

With the s8, are you saying that to make a full list of all folders and files and then zip them altogether? how does stdin work with zip and find?

find ./sdcard/DCIM/Camera -type f | zip -0 -@ /home/username/Documents/archive.zip

This is still giving me the zip I/O error

The find command just delivers a stream of filenames on it’s standard ouput, read and processed by zip -@ from its standard input until EOF, then the zip is closed. Diffenrence is, for n files, n invocations of zip, and via stdin just one.

I searched for the error message and came on an ubuntu forum where exactly the same problem was reported. They suspected the phone software.

Can you run either command excluding mp4’s?
You can do it by adding ! -name “*.mp4” to the find command or inserting a
grep -v ‘mp4$’ in the pipeline in the second command.
Can you copy the mp4 which was the last one in the pipeline command manually?

Another possible point of failure is the gvfs virtual filesystem webdav module. You can replace this by “mount.davfs2”, but I’ve no experience with it so I can’t say which is better, if any.

Apparently the info you are trying to zip is on an sdcard.
Why not remove the sdcard from the phone and use a card reader on the pc to read it and copy or zip the data.

What does EOF mean ?

What do you mean by this?

that’s funny because that same guy who posted the thread on ubuntu is me :smiley:

I’ve run :

username@username-virtual-machine:/run/user/1000/gvfs/dav:host=,port=8080,ssl=false$ find ./sdcard/DCIM/Camera/*.jpg -print -exec zip -0 /home/username/Downloads/test.zip {} +

and this still resulted in an error

adding: sdcard/DCIM/Camera/20220316_094146.jpg
zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

so I tried to copy this manually using the same command and only for this specific file:

find ./sdcard/DCIM/Camera/20220316_094146.jpg -print -exec zip -0 /home/azeem/Downloads/test.zip {} +
  adding: sdcard/DCIM/Camera/20220316_094146.jpg
zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

I’ve also tried

azeem@azeem-virtual-machine:/run/user/1000/gvfs/dav:host=,port=8080,ssl=false$ find ./sdcard/DCIM/Camera -type f -print -exec zip -0 /home/azeem/Documents/test.zip {} +

this resulted in error such as

Scanning files .............. ...............
  adding: sdcard/DCIM/Camera/20220617_184728.jpg (stored 0%)
  adding: sdcard/DCIM/Camera/20220618_130700.jpg (stored 0%)
  adding: sdcard/DCIM/Camera/20220731_180105.jpg
zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

The below command has also resulted in a zip I/O error

find ./sdcard/DCIM/Camera -type f | zip -0 -@ /home/azeem/Documents/archive.zip
Scanning files .............. ...............
  adding: sdcard/DCIM/Camera/20220617_184728.jpg
zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

it’s not an actual sd card, its internal storage, the folder inside root is just called sdcard from android 9

On my Galaxy S8 I had both an sd card and the system memory. The sd card storage was recognized separately from the system memory storage. With the 'My Files" file manager a separate path was used for data at each location. When the sd card was not installed there was only the system storage path and when the card was installed there were 2 different paths.

Are you certain you do not have an sd card installed.? You could power off the phone and remove the sim card holder to look. That holder had slots for both the sim card and an sd card on mine.

I had the same with my most recently replaced phone, a Galaxy S20.

OK i already know this but why dont you try it with your galaxy s8, install webdav server pro or free version from the olive tree download it to ur phone, mount your / storage and make a mapped network drive on windows 10 then youll see the internal storage root folder is called sdcard

I am perfectly sure I dont have a micro sd card installed otherwise it would show up in the phone. As a matter of fact, why dont I just show the internal storage on windows 10 when it’s mapped to a network drive.


Sorry, all my older phones have been recycled so testing is moot. I am speaking from experience, not hands on right now.


I tested excluding all .mp4 but then the same error occurs with another jpg then if I only include the problematic .mp4, the same error occurs again. Similary for .jpg files too. What does davfs2 actually do ?

I didn’t read the whole thread, but
I use to copy data to/from my android devices samba shares and “MiXplorer” (free version)


Tutorial to setup Mix for samba:

If you already have your samba share setup with your android can you test using the find and zip command to see if you get any errors?

Wait a minute…this is to connect to a window share…but I want it the other way around…connect android on fedora

you misunderstood it:
my linux box offers the samba shares, not the other way around.

have you tried your find/zip-command in an “adb shell” on the phone ?
- to exclude: it’s the phone/the zip command/… -

you need package “android-tools” on your fedora box and the phone connected via cable

This requires root permission…but I have a north american SM-G950W which can’t be rooted

I’ll try to answer your questions far above:

EOF is the end-of-file mark. The find command sends all file names to standard output and terminates the connection, so zip is signalled that nothing is coming anymore and it can do it’s bookkeeping and close the zip. It’s programmers jargon, they have to program something like “while not EOF read the next line”

The first version of the command executes the zip command for each file found by the find command, so for each file the zip is opened, data added, zip closed.

The second version executes zip only once, it opens the zip file, reads the name from find, add data from the named file, and wait for the next filename. If find is ready, zip gets the end-of-file signal and terminates the zip file. Probably it’s much faster.

I’m not surprised, The problem description was extremely close. https://askubuntu.com/questions/1469253/zip-i-o-error-bad-address-error-during-zipping-process/

So bigger MP4’s are not alone the problem

gvfs is a virtual file system from gnome, used to make a number of network protocols available in gnome files or nautilus.
davfs2 is similar to mount.cifs or mount.nfs, where you mount as root a network disk into the filesystem: e.g.

sudo dnf install davfs2
sudo mkdir /mnt/android
mount -t davfs -o uid=1000 http:/ /mnt/android.

and find your photos under /mnt/android/DCIM

cit: “This requires root permission…

sure ?

I have a Samsung S4 running LOS 18.1 (android 11)

the help file of android’s zip command:

opyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
  The default action is to add or replace zipfile entries from list, which
  can include the special name - to compress standard input.
  If zipfile and list are omitted, zip compresses stdin to stdout.
  -f   freshen: only changed files  -u   update: only changed or new files
  -d   delete entries in zipfile    -m   move into zipfile (delete OS files)
  -r   recurse into directories     -j   junk (don't record) directory names
  -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)
  -1   compress faster              -9   compress better
  -q   quiet operation              -v   verbose operation/print version info
  -c   add one-line comments        -z   add zipfile comment
  -@   read names from stdin        -o   make zipfile as old as latest entry
  -x   exclude the following names  -i   include only the following names
  -F   fix zipfile (-FF try harder) -D   do not add directory entries
  -A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -e   encrypt                      -n   don't compress these suffixes

So I tested within an adb shell and run the following comamnd without errors:

find 0_MyConfig/ | zip testfile -@

where “0_MyConfig” is a folder on my android phone’s sdcard and
where “testfile” is the resulting zip file (with the content of the folder)