Hi Nicolas,
I test exactly what you wrote.
moodlebox@moodlebox:~ $ sudo su
root@moodlebox:/home/moodlebox# nano /etc/usbmount/usbmount.conf
root@moodlebox:/home/moodlebox# umount /dev/sda1; sudo umount /dev/sda2
umount: /dev/sda1: not mounted.
umount: /dev/sda2: no mount point specified.
root@moodlebox:/home/moodlebox# sudo mkfs.vfat -I /dev/sda
mkfs.fat 4.2 (2021-01-31)
root@moodlebox:/home/moodlebox# sudo rpi-clone -f sda
Booted disk: mmcblk0 15.9GB Destination disk: sda 31.0GB
---------------------------------------------------------------------------
Part Size FS Label Part Size FS Label
1 /boot 256.0M fat32 -- 1 28.9G fat32 --
2 root 14.6G ext4 MoodleBox by NMA
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - forced by option ==
1 /boot (31.0M used) : MKFS SYNC to sda1
2 root (2.3G used) : RESIZE MKFS SYNC to sda2
---------------------------------------------------------------------------
Run setup script : no.
Verbose mode : no.
-----------------------:
** WARNING ** : All destination disk sda data will be overwritten!
-----------------------:
Initialize and clone to the destination disk sda? (yes/no): yea
Aborting!
root@moodlebox:/home/moodlebox# sudo rpi-clone -f sda
Booted disk: mmcblk0 15.9GB Destination disk: sda 31.0GB
---------------------------------------------------------------------------
Part Size FS Label Part Size FS Label
1 /boot 256.0M fat32 -- 1 28.9G fat32 --
2 root 14.6G ext4 MoodleBox by NMA
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - forced by option ==
1 /boot (31.0M used) : MKFS SYNC to sda1
2 root (2.3G used) : RESIZE MKFS SYNC to sda2
---------------------------------------------------------------------------
Run setup script : no.
Verbose mode : no.
-----------------------:
** WARNING ** : All destination disk sda data will be overwritten!
-----------------------:
Initialize and clone to the destination disk sda? (yes/no): yes
Optional destination ext type file system label (16 chars max):
Initializing
Imaging past partition 1 start.
=> dd if=/dev/mmcblk0 of=/dev/sda bs=1M count=8 ...
Resizing destination disk last partition ...
Resize success.
Changing destination Disk ID ...
=> mkfs -t vfat -F 32 /dev/sda1 ...
=> mkfs -t ext4 /dev/sda2 ...
Syncing file systems (can take a long time)
Syncing mounted partitions:
Mounting /dev/sda2 on /mnt/clone
=> rsync // /mnt/clone with-root-excludes ...
Mounting /dev/sda1 on /mnt/clone/boot
=> rsync /boot/ /mnt/clone/boot ...
Editing /mnt/clone/boot/cmdline.txt PARTUUID to use 0ba945b4
Editing /mnt/clone/etc/fstab PARTUUID to use 0ba945b4
===============================
Done with clone to /dev/sda
Start - 08:52:17 End - 09:48:43 Elapsed Time - 56:26
Cloned partitions are mounted on /mnt/clone for inspection or customizing.
Hit Enter when ready to unmount the /dev/sda partitions ...
unmounting /mnt/clone/boot
unmounting /mnt/clone
===============================
root@moodlebox:/home/moodlebox#
Now the process needed 56:26 minutes ... yes, more than 20 minutes.
Now I start the MoodleBox from the cloned usb stick. Yes, it starts bit it's very slow. No, it can't be the usb stick. I used it with the Raspberry Pi Imager before to make a stick for MoodleBox 4.5.1. This stick started normally and very fast. I formatted the stick with FAT32 and then I started the current test with rpi-clone.
Purging the caches takes a very long time.
Could there be a problem that the MoodleBox was cloned fron the microSD card and should now run from the usb slot? I can't believe this because the MoodleBox normally starts fine from the usb slot with the same settings.
moodlebox@moodlebox:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 28.9G 0 disk
├─sda1 8:1 1 256M 0 part /boot
└─sda2 8:2 1 28.6G 0 part /
moodlebox@moodlebox:~ $
Or could there be a problem with the database. The database was running while the cloning process run.
root@moodlebox:/# /usr/bin/php7.4 /var/www/moodle/admin/cli/check_database_schema.php
Database structure is ok.
root@moodlebox:/#
I have the idea to install the plugin report_benchmark but there seems to be no chance with this processing speed. Yes, the installation of the plugin needs a very long time but it's finished ... and also the execution.