Change to using old data on external harddrive

hmm that looks quite ok.

can you test following

sudo -u mysql -g mysql touch /var/lib/mysql/demo.file
ls -la /var/lib/mysql/

Does it create the demo.file??

And one more to check if links are correctly set.

readlink /var/lib/mysql
readlink -f /var/lib/mysql
1 Like

I’ll check first thing tomorrow. Not at my desk at the moment. Thanks

returns:

touch: cannot touch '/var/lib/mysql/demo.file': Permission denied
total 188920
drwxr-xr-x  8 mysql  mysql       4096 Feb  4 21:26 .
drwxrwxr-x 14 dietpi dietpi      4096 Feb 28 10:46 ..
drwx------  2 mysql  mysql       4096 Oct 29 19:38 allo
-rw-rw----  1 mysql  mysql     425984 Feb  4 21:17 aria_log.00000001
-rw-rw----  1 mysql  mysql         52 Feb  4 21:17 aria_log_control
-rw-rw----  1 mysql  mysql          9 Feb  4 20:50 ddl_recovery-backup.log
-rw-rw----  1 mysql  mysql          9 Feb  4 21:26 ddl_recovery.log
-rw-r--r--  1 mysql  root           0 Oct 29 19:23 debian-10.11.flag
-rw-rw----  1 mysql  mysql      14971 Feb  4 21:17 ib_buffer_pool
-rw-rw----  1 mysql  mysql  100663296 Feb  5 13:04 ib_logfile0
-rw-rw----  1 mysql  mysql   79691776 Feb  4 21:17 ibdata1
-rw-rw----  1 mysql  mysql   12582912 Feb  4 21:26 ibtmp1
-rw-rw----  1 mysql  mysql          0 Oct 29 19:23 multi-master.info
drwx------  2 mysql  mysql       4096 Oct 29 19:23 mysql
-rw-r--r--  1 mysql  root          15 Oct 29 19:23 mysql_upgrade_info
drwx------  2 mysql  mysql      20480 Dec 18 21:33 nextcloud
drwx------  2 mysql  mysql       4096 Dec  5 13:23 ompd
drwx------  2 mysql  mysql       4096 Oct 29 19:23 performance_schema
drwx------  2 mysql  mysql      12288 Oct 29 19:23 sys

looks like it failed

returns:

root@DietPi:~# readlink /var/lib/mysql
readlink -f /var/lib/mysql
/mnt/dietpi_userdata/mysql
/mnt/hdd/dietpi_userdata/mysql

ok let’s do one more check. Maybe it’s a permission on another folder

ls -la /mnt/ /mnt/hdd/ /mnt/hdd/dietpi_userdata

ok. thanks. Here is the output:

root@DietPi:~# ls -la /mnt/ /mnt/hdd/ /mnt/hdd/dietpi_userdata
/mnt/:
total 28
drwxr-xr-x  7 root   root   4096 Feb 28 12:24 .
drwxr-xr-x 18 root   root   4096 Feb 20 00:17 ..
lrwxrwxrwx  1 root   root     24 Feb 28 12:24 dietpi_userdata -> /mnt/hdd/dietpi_userdata
drwxrwxr-x 11 dietpi dietpi 4096 Feb 28 12:24 dietpi_userdata_bak
drwxrwxr-x  2 dietpi dietpi 4096 Feb 19 23:34 ftp_client
drwxrwx---  5 root   root   4096 Feb  7 11:49 hdd
drwxrwxr-x  2 dietpi dietpi 4096 Feb 19 23:35 nfs_client
drwxrwxr-x  2 dietpi dietpi 4096 Feb 19 23:35 samba

/mnt/hdd/:
total 32
drwxrwx---  5 root   root    4096 Feb  7 11:49 .
drwxr-xr-x  7 root   root    4096 Feb 28 12:24 ..
drwxr-xr-x  3 root   root    4096 Feb  4 21:17 dietpi-backup
drwxrwxr-x 14 dietpi dietpi  4096 Feb 28 10:46 dietpi_userdata
drwx------  2 root   root   16384 Nov  7 08:58 lost+found

/mnt/hdd/dietpi_userdata:
total 10536
drwxrwxr-x  14 dietpi   dietpi        4096 Feb 28 10:46  .
drwxrwx---   5 root     root          4096 Feb  7 11:49  ..
-rw-rw-r--   1 dietpi   dietpi       16388 Jan 28 17:36  .DS_Store
-rw-rw-r--   1 dietpi   dietpi        4096 Nov  7 13:27  ._.DS_Store
-rw-rw-r--   1 dietpi   dietpi        4096 Nov  8 12:00 '._Philips Macbook Docs.sparsebundle'
-rw-rw-r--   1 dietpi   dietpi        4096 Nov 12 20:41 '._Phliip philip_hathaway@me.com-(0xC7B203F242AFD310)-public.asc'
-rw-rw-r--   1 dietpi   dietpi        4096 Dec 26 10:30  ._time.dmg
-rw-rw-r--   1 dietpi   dietpi      540672 Feb  5 13:04  ._
drwxr-xr-x   2 mpd      root          4096 Feb  4 21:17  .mpd_cache
drwxrwxr-x  12 dietpi   dietpi        4096 Jan 28 17:34 'Clares Macbook Files'
drwxrwxr-x 319 dietpi   dietpi       12288 Dec 26 19:34  Music
drwxrwxr-x   2 dietpi   dietpi        4096 Nov 18 12:59 'PJs MacBook Backup'
-rw-rw-r--   1 dietpi   dietpi        2586 Nov 14 14:44 'Philip Hathaway 0B86032B Public.asc'
drwxrwxr-x   3 dietpi   dietpi        4096 Feb  5 13:11 'Philips Macbook Docs.sparsebundle'
-rw-rw-r--   1 dietpi   dietpi        2469 Nov 12 20:41 'Phliip philip_hathaway@me.com-(0xC7B203F242AFD310)-public.asc'
drwxrwxr-x   2 dietpi   dietpi        4096 Oct 29 19:11  Pictures
drwxrwxr-x   5 dietpi   dietpi        4096 Dec 27 14:00  Video
lrwxrwxrwx   1 root     root            24 Feb 28 10:46  dietpi_userdata -> /mnt/hdd/dietpi_userdata
drwx--x---  12 root     root          4096 Feb  4 21:26  docker-data
drwxrwxr-x   2 dietpi   dietpi        4096 Oct 29 19:11  downloads
-rw-rw-r--   1 dietpi   dietpi     2348364 Aug 22  2021 'iphone 12 3.blend'
-rw-rw-r--   1 dietpi   dietpi      749928 Jul 31  2021 'lizzini practice.blend2'
drwxr-xr-x   6      109 root          4096 Dec  5 13:43  mopidy
drwxr-xr-x   8 mysql    mysql         4096 Feb  4 21:26  mysql
drwxrwx---   7 www-data www-data      4096 Jan 28 05:55  nextcloud_data
-rw-rw-r--   1 dietpi   dietpi   100020736 Feb  5 13:15  time.dmg

This seems to be the issue. Access to your HDD is limited to root use only. You would need read for everyone at least. Following should do

chmod 755 /mnt/hdd/
systemctl start mariadb.service
1 Like

hi, ok that has been entered

and what is the status of Nextcloud now?

DietPi-Services
─────────────────────────────────────────────────────
 Mode: start 

[  OK  ] DietPi-Services | start : avahi-daemon
[  OK  ] DietPi-Services | start : nmbd
[  OK  ] DietPi-Services | start : smbd
[  OK  ] DietPi-Services | start : redis-server
[  OK  ] DietPi-Services | start : mariadb
[  OK  ] DietPi-Services | start : php8.2-fpm
[  OK  ] DietPi-Services | start : apache2
[  OK  ] DietPi-Services | start : mpd
[  OK  ] DietPi-Services | start : shairport-sync
[  OK  ] DietPi-Services | start : squeezelite
[  OK  ] DietPi-Services | start : gmediarender
[  OK  ] DietPi-Services | start : networkaudiod
[  OK  ] DietPi-Services | start : roonbridge
[  OK  ] DietPi-Services | start : filebrowser
[  OK  ] DietPi-Services | start : netdata
[  OK  ] DietPi-Services | start : cron

seems to have started now…

I just tried to access Nexcloud in the browser and get this

are there some more steps that I need to do?

we would need to have a look into NC log

cat /mnt/dietpi_userdata/nextcloud_data/nextcloud.log

It might be a bit longer

holy cow! it’s a long list…

lass":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":128,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":149,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":231,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":700,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1200,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":37,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":139,"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}
{"reqId":"1nzaXKQYgUQbkfUT9RQl","level":3,"time":"2024-02-29T13:45:51+00:00","remoteAddr":"192.168.42.11","user":"--","app":"core","method":"GET","url":"/nextcloud/index.php/204","message":"Exception thrown: Doctrine\\DBAL\\Exception","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.28.0","version":"28.0.2.5","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'oc_admin'@'localhost' (using password: YES)","Code":1045,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":734,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":236,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":142,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":291,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line":104,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":139,"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}
root@DietPi:~# 

there you go.

Pls copy the whole code block and execute it at once

instanceid=$(find /mnt/dietpi_userdata/nextcloud_data -maxdepth 1 -name 'appdata_*')
dbuser=$(mawk -F\' '/dbuser/{print $4}' /var/www/nextcloud/config/config.php)
dbpassword=$(mawk -F\' '/dbpassword/{print $4}' /var/www/nextcloud/config/config.php)
G_CONFIG_INJECT "'instanceid'" "  'instanceid' => '$instanceid'," /var/www/nextcloud/config/config.php
mysql -e "grant all privileges on \`nextcloud\`.* to '$dbuser'@localhost identified by '$dbpassword';flush privileges"
dietpi-services start

this was the output

root@DietPi:~# instanceid=$(find /mnt/dietpi_userdata/nextcloud_data -maxdepth 1 -name 'appdata_*')
dbuser=$(mawk -F\' '/dbuser/{print $4}' /var/www/nextcloud/config/config.php)
dbpassword=$(mawk -F\' '/dbpassword/{print $4}' /var/www/nextcloud/config/config.php)
G_CONFIG_INJECT "'instanceid'" "  'instanceid' => '$instanceid'," /var/www/nextcloud/config/config.php
mysql -e "grant all privileges on \`nextcloud\`.* to '$dbuser'@localhost identified by '$dbpassword';flush privileges"
dietpi-services start
[  OK  ] G_CONFIG_INJECT | Desired setting in /var/www/nextcloud/config/config.php was already set:   'instanceid' => '/mnt/dietpi_userdata/nextcloud_data/appdata_ockmco81oymb',

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: start 

[  OK  ] DietPi-Services | start : avahi-daemon
[  OK  ] DietPi-Services | start : nmbd
[  OK  ] DietPi-Services | start : smbd
[  OK  ] DietPi-Services | start : redis-server
[  OK  ] DietPi-Services | start : mariadb
[  OK  ] DietPi-Services | start : php8.2-fpm
[  OK  ] DietPi-Services | start : apache2
[  OK  ] DietPi-Services | start : mpd
[  OK  ] DietPi-Services | start : shairport-sync
[  OK  ] DietPi-Services | start : squeezelite
[  OK  ] DietPi-Services | start : gmediarender
[  OK  ] DietPi-Services | start : networkaudiod
[  OK  ] DietPi-Services | start : roonbridge
[  OK  ] DietPi-Services | start : filebrowser
[  OK  ] DietPi-Services | start : netdata
[  OK  ] DietPi-Services | start : cron

web browser now says this when try to connect to Nextcloud…
Screenshot from 2024-02-29 15-02-06

ah! I waited a bit and now it seems to take me to the login screen. Is it ok to log in now?

yes should be ok

@Jappe @MichaIng thank you so much! It seems to have worked. You’re both absolute stars! :kissing_heart:

1 Like

sorry… slight issue I now get this when connecting to the Dietpi file browser in the browser

and this when connecting to the DietPi Dashboard in the browser

Any ideas?

Pls open new topics as they are not related. As well share the URL or apps you are trying to open.

Ok super thanks. I have registered a new topic here

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.