Installing NextCloud on RPI3 with OSMC after SD card corruption

Hi everyone!

I was using NextCloud v13 on my Raspberry Pi 3 with 2TB USB HDD on OSMC for about a year now.

Unfortunately, SD card got corrupted and I had to install everything all over again.

However, the content of the USB HDD with all the directory structure and files was left untouched.

Can someone tell me if I mount the drive again and run the NextCloud installation over the same mount point, will I lose all the data?

If not, how can I update the database to include all the directories/files that are still on the HDD?

Let me know if I need to provide any additional information.

Thanks!

After a fresh install, edit config.php to point to data dir in the HDD and run

cd /var/www/nextcloud

sudo -u www-data php occ files:scan --all

This can take a long time, depending your data size.

Optional: To avoid sd-card corruption, I install berryboot first, and install OS to the external drive.

Thanks for the answer @OliverV!

Is SD card corruption something to be aware of?
I’m asking since it is predominant opinion on OSMC forum that this is not an issue anymore.

Maybe they look at it from the perspective of having only OSMC installed and that it that doesn’t take a toll on the SD card.

Is NextCloud heavily using the SD card?

IMHO Yes, If one is running an OS and the applications suite required to run nextcloud, with caching, logging, cronjobs, in short read/writes all of the time.
Although, good quality sd-cards, will last quit some time, I am in the habit of creating a backup img file of the initial sd-card once it is up and running and configured the way I want it.
As my ncdata is on an external drive, I make daily backups to a 2nd external drive.
In that way I am covered in case of a sd or hd failure.

That said, more I/O errors are from bad power sources and bad cables, than they are from bad sd-cards. (In fact RPI is not the best suited hardware for running NC, and though it will work, one should not expect high performance.)

It is just my personal opinion from personal experience, I am not claiming this to be an absolute truth :wink:
So let me DuckDuckGo that for you

1 Like