75XX MicroSD Recovery: Difference between revisions
No edit summary |
m (Links auto-updated for 2022 re-branding ( https://files.embeddedarm.com/ts-arm-sbc/ts-7520-linux/binaries/ts-images/dblstorimg-4gbsd-latest.dd.bz2 → https://files.embeddedTS.com/ts-arm-sbc/ts-7520-linux/binaries/ts-images/dblstorimg-4gbsd-latest.dd.bz2)) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
These instructions for rewriting the SD card must be done either on the arm system, or on a linux workstation. We do not support any method using Windows to rewrite the cards, but many virtual machines offer USB redirection which will also work with the USB card reader supplied in the development kit. The methods using dd and sdctl to rewrite the SD card will completely erase everything on the card and set up our MBR, kernel, intird, and Debian filesystem. No prior formatting to the card is needed. | |||
After plugging in the USB adapter to your PC you will need to determine the block device. You can usually find this in the output of 'dmesg' after inserting the SD card and you will typically see something like '/dev/sdb' as the block device and '/dev/sdb1' for the first partition. On some newer kernels you will see '/dev/mmcblk0' as the block device and '/dev/mmcblkop1' for the first partition. For these examples I will use the '/dev/mmcblk0' format. | |||
You can find the latest SD card image [ | You can find the latest SD card image [https://files.embeddedTS.com/ts-arm-sbc/ts-7520-linux/binaries/ts-images/dblstorimg-4gbsd-latest.dd.bz2 here]. Make sure you decompress the image first before writing. For example to decompress on most Linux workstations you can run: | ||
<source lang=bash> | |||
bzip2 -d dblstorimg-4gbsd-latest.dd.bz2 | |||
</source> | |||
To update to our latest image from your workstation: | |||
<source lang=bash> | |||
dd if=/path/to/dblstorimg-4gbsd-latest.dd of=/dev/mmcblk0 bs=32k && sync && sync | |||
</source> | |||
''' From Workstation ''' | ''' From Workstation ''' | ||
Line 9: | Line 18: | ||
'''Backup ''' | '''Backup ''' | ||
Entire SD card | Entire SD card | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=32k | dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=32k && sync && sync | ||
</source> | </source> | ||
Kernel | Kernel | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/dev/mmcblk0p2 of=/path/to/zImage bs=32k | dd if=/dev/mmcblk0p2 of=/path/to/zImage bs=32k && sync && sync | ||
</source> | </source> | ||
Initrd | Initrd | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/dev/mmcblk0p3 of=/path/to/initrd bs=32k | dd if=/dev/mmcblk0p3 of=/path/to/initrd bs=32k && sync && sync | ||
</source> | </source> | ||
Line 28: | Line 38: | ||
Entire SD card | Entire SD card | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/path/to/backup.dd of=/dev/mmcblk0 bs=32k | dd if=/path/to/backup.dd of=/dev/mmcblk0 bs=32k && sync | ||
</source> | </source> | ||
Kernel | Kernel | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/path/to/zImage bs=32k of=/dev/mmcblk0p2 | dd if=/path/to/zImage bs=32k of=/dev/mmcblk0p2 && sync | ||
</source> | |||
Initrd | |||
<source lang=bash> | |||
dd if=/initrd bs=32k of=/dev/mmcblk0p3 && sync | |||
</source> | </source> | ||
Line 39: | Line 54: | ||
---- | ---- | ||
'''Backup''' | '''Backup''' | ||
Entire card | Entire card | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/dev/nbd5 of=/path/to/backup.dd bs=512 conv=sync | # Determine the block size | ||
eval $(sdctl) | |||
dd if=/dev/nbd5 of=/path/to/backup.dd bs=512 count=$cardsize_sectors conv=sync && sync | |||
</source> | </source> | ||
Kernel | Kernel | ||
<source lang=bash> | <source lang=bash> | ||
sdctl -R 4096 -z 512 --seek part1 > kernel | |||
</source> | </source> | ||
Initrd | Initrd | ||
<source lang=bash> | <source lang=bash> | ||
sdctl -R 4096 -z 512 --seek part2 > initrd | |||
</source> | </source> | ||
Line 58: | Line 76: | ||
The entire card from SBC | The entire card from SBC | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/path/to/2gbsd-noeclipse-latest.dd bs=512 conv=sync of=/dev/nbd5 | dd if=/path/to/2gbsd-noeclipse-latest.dd bs=512 conv=sync of=/dev/nbd5 && sync | ||
</source> | </source> | ||
Kernel | Kernel | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/mnt/root/zImage bs=512 conv=sync of=/dev/nbd7 | dd if=/mnt/root/zImage bs=512 conv=sync of=/dev/nbd7 && sync | ||
</source> | </source> | ||
Initrd | Initrd | ||
<source lang=bash> | <source lang=bash> | ||
dd if=/mnt/root/initrd bs=512 conv=sync of=/dev/nbd8 | dd if=/mnt/root/initrd bs=512 conv=sync of=/dev/nbd8 && sync | ||
</source> | </source> |
Latest revision as of 16:27, 17 January 2022
These instructions for rewriting the SD card must be done either on the arm system, or on a linux workstation. We do not support any method using Windows to rewrite the cards, but many virtual machines offer USB redirection which will also work with the USB card reader supplied in the development kit. The methods using dd and sdctl to rewrite the SD card will completely erase everything on the card and set up our MBR, kernel, intird, and Debian filesystem. No prior formatting to the card is needed.
After plugging in the USB adapter to your PC you will need to determine the block device. You can usually find this in the output of 'dmesg' after inserting the SD card and you will typically see something like '/dev/sdb' as the block device and '/dev/sdb1' for the first partition. On some newer kernels you will see '/dev/mmcblk0' as the block device and '/dev/mmcblkop1' for the first partition. For these examples I will use the '/dev/mmcblk0' format.
You can find the latest SD card image here. Make sure you decompress the image first before writing. For example to decompress on most Linux workstations you can run:
bzip2 -d dblstorimg-4gbsd-latest.dd.bz2
To update to our latest image from your workstation:
dd if=/path/to/dblstorimg-4gbsd-latest.dd of=/dev/mmcblk0 bs=32k && sync && sync
From Workstation
Backup
Entire SD card
dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=32k && sync && sync
Kernel
dd if=/dev/mmcblk0p2 of=/path/to/zImage bs=32k && sync && sync
Initrd
dd if=/dev/mmcblk0p3 of=/path/to/initrd bs=32k && sync && sync
Restore
Entire SD card
dd if=/path/to/backup.dd of=/dev/mmcblk0 bs=32k && sync
Kernel
dd if=/path/to/zImage bs=32k of=/dev/mmcblk0p2 && sync
Initrd
dd if=/initrd bs=32k of=/dev/mmcblk0p3 && sync
From SBC
Backup
Entire card
# Determine the block size
eval $(sdctl)
dd if=/dev/nbd5 of=/path/to/backup.dd bs=512 count=$cardsize_sectors conv=sync && sync
Kernel
sdctl -R 4096 -z 512 --seek part1 > kernel
Initrd
sdctl -R 4096 -z 512 --seek part2 > initrd
Restore
The entire card from SBC
dd if=/path/to/2gbsd-noeclipse-latest.dd bs=512 conv=sync of=/dev/nbd5 && sync
Kernel
dd if=/mnt/root/zImage bs=512 conv=sync of=/dev/nbd7 && sync
Initrd
dd if=/mnt/root/initrd bs=512 conv=sync of=/dev/nbd8 && sync