4700 Backup/Restore SD: Difference between revisions

From embeddedTS Manuals
(Created page with "If backing up on a separate workstation, keep in mind windows does not have direct block device support needed to write these images. You will also need to determine the SD card...")
 
m (Links auto-updated for 2022 re-branding ( https://files.embeddedarm.com/ts-socket-macrocontrollers/ts-4700-linux/binaries/ts-images/2gbsd-4700-latest.dd.bz2 →‎ https://files.embeddedTS.com/ts-socket-macrocontrollers/ts-4700-linux/binaries/ts-images/2gbsd-4700-latest.dd.bz2))
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
If you are backing up directly on the board you will likely need to use some kind of offboard storage like a thumbdrive or external hard drive.  Make sure you have any nbd devices unmounted before trying to restore new ones.
If you are backing up directly on the board you will likely need to use some kind of offboard storage like a thumbdrive or external hard drive.  Make sure you have any nbd devices unmounted before trying to restore new ones.


You can find the latest SD card image [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4700-linux/binaries/ts-images/2GB-mSD-4700-latest.dd.bz2 here].  Make sure you decompress the image first before writing.
You can find the latest SD card image [https://files.embeddedTS.com/ts-socket-macrocontrollers/ts-4700-linux/binaries/ts-images/2gbsd-4700-latest.dd.bz2 here].  Make sure you decompress the image first before writing.


{{Note|Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks.  All of Technologic System's images are 10% smaller than the target disc size.  We STRONGLY recommend following that same practice on any mass-replicated images.}}
{{Note|Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks.  All of Technologic System's images are 10% smaller than the target disc size.  We STRONGLY recommend following that same practice on any mass-replicated images.}}
Line 14: Line 14:
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=4M
</source>
</source>
{{Note|Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks.  All of Technologic System's images are 10% smaller than the target disc size.  We STRONGLY recommend following that same practice on any mass-replicated images.}}
{{Note|Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks.  All of Technologic System's images are 10% smaller than the target disc size.  We STRONGLY recommend following that same practice on any mass-replicated images.}}
Line 20: Line 20:
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=4M
</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=4M
</source>
</source>


Line 32: Line 32:
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=4M
</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=4M of=/dev/mmcblk0p2
</source>
</source>


Initrd
Initrd
<source lang=bash>
<source lang=bash>
dd if=/initrd bs=32k of=/dev/mmcblk0p3
dd if=/initrd bs=4M of=/dev/mmcblk0p3
</source>
</source>


Line 51: Line 51:
Entire card
Entire card
<source lang=bash>
<source lang=bash>
dd if=/dev/mmcblk0 of=/path/to/backup.dd
dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=4M
</source>
</source>


Line 68: Line 68:
The entire card from SBC
The entire card from SBC
<source lang=bash>
<source lang=bash>
dd if=/path/to/2GB-mSD-4700-latest.dd of=/dev/mmcblk0
dd if=/path/to/2GB-mSD-4700-latest.dd of=/dev/mmcblk0 bs=4M
</source>
</source>


Line 80: Line 80:
dd if=/mnt/root/initrd of=/dev/mmcblk0p3
dd if=/mnt/root/initrd of=/dev/mmcblk0p3
</source>
</source>
''' Expected Partition Layout '''
{| class="wikitable"
|-
! Partition
! Contents
|-
| 1
| FAT32 (empty)
|-
| 2
| kernel binary (0xda)
|-
| 3
| initrd (0xda)
|-
| 4
| Debian root filesystem (EXT3)
|}

Latest revision as of 16:22, 17 January 2022

If backing up on a separate workstation, keep in mind windows does not have direct block device support needed to write these images. You will also need to determine the SD card 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.

If you are backing up directly on the board you will likely need to use some kind of offboard storage like a thumbdrive or external hard drive. Make sure you have any nbd devices unmounted before trying to restore new ones.

You can find the latest SD card image here. Make sure you decompress the image first before writing.

Note: Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks. All of Technologic System's images are 10% smaller than the target disc size. We STRONGLY recommend following that same practice on any mass-replicated images.

From Workstation


Backup

Entire SD card

dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=4M
Note: Not all SD cards are created equally, over time they tend to shrink in size due to automatic retiring of bad blocks. All of Technologic System's images are 10% smaller than the target disc size. We STRONGLY recommend following that same practice on any mass-replicated images.

Kernel

dd if=/dev/mmcblk0p2 of=/path/to/zImage bs=4M

Initrd

dd if=/dev/mmcblk0p3 of=/path/to/initrd bs=4M

Restore

Entire SD card

dd if=/path/to/backup.dd of=/dev/mmcblk0 bs=4M

Kernel

dd if=/path/to/zImage bs=4M of=/dev/mmcblk0p2

Initrd

dd if=/initrd bs=4M of=/dev/mmcblk0p3

From SBC


Backup

Entire card

dd if=/dev/mmcblk0 of=/path/to/backup.dd bs=4M

Kernel

dd if=/dev/mmcblk0p2 of=/path/to/backup.dd

Initrd

dd if=/dev/mmcblk0p3 of=/path/to/backup.dd

Restore

The entire card from SBC

dd if=/path/to/2GB-mSD-4700-latest.dd of=/dev/mmcblk0 bs=4M

Kernel

dd if=/mnt/root/zImage of=/dev/mmcblk0p2

Initrd

dd if=/mnt/root/initrd of=/dev/mmcblk0p3

Expected Partition Layout

Partition Contents
1 FAT32 (empty)
2 kernel binary (0xda)
3 initrd (0xda)
4 Debian root filesystem (EXT3)