Here's a short guide to clone your MoodleBox currently running on a Raspberry Pi. This guide is valid if you've a MoodleBox image version 4.5.0 or later.
You should first log into the MoodleBox via SSH and begin a
Step 1. Disable automounting of USB Drive
MoodleBox automatically mount any drive inserted into one of its USB ports. This interferes with cloning, which needs the drive to be unmounted. We disable automounting by editing the file
/etc/usbmount/usbmount.conf, changing ENABLED=1 to ENABLED=0, then save. This can be done with the following command.
sed -i '/^ENABLED=*/c\ENABLED=0' /etc/usbmount/usbmount.conf
Step 2. Unmount the USB Drive and perform cloning
Warning! This will totally destroy anything on the USB Drive inserted. You've been warned!
mkfs.vfat -I /dev/sda
rpi-clone -f -U sda
The process will last about 20 minutes for a 16GB USB Drive.
Step 3. Re-enable automounting of USB Drive
sed -i '/^ENABLED=*/c\ENABLED=1' /etc/usbmount/usbmount.conf