TS-7180 eMMC Backup/restore: Difference between revisions

From embeddedTS Manuals
(U-Boot on boards in engineering sampling needs ext4 filesystems without backwardly-incompatible format options)
(Improve comments, especially regarding what to do if mkfs.ext4 doesn't understand an option given in the example.)
Line 18: Line 18:
</source>
</source>


To write a new filesystem to the TS-7180:
To write a new filesystem to the TS-7180, first boot to an SD card or USB stick. Then re-image the eMMC:
<source lang=bash>
<source lang=bash>
dmesg | tail -n 30
# The eMMC is /dev/mmcblk1.
# Look for the last /dev/sd* device connected. This should also match the eMMC
#
# size of around 3.78GiB.  On my system, this is /dev/sdd.
# Ensure the media has an MBR (not GPT) partition table with exactly one partition.
# Re-partition the device with fdisk or gparted if it isn't already partitioned correctly.
 
sudo mkdir /mnt/emmc/
sudo mkdir /mnt/emmc/
sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
# If the above command fails, use fdisk or gparted to repartition the emmc
# If the above command fails, complaining of an invalid filesystem option, it is fine to omit that flag:
# to have one large partition.
# An older mkfs.ext4 that doesn’t understand it also can’t create a backwards compatibility issue.
 
sudo mount /dev/mmcblk1p1 /mnt/emmc/
sudo mount /dev/mmcblk1p1 /mnt/emmc/
tar -xjf /path/to/ts7180-new-image.tar.bz2 -C /mnt/emmc
tar -xjf /path/to/ts7180-new-image.tar.bz2 -C /mnt/emmc

Revision as of 18:16, 1 October 2021

The simplest way to backup/restore the eMMC is through u-boot. If you boot up and stop in u-boot you can run this command:

ums 0 mmc 1

This will make the board act as a USB mass storage device with direct access to the emmc disk. On a linux workstation, to backup the image:

dmesg | tail -n 30
# Look for the last /dev/sd* device connected.  This should also match the eMMC
# size of around 3.78GiB.  On my system, this is /dev/sdd.
sudo mkdir /mnt/emmc/
sudo mount /dev/mmcblk1p1 /mnt/emmc/
cd /mnt/emmc/
tar -cjf /path/to/ts7180-backup-image.tar.bz2
cd ../
umount /mnt/emmc/
sync

To write a new filesystem to the TS-7180, first boot to an SD card or USB stick. Then re-image the eMMC:

# The eMMC is /dev/mmcblk1.
#
# Ensure the media has an MBR (not GPT) partition table with exactly one partition.
# Re-partition the device with fdisk or gparted if it isn't already partitioned correctly.

sudo mkdir /mnt/emmc/

sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
# If the above command fails, complaining of an invalid filesystem option, it is fine to omit that flag:
# An older mkfs.ext4 that doesn’t understand it also can’t create a backwards compatibility issue.

sudo mount /dev/mmcblk1p1 /mnt/emmc/
tar -xjf /path/to/ts7180-new-image.tar.bz2 -C /mnt/emmc
umount /mnt/emmc/
sync