- Edited
Hi Nicolas,
on https://discuss.moodlebox.net/d/312-install-a-cloning-program-into-the-moodlebox I wanted to get an easy to use cloning program for the MoodleBox. My idea is that teachers should be able to copy a fully installed MoodleBox to usb sticks or to an usb card reader with microSD cards. One copy should be a backup. And you can share other copies to other teachers and classes so they cab get their own MoodleBoxes.
In MoodleBox 4.5.0 you installed the program rpi-clone from https://github.com/billw2/rpi-clone.
On Github you wrote that you tested the program and you wrote that it works. Please tell us, how to use it.
In my first tests I use a fresh microSD card with MoodleBox 4.5.1. I start the Raspberry Pi and the Moodlebox runs fine. I change nothing and I try to get a copy an an usb stick. First I look for the device name of the usb stick.
moodlebox@moodlebox:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 28.8G 0 disk
└─sda1 8:1 1 28.8G 0 part /media/usb0
mmcblk0 179:0 0 14.8G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14.6G 0 part /
moodlebox@moodlebox:~ $
Okay, my usb stick is sda and has one fat32 partition ... yes, it's a fresh formatted stick. The tutorial writes that I should use sudo rpi-clone sda
to get a copy.
moodlebox@moodlebox:~ $ sudo rpi-clone sda
Destination disk partition /dev/sda1 is mounted on /media/usb0.
The clone cannot proceed unless it is unmounted.
Do you want to unmount /media/usb0? (yes/no): yes
Booted disk: mmcblk0 15.9GB Destination disk: sda 31.0GB
---------------------------------------------------------------------------
Part Size FS Label Part Size FS Label
1 /boot 256.0M fat32 -- 1 256.0M fat32 --
2 root 14.6G ext4 MoodleBox by NMA 2 28.6G -- --
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - FS types conflict ==
1 /boot (31.0M used) : MKFS SYNC to sda1
2 root (2.5G 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 0407ed5f
Editing /mnt/clone/etc/fstab PARTUUID to use 0407ed5f
===============================
Done with clone to /dev/sda
Start - 17:59:54 End - 18:02:12 Elapsed Time - 2:18
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
===============================
moodlebox@moodlebox:~ $
The cloning works without an error. Now the MoodleBox should start with the usb stick. I remove the microSD card and switch the power on. I get the coloured start screen and a blinking green led but no boot process.
To get some ideas for the problem I look at the config.txt and the cmdline.txt. Both files are damaged so the Raspberry Pi can't boot from the copied usb stick. Do you have any idea?
Ralf