TS-4720 eMMC Backup/restore: Difference between revisions
From embeddedTS Manuals
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
{{Warning|Make sure the SD and eMMC filesystems are mounted read only while writing any images. If dd is used to read or write a disk while a filesystem on it is mounted read/write this can result in a corrupt image.}} | {{Warning|Make sure the SD and eMMC filesystems are mounted read only while writing any images. If dd is used to read or write a disk while a filesystem on it is mounted read/write this can result in a corrupt image.}} | ||
First boot to the initramfs. These steps should '''not be run from the full Debian environment''', so to get back to the initramfs, first run: | |||
<source lang=bash> | |||
tshwctl --removejp 1 && reboot | |||
</source> | |||
Once you are in the initramfs, mount a network share or usb drive containing the emmc image. | |||
''' Write an Image to eMMC ''' | ''' Write an Image to eMMC ''' | ||
<source lang=bash> | <source lang=bash> | ||
# Check /mnt/root. If it shows a file "root.version", you can proceed. | |||
#/dev/ | # If it shows nothing, you need to wait for the Debian filesystem | ||
ls /mnt/root/ | |||
# | |||
# | |||
# Plug in a thumbdrive formatted with ext2/3/4 or fat32/ntfs | |||
mkdir /mnt/usbdev | |||
mount /dev/sda1 /mnt/usbdev | |||
umount -l /mnt/root/ | |||
# Tell sdctl to pause so we don't kill it during a burst | |||
killall -USR1 sdctl | |||
# Allow time for any buffered writes to finish | |||
sleep 5 | |||
killall sdctl | |||
# The dblstor-disable command only tells the card to | |||
# ignore any doublestore metadata on the eMMC during | |||
# | # this write. It does not prevent reading/writing doublestore | ||
# formatted media. | |||
# This command can be expected to take about 10 minutes | |||
sdctl --lun 1 -z 65536 --dblstor-disable -i /mnt/usbdev/emmc-image.dd | |||
reboot | |||
</source> | </source> | ||
These steps can write the eMMC image to use a single-card [[#Doublestore]], or you can write the [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4710-linux/binaries/ts-images/4gbsd-471x-latest.dd.bz2 SD Image]] to not use doublestore. | |||
''' Save an image from eMMC ''' | |||
<source lang=bash> | <source lang=bash> | ||
# | # Plug in a thumbdrive formatted with ext2/3/4 or fat32 | ||
mkdir /mnt/usbdev | |||
mount /dev/sda1 /mnt/usbdev | |||
umount -l /mnt/root/ | |||
# | # Tell sdctl to pause so we don't kill it during a burst | ||
killall -USR1 sdctl | |||
# | # Allow time for any buffered writes to finish | ||
sleep 5 | |||
killall sdctl | |||
sdctl --lun 1 -z 65536 --dblstor-disable --nbdserver lun1:disc | |||
nbd-client 127.0.0.1 7500 /dev/nbd1 | |||
dd if=/dev/nbd1 bs=4M of=/mnt/usbdev/emmc-image.dd | |||
sync | |||
dd if=/dev/nbd1 of=/mnt/ | |||
</source> | </source> |
Revision as of 10:40, 10 June 2014
Click to download the latest 4GB SD card image. |
WARNING: | Make sure the SD and eMMC filesystems are mounted read only while writing any images. If dd is used to read or write a disk while a filesystem on it is mounted read/write this can result in a corrupt image. |
First boot to the initramfs. These steps should not be run from the full Debian environment, so to get back to the initramfs, first run:
tshwctl --removejp 1 && reboot
Once you are in the initramfs, mount a network share or usb drive containing the emmc image.
Write an Image to eMMC
# Check /mnt/root. If it shows a file "root.version", you can proceed.
# If it shows nothing, you need to wait for the Debian filesystem
ls /mnt/root/
# Plug in a thumbdrive formatted with ext2/3/4 or fat32/ntfs
mkdir /mnt/usbdev
mount /dev/sda1 /mnt/usbdev
umount -l /mnt/root/
# Tell sdctl to pause so we don't kill it during a burst
killall -USR1 sdctl
# Allow time for any buffered writes to finish
sleep 5
killall sdctl
# The dblstor-disable command only tells the card to
# ignore any doublestore metadata on the eMMC during
# this write. It does not prevent reading/writing doublestore
# formatted media.
# This command can be expected to take about 10 minutes
sdctl --lun 1 -z 65536 --dblstor-disable -i /mnt/usbdev/emmc-image.dd
reboot
These steps can write the eMMC image to use a single-card #Doublestore, or you can write the SD Image] to not use doublestore.
Save an image from eMMC
# Plug in a thumbdrive formatted with ext2/3/4 or fat32
mkdir /mnt/usbdev
mount /dev/sda1 /mnt/usbdev
umount -l /mnt/root/
# Tell sdctl to pause so we don't kill it during a burst
killall -USR1 sdctl
# Allow time for any buffered writes to finish
sleep 5
killall sdctl
sdctl --lun 1 -z 65536 --dblstor-disable --nbdserver lun1:disc
nbd-client 127.0.0.1 7500 /dev/nbd1
dd if=/dev/nbd1 bs=4M of=/mnt/usbdev/emmc-image.dd
sync