Here's a short guide to clone your MoodleBox currently running on a Raspberry Pi.
You should first log into the MoodleBox via SSH and begin a sudo
session:
sudo -Es
Step 1. Disable automounting of USB Drive
MoodleBox automatically mounts any drive inserted into one of its USB ports. This interferes with cloning, which needs the drive to be unmounted. We disable automounting by stopping the devmon
service:
systemctl stop devmon@moodlebox.service
Previous command is valid if your MoodleBox is based on MoodleBox image version 4.6 and later.
If you've got an older MoodleBox image version 4.5.x, 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!
umount /dev/sda*
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
systemctl start devmon@moodlebox.service
or for devices based on older MoodleBox images (version 4.5.x):
sed -i '/^ENABLED=*/c\ENABLED=1' /etc/usbmount/usbmount.conf
and exit sudo
exit