TS-4900 eMMC Backup/restore: Difference between revisions
From embeddedTS Manuals
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
mount /dev/mmcblk2p1 /mnt/emmc | mount /dev/mmcblk2p1 /mnt/emmc | ||
wget ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/fido/ts-x11-image-tsimx6-latest.tar.bz2 | wget ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/fido/ts-x11-image-tsimx6-latest.tar.bz2 | ||
tar -xf ts-x11-image-tsimx6-latest.tar.bz2 -C /mnt/emmc | tar --numeric-owner -xf ts-x11-image-tsimx6-latest.tar.bz2 -C /mnt/emmc | ||
umount /mnt/emmc | umount /mnt/emmc | ||
sync | sync | ||
Line 37: | Line 37: | ||
mount /dev/mmcblk1p1 /mnt/sd/ | mount /dev/mmcblk1p1 /mnt/sd/ | ||
cd /mnt/sd/ | cd /mnt/sd/ | ||
tar -cjf /root/backup.tar.bz2 * | tar --numeric-owner -cjf /root/backup.tar.bz2 * | ||
cd - | cd - | ||
umount /mnt/sd/ | umount /mnt/sd/ | ||
</source> | </source> |
Revision as of 10:29, 27 September 2017
Write the image:
These commands assume you are booted to the SD card, and
# Verify nothing else has this mounted
umount /dev/mmcblk2p1
mkfs.ext3 /dev/mmcblk2p1
mkdir /mnt/emmc
mount /dev/mmcblk2p1 /mnt/emmc
wget ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/fido/ts-x11-image-tsimx6-latest.tar.bz2
tar --numeric-owner -xf ts-x11-image-tsimx6-latest.tar.bz2 -C /mnt/emmc
umount /mnt/emmc
sync
Note: | The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used with ext4 for proper compatibility. Older versions of e2fsprogs do not need these options passed nor are they needed for ext3. |
After it is written you can verify the data was written correctly.
# Drop any block cache
echo 3 > /proc/sys/vm/drop_caches
mount /dev/mmcblk2p1 /mnt/emmc
cd /mnt/emmc/
sudo md5sum -c md5sums.txt
umount /mnt/emmc
sync
The md5sum command will report what differences there are, if any, and return if it passed or failed.
Backup the image:
First boot the board to any SD image. The SD should have enough space for the compressed image of your eMMC. From our default image this is ~500MB. To create an image to your SD card:
mkdir /mnt/sd/
mount /dev/mmcblk1p1 /mnt/sd/
cd /mnt/sd/
tar --numeric-owner -cjf /root/backup.tar.bz2 *
cd -
umount /mnt/sd/