Input/output error when moving .tar from one HD to another

Nextcloud version (eg, 20.0.5): 20.0.2
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Debian)
PHP version (eg, 7.4): PHP 7.3.27-1~deb10u1

The issue you are facing:
When trying to mv a backup.tar from one HD to another I get this error

root@nextcloudpi:/media/myCloudDrive# mv nextcloud-bkp_20210618_1624009147.tar /media/wd-backup
mv: error reading 'nextcloud-bkp_20210618_1624009147.tar': Input/output error

at the same time the browser no longer let me access the user and gives this warning
Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory.
Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. in /media/myCloud
    mv nextcloud-bkp-.tar /median/differentHD

The output of your Nextcloud log in Admin > Logging:

[core] Error: Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory at <<closure>>

 0. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1449
    OC\DB\Connection->connect()
 1. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 892
    Doctrine\DBAL\Connection->getWrappedConnection()
 2. /var/www/nextcloud/lib/private/DB/Connection.php line 202
    Doctrine\DBAL\Connection->executeQuery("SELECT * FROM `oc_appconfig`", [], [], null)
 3. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 206
    OC\DB\Connection->executeQuery("SELECT * FROM `oc_appconfig`", [], [])
 4. /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 217
    Doctrine\DBAL\Query\QueryBuilder->execute()
 5. /var/www/nextcloud/lib/private/AppConfig.php line 345
    OC\DB\QueryBuilder\QueryBuilder->execute()
 6. /var/www/nextcloud/lib/private/AppConfig.php line 110
    OC\AppConfig->loadConfigValues()
 7. /var/www/nextcloud/lib/private/AppConfig.php line 301
    OC\AppConfig->getApps()
 8. /var/www/nextcloud/lib/private/legacy/OC_App.php line 949
    OC\AppConfig->getValues(false, "installed_version")
 9. /var/www/nextcloud/lib/private/TemplateLayout.php line 185
    OC_App::getAppVersions()
10. /var/www/nextcloud/lib/private/legacy/OC_Template.php line 183
    OC\TemplateLayout->__construct("error", "")
11. /var/www/nextcloud/lib/private/Template/Base.php line 132
    OC_Template->fetchPage()
12. /var/www/nextcloud/lib/private/legacy/OC_Template.php line 332
    OC\Template\Base->printPage()
13. /var/www/nextcloud/index.php line 63
    OC_Template::printExceptionErrorPage(Doctrine\DBAL\DBALException {}, 500)

GET /settings/user
from  at 2021-06-18T14:22:15+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Do you have enough space left on both devices?

If yes test it with “cp” and “rm”.

I do
I am driven mad by this situation

how do you mean test it with cp and rm?
As long as I create the backup in the same drive as the datadir it seems to work.
as soon as i try to give a different destination /USBdrive2/
it throws this errors

Perhaps there is a problem with the second drive or mount point. Can you create a normal file at this place? With “touch” you can create an empty file.

cd /path/to/place
touch test.txt
ls -l test.txt

hi @devnull
Thank you for your reply -
I simply destroyed that whole instance. and re created it.
I think there was some problem with the HD itself.
Cheers

1 Like