-
Notifications
You must be signed in to change notification settings - Fork 11
Cloning_UP_Board_disk
The steps below assume a Ubuntu installation with a default partition layout.
Required:
Ubuntu USB Live disk.
USB Storage Disk EXT4 formatted greater than the size of UP Board eMMC disk to be cloned.
- Plug the Ubuntu Live Disk and storage disk into the UP Board to be cloned
- Power cycle board and press F7 for boot options.
- Select the Ubuntu Live Disk and press Enter
- Make sure the storage disk is mounted in
/media/upboard/<storage disk name>/
- Create an image of the eMMC disk.
sudo dd if=/dev/mmcblk0 of=/media/upboard/<storage disk name>/upboard_image.img bs=1M status=progress
This step is useful where the new target disk is smaller than the original source disk.
- Map the image file created in the previous steps to a loopback block device.
sudo losetup -f /media/upboard/<storage disk name>/upboard_image.img
- Get the loopback block device name setup in the previous step
losetup | grep upboard_image | cut -d " " -f1
/dev/loop1
- Resize the image partitions using gparted
sudo gparted /dev/loop1
- When finished resizing in Gparted, detach the image file from the loop device
sudo losetup -d /dev/loop1
- Shrink the size of the image file to some size in bytes, big enough to contain all the partitions along with some free space at the end.
truncate upboard_image.img -s 15572402176
- Plug Ubuntu Live Disk and storage disk with image file into UP Board
- Power cycle board and press F7 for boot options.
- Select Ubuntu Live Disk and press Enter
- Make sure the storage disk is mounted in
/media/upboard/<storage disk name>/
- Copy the image file to the UP Board
sudo dd if=upboard_image.img of=/dev/mmcblk0 bs=1M status=progress && sync
Warning: The UP Board secondary GPT data is stored at the end of the eMMC storage device. If this GPT data is overridden in the above steps the board will be BRICKED!!!. It is important to complete the following step to ensure valid secondary GPT data before rebooting the device
sudo gdisk /dev/mmcblk0
At the gdisk prompt enter the options to repair the GPT parition table:
-
v and Enter to verify disk
-
x and Enter to enter expert mode
-
e and Enter to relocate backup data structures to the end of the disk
-
w and Enter to write changes to disk
-
q and Enter to quit gdisk
-
Re-scan the partition table and create a block device for each partition
sudo partprobe /dev/mmcblk0
- Check and fix any filesystem errors on the partitions
sudo fsck -f -y /dev/mmcblk0p1
sudo fsck -f -y /dev/mmcblk0p2
- Power of the board, remove the Ubuntu live USB stick and disk with the image file
sudo poweroff
NOTE: This wiki is the main source of documentation for developers working with (or contributing to) the UP products. If this is your first time hearing about UP, we recommend starting with our main UP website, and our UP community page.