LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-26-2023, 04:12 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337

based on that that is a disk error. You ought to run a disk check (smartctl?). Also you can check /var/log probably you can see something related inside.
also you might check which file has a file descriptor 4 (you need to find a line whith an = 4 at the end. reading that file caused that io error.
 
Old 05-26-2023, 04:19 AM   #17
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
based on that that is a disk error. You ought to run a disk check (smartctl?). Also you can check /var/log probably you can see something related inside.
also you might check which file has a file descriptor 4 (you need to find a line whith an = 4 at the end. reading that file caused that io error.
How can it be a disk error when ubuntu is being run on a virtual machine and the zipping process is from a webdav server ? Do i need to do a disk chrck on both windows and linux vm ? i am pretty sure no files are corrupt on my android
 
Old 05-26-2023, 05:02 AM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
it is an i/o error, you could see it. Now you need to find out where is it coming from. So my idea is to check the file, disk, logs.
Actually you might replace zip:
Code:
find ."/sdcard/DCIM/Camera" -exec cat {} >/dev/null
to examine it.
 
Old 05-26-2023, 09:45 AM   #19
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
it is an i/o error, you could see it. Now you need to find out where is it coming from. So my idea is to check the file, disk, logs.
Actually you might replace zip:
Code:
find ."/sdcard/DCIM/Camera" -exec cat {} >/dev/null
to examine it.
What does this cat command do ? and also which specific logs and disk checks should I perform ? Where shall I begin ?

What if the problem is if they are symbolic links and what can we do about it ?

Last edited by anmac1789; 05-26-2023 at 09:46 AM.
 
Old 05-26-2023, 12:01 PM   #20
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
it is an i/o error, you could see it. Now you need to find out where is it coming from. So my idea is to check the file, disk, logs.
Actually you might replace zip:
Code:
find ."/sdcard/DCIM/Camera" -exec cat {} >/dev/null
to examine it.
When I use this command in terminal, I get an error saying
Code:
find: missing argument to `-exec'
 
Old 05-26-2023, 01:20 PM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
I forgot that + at the end.
Code:
find ."/sdcard/DCIM/Camera" -exec cat {} + >/dev/null
 
Old 05-26-2023, 01:32 PM   #22
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
This is another input output error with your command. What is your command supposed to actually do ? Also, should I change hard drives? is my .vdi corrupted? I did defragmentation on my windows ssd and it shows to be perfectly normal. Since I'm running ubuntu in a vm, how can I test if the .vdi is corrupted or not ?
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-26 14-29-56.png
Views:	8
Size:	165.1 KB
ID:	41108  
 
Old 05-26-2023, 01:40 PM   #23
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
based on that that is a disk error. You ought to run a disk check (smartctl?). Also you can check /var/log probably you can see something related inside.
also you might check which file has a file descriptor 4 (you need to find a line whith an = 4 at the end. reading that file caused that io error.
There are alot of files in /var/log what file am I specifically looking for ? I don't know what /var/log files do or what they mean

[update] Alright, so I installed ubuntu 23.04 on a new ADATA 240 GB ssd and hoping this would work now. I've also switched the SATA cable to another port on the motherboard and make sure it is secured properly.

[update 2] so it seems that even with a new installation of ubuntu on a separate hard drive, I am still getting zip I/O error: Bad address
zip error: Output file write failure (write error on zip file) error. I know it can't be a faulty ssd because it's brand new barely used for a month. Something odd has been going on, when I use

Code:
find ./sdcard/DCIM/Camera -exec zip -0 /path/to/zip/file.zip {} +
then this fails after some number of pictures/videos and results in the I/O error. But when I use it without the -0 then I get random messages with zip warning: file size changed while zipping but it continues to finish and make the zip. What behavior is this?

[update 3] It seems like when zipping .mp4 files, find crashes and returns zip I/O error: Bad address zip error: Output file write failure (write error on zip file) error. But when I try to only include .jpg files, there is no error reported. Why does find & zip fail when adding .mp4 files? See attached below
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-27 05-29-26.jpg
Views:	9
Size:	257.8 KB
ID:	41109  

Last edited by anmac1789; 05-27-2023 at 04:30 AM.
 
Old 05-27-2023, 03:49 AM   #24
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
Quote:
Originally Posted by anmac1789 View Post
This is another input output error with your command. What is your command supposed to actually do ? Also, should I change hard drives? is my .vdi corrupted? I did defragmentation on my windows ssd and it shows to be perfectly normal. Since I'm running ubuntu in a vm, how can I test if the .vdi is corrupted or not ?
most probably that sd card is useless. It is not a problem with zip or your OS, but what you want to read (I don't know if it is a hdd, an sd card or a virtual disk).
 
Old 05-27-2023, 04:31 AM   #25
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
most probably that sd card is useless. It is not a problem with zip or your OS, but what you want to read (I don't know if it is a hdd, an sd card or a virtual disk).
I've switched from virtualbox to actually installing ubuntu on a actual ssd. The same problem occurs with adding .mp4 files. Please see my previous screenshot. Mind you, I didn't mount the actual sdcard from my s8 as a webdav, sdcard is the name of the root folder of the internal storage.

In the below screenshot, the left side is 2022-04-09-144320205.mp4 on my actual galaxy s8. The right side is the same file but in a webdav server. From it, you can see the file type is something wierd like Binary (application/octet-stream). Why doesn't find add this file? is it because it doesn't show it as a recognized file? find can add pdf files and other formats but somehow this causes a problem.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-27 05-37-37.jpg
Views:	9
Size:	190.7 KB
ID:	41110  

Last edited by anmac1789; 05-27-2023 at 04:41 AM.
 
Old 05-28-2023, 01:12 PM   #26
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
You can't really trust how things are identified in Linux. Linux has some guessing method, but it not like other OS'es with an extension map. It really only knows executables and binaries and there is a file that can guess by the first few bytes of a file.

If that find with cat worked without error (it is simply reading every byte of the file and writing it to /dev/null, a trash bucket), then it simply
cannot be any disk error on read. Zip has file size limitations, but it should be 64 aware to allow > 4GB limit:

Code:
 $ which zip
/usr/bin/zip
$ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.

Compiled with gcc 6.3.0 20170415 for Unix (Linux ELF).

Zip special compilation options:
	USE_EF_UT_TIME       (store Universal Time)
	BZIP2_SUPPORT        (bzip2 library version 1.0.8, 13-Jul-2019)
	    bzip2 code and library copyright (c) Julian R Seward
	    (See the bzip2 license for terms of use)
	SYMLINK_SUPPORT      (symbolic links supported)
	LARGE_FILE_SUPPORT   (can read and write large files on file system)
	ZIP64_SUPPORT        (use Zip64 to store large files in archives)   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	UNICODE_SUPPORT      (store and read UTF-8 Unicode paths)
	STORE_UNIX_UIDs_GIDs (store UID/GID sizes/values using new extra field)
	UIDGID_NOT_16BIT     (old Unix 16-bit UID/GID extra field not used)
	[encryption, version 2.91 of 05 Jan 2007] (modified for Zip 3)

Encryption notice:
	The encryption code of this program is not copyrighted and is
	put in the public domain.  It was originally written in Europe
	and, to the best of our knowledge, can be freely distributed
	in both source and object forms from any country, including
	the USA under License Exception TSU of the U.S. Export
	Administration Regulations (section 740.13(e)) of 6 June 2002.

Zip environment options:
             ZIP:  [none]
The file size changing is strange. That means zip was trying to read a file and during the read, the file change (usually some log fie or access) or you are somehow included the output file with the input.

Your latest test seems to indicate the write is failing, what is the target or your zip archive?
 
Old 05-28-2023, 02:24 PM   #27
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by elgrandeperro View Post
You can't really trust how things are identified in Linux. Linux has some guessing method, but it not like other OS'es with an extension map. It really only knows executables and binaries and there is a file that can guess by the first few bytes of a file.

If that find with cat worked without error (it is simply reading every byte of the file and writing it to /dev/null, a trash bucket), then it simply
cannot be any disk error on read. Zip has file size limitations, but it should be 64 aware to allow > 4GB limit:

Code:
 $ which zip
/usr/bin/zip
$ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.

Compiled with gcc 6.3.0 20170415 for Unix (Linux ELF).

Zip special compilation options:
	USE_EF_UT_TIME       (store Universal Time)
	BZIP2_SUPPORT        (bzip2 library version 1.0.8, 13-Jul-2019)
	    bzip2 code and library copyright (c) Julian R Seward
	    (See the bzip2 license for terms of use)
	SYMLINK_SUPPORT      (symbolic links supported)
	LARGE_FILE_SUPPORT   (can read and write large files on file system)
	ZIP64_SUPPORT        (use Zip64 to store large files in archives)   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	UNICODE_SUPPORT      (store and read UTF-8 Unicode paths)
	STORE_UNIX_UIDs_GIDs (store UID/GID sizes/values using new extra field)
	UIDGID_NOT_16BIT     (old Unix 16-bit UID/GID extra field not used)
	[encryption, version 2.91 of 05 Jan 2007] (modified for Zip 3)

Encryption notice:
	The encryption code of this program is not copyrighted and is
	put in the public domain.  It was originally written in Europe
	and, to the best of our knowledge, can be freely distributed
	in both source and object forms from any country, including
	the USA under License Exception TSU of the U.S. Export
	Administration Regulations (section 740.13(e)) of 6 June 2002.

Zip environment options:
             ZIP:  [none]
The file size changing is strange. That means zip was trying to read a file and during the read, the file change (usually some log fie or access) or you are somehow included the output file with the input.

Your latest test seems to indicate the write is failing, what is the target or your zip archive?
The target of my zip is in the /home/username/Documents/ folder. You can see my command line syntaxes from all the screenshots since the beginning of this thread. Even then if linux doesn't recognize a file extension, it should still save it in a zip. I know my hard drive is not failing, how do I know or trace the process of how find and zip are working together to see what files are being created, what are being deleted and what is being moved around ? Is there a detailed view of the entire process?

Are you suggesting that I use Zip64 option and if so, how do I use it ? Even in a folder called .thumbnails under DCIM/ which contains 5,000 small files, zip and find lags and stops somewhere middle of the process of zipping. It is getting very annoying to the point that is making me believe zip and find have bugs and is an incomplete piece of code from the developers

Should I try something like fedora ?

Last edited by anmac1789; 05-28-2023 at 02:26 PM.
 
Old 05-28-2023, 10:52 PM   #28
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
No I am suggesting first make sure you are using the right zip. Second, that has 64 bit enabled or built.

Zip is an old win utility. I never had the problems you are having, but I only extract, not create.

I'd convert to tar (since you aren't compressing) and see if it works.
 
Old 05-28-2023, 11:33 PM   #29
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by elgrandeperro View Post
No I am suggesting first make sure you are using the right zip. Second, that has 64 bit enabled or built.
isn't the default zip command in linux info-zip 64 bit zip only ?

Quote:
Originally Posted by elgrandeperro View Post
Zip is an old win utility. I never had the problems you are having, but I only extract, not create.

I'd convert to tar (since you aren't compressing) and see if it works.
Does tar preserve all the file and folder timestamps ?

update — when i connected my phone as a MTP device directly without making any network share, I am still getting input output error for folders and files at random. So, connecting with usb cable and connecting my android normally also gives I/O errors in addition to I/O errors with using webdav shares. Is there something deeper going on ? beyond hardware?

Last edited by anmac1789; 05-29-2023 at 10:45 AM.
 
Old 05-29-2023, 01:47 PM   #30
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
If it logged a hardware error, most likely in /var/log/syslog or /var/log/messages. Bus like errors are hard to debug because they can involve multiple devices or one device could be interfering with things.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I have zip -d file.zip "__MACOSX*" work on all zip files in directory? thomwblair Linux - Newbie 10 10-08-2018 02:30 PM
Cannot zip a mutli-part archive, zip -FF command failing with out of memory error sanchit.sharma Linux - Newbie 8 05-21-2018 06:47 AM
Using zip to zip the contents of a directory to another? Paradigm6790 Linux - Newbie 2 07-25-2012 11:51 AM
How to find out a file in a WAR which in a zip without unzip the zip-file? thomas2004ch Linux - Software 3 09-30-2011 03:06 PM
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration