External mounted hard drive reverted to 3 months ago

Nextcloud version: 20.0.7
Operating system and version Ubuntu 20.04) on Linux 5.11.0-25-generic x86_64
Apache or nginx version: 2.4.41
PHP version 7.4.3
System Report URL: Collective Cloud

The issue you are facing:
External mounted drive reverted to a state of files from 3 months ago. I am using Nextcloud to host files from a local mounted 4TB hard drive at a mount location of /mnt/torrinshared and then configured through “External storages”. This has been running great for the past 3 months and have 3 separate external storages mounted in similar fashion. (only using one HDD here as the example where i’ve lost over 300GB of data).

Now, this morning sometime, all 3 of the hard drives lost all files between May 26th 2021 and today, August 13th 2021. Each hard drive seems to have reverted back to a state where the files all have timestamps of May 26th, 2021. I have 3 other hard drives locally mounted and configured in Nextcloud the same way and they all experienced this behaviour. I have ruled out hard drive failures as this has occurred across 3 independent hard drives. And have ruled out a backup causing this issue from my Virtualmin instance that my Nextcloud instance is running on.

Anybody else experience this or know what is going on?

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. None, happened by itself.

The output of your Nextcloud log in Admin > Logging:
Attached here: https://drive.google.com/file/d/1r7qFnOm-8z78yUgCfRAtAeMcvPmUi28L/view?usp=sharing

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

$CONFIG = array (
  'instanceid' => 'XXXXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXX',
  'trusted_domains' => 
  array (
    0 => 'XXXXXXXXXXX',
  ),
  'datadirectory' => '/home/cloud/public_html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'XXXXXXXXXXX',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'XXXXXXXXXXX',
  'dbhost' => 'XXXXXXXXXXX',
  'dbport' => 'XXXXXXXXXXX',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXXXXXXXXX',
  'dbpassword' => 'XXXXXXXXXXX',
  'installed' => true,
  'log_type' => 'file',
  'logfile' => 'logs/nextcloud.log',
  'loglevel' => '2',
  'mail_domain' => 'XXXXXXXXXXX',
  'mail_smtpmode' => 'XXXXXXXXXXX',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_sendmailmode' => 'XXXXXXXXXXX',
  'mail_from_address' => 'XXXXXXXXXXX',
  'mail_smtphost' => 'XXXXXXXXXXX',
  'mail_smtpport' => 'XXXXXXXXXXX',
  'app_install_overwrite' => 
  array (
    0 => 'mindmap_app',
    1 => 'ocr',
    2 => 'files_clipboard',
    3 => 'bookmarks_fulltextsearch',
  ),
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'tls',
  'mail_smtpname' => 'XXXXXXXXXXX',
  'mail_smtppassword' => 'XXXXXXXXXXX',

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

https://drive.google.com/file/d/1pgnIfdILXVN5yml1B9FO4WM73cJNqU8i/view?usp=sharing

I wouldn’t expect that files are being reverted to a point 3 month ago is anything which can be caused by Nextcloud. I would expect a problem with the local mount of your external hard drive.

I could imagine, that if you’re planning to use e.g. /mnt/harddisk1 as mount point for your external drive and configure this in Nextcloud, but without having the hard drive mounted, all files are copied to that “drive” (sub directory).

If you then realize that the drive hasn’t locally been mounted or you reboot your server so that a mount of the external drive is forced, the mounted file system would overlay the existing sub directory structure and you could see an empty directory.

If you now continue to copy file to that drive, which seems to work as expected, from the client point of view, and after three month the local mount of the external drives fails, you might see all “old” files which have previouly been stored in the original directory structure.

1 Like

and after three month the local mount of the external drives fails, you might see all “old” files which have previouly been stored in the original directory structure.

Yeah exactly, I just found out that the drive wasn’t locally mounted properly. Finding that /mnt/harddrive1 on the file system shows all recent files. Thanks j-ed.