TS-7680 MicroSD Backup: Difference between revisions

From embeddedTS Manuals
(Removed web interface information.)
(Update to specify both stock and 4.9 image)
Line 1: Line 1:
{|  
{|  
| [[File:MicroSD.png|70px|link=ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2]]
| [[File:MicroSD8GB.png|70px|link=ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2]]
| [ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2 Click to download the latest 4GB SD card image.]
| [ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2 Click to download the latest 4GB SD card image.]
|}
|}


''' Using another Linux workstation '''
{{:Host_ID_SD_Card_Generic_4GB}}


If you do not have an SD card that can boot to the initramfs, you can download the [ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2 latest SD card image] and rewrite this from a Linux workstation.  A USB MicroSD adapter can be used to access the card.  First, you must find out which /dev/ device corresponds with your USB reader/writer. 


Step 1 Option 1 (lsblk)
The instructions below use the [[#Software_Images|latest stock image]].
----


Newer distributions include a utility called "lsblk" which allows simple identification of the intended card:
Once the target /dev/ device has been located, the 'dd' command can now be used to backup/restore the card to our stock image:
<source lang=bash>
lsblk
</source>
  NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  sdY      8:0    0  400G  0 disk
  ├─sdY1  8:1    0  398G  0 part /
  ├─sdY2  8:2    0    1K  0 part
  └─sdY5  8:5    0    2G  0 part [SWAP]
  sr0    11:0    1  1024M  0 rom 
  sdX      8:32  1  3.9G  0 disk
  ├─sdX1  8:33  1  7.9M  0 part
  ├─sdX2  8:34  1    2M  0 part
  ├─sdX3  8:35  1    2M  0 part
  └─sdX4  8:36  1  3.8G  0 part 
 
In this case the SD card is 4GB, so sdX is the target device.  Note that on your system, sdX will not be a real device, it could be sda, sdb, mmcblk0, etc.  Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.
 
Step 1 Option 2 (dmesg)
----
 
After plugging in the device, you can use dmesg to list
 
  scsi 54:0:0:0: Direct-Access    Generic  Storage Device  0.00 PQ: 0 ANSI: 2
  sd 54:0:0:0: Attached scsi generic sg2 type 0
  sd 54:0:0:0: [sdX] 3862528 512-byte logical blocks: (3.97 GB/3.84 GiB)
 
In this case, sdXc is shown as a 3.97GB card.  Note that on your system, sdX will not be a real device, it could be sda, sdb, mmcblk0, etc.  Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.
 
Step 2
----
 
Once you have the target /dev/ device you can use "dd" to backup/restore the card.  To restore the board to stock, or rewrite to the latest SD image:
<source lang=bash>
<source lang=bash>
# Specify the correct block device obtained above instead of /dev/sdX
# Note that this is a whole disk image, be sure to use /dev/sdX instead
# of a partition, e.g. /dev/sdX1
wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2
wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2
# Specify your block device instead of /dev/sdX
# Note that this is a whole disk image, so use /dev/sdX instead of
# using /dev/sdX1
bzcat ts7680-latest.dd.bz2 | dd conv=fsync bs=4M of=/dev/sdX
bzcat ts7680-latest.dd.bz2 | dd conv=fsync bs=4M of=/dev/sdX
</source>
</source>


To take a backup of your entire SD card, you can switch the input file and the output file:
 
It is also possible to use this process to update the TS-7680 to the [[#Linux_4.9.y_Images|Linux 4.9 kernel with Debian Stretch]] image. Please take a look at the [[#Caveats|Caveats of using Linux 4.9]] before proceeding in using this image.
<source lang=bash>
<source lang=bash>
# Specify your block device instead of /dev/sdX
# Specify the correct block device obtained above instead of /dev/sdX
dd if=/dev/sdX conv=fsync bs=4M | bzip2 > backup.dd.bz2
# Note that this is a whole disk image, be sure to use /dev/sdX instead
# of a partition, e.g. /dev/sdX1
wget http://ftp.embeddedarm.com/ftp/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-linux4.9-latest.dd.bz2
bzcat ts7680-linux4.9-latest.dd.bz2 | dd conv=fsync bs=4M of=/dev/sdX
</source>
</source>

Revision as of 18:03, 24 January 2020

MicroSD8GB.png Click to download the latest 4GB SD card image.

Using other OSs

At this time, we're unable to provide assistance with writing SD cards for our products from non-Linux based operating systems. We acknowledge however, that there are methods to write images and files from a variety of difference operating systems. If a native installation of Linux is unavailable, we recommend using a Virtual Machine. See the Getting Started section for links to common virtualization software and Linux installation.

Using a Linux workstation

An SD card can be written to allow it to be bootable. Download the above file and write this from a Linux workstation using the information below. A USB SD adapter can be used to access the card; or if the workstation supports direct connection of SD cards, that can be used instead. Once inserted in to the workstation, it is necessary to discover which /dev/ device corresponds with the inserted SD card before the image can be written.

Option 1: using 'lsblk'


Newer distributions include a utility called 'lsblk' which allows simple identification of the intended card.

Note: This command may need to be run as the root user:
$ lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdY      8:0    0   400G  0 disk 
├─sdY1   8:1    0   398G  0 part /
├─sdY2   8:2    0     1K  0 part 
└─sdY5   8:5    0     2G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom  
sdX      8:32   1   3.9G  0 disk 
├─sdX1   8:33   1   7.9M  0 part 
├─sdX2   8:34   1     2M  0 part 
├─sdX3   8:35   1     2M  0 part 
└─sdX4   8:36   1   3.8G  0 part

In this case the, SD card is 4GB, so sdX is the target device and already contains 4 partitions. Note that sdX is not a real device, it could be sda, sdb, mmcblk0, etc. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card. The instructions below to write to the device will destroy the partition table and any existing data!

Option 2: Using 'dmesg'


After plugging in the device, the 'dmesg' command can be used to list recent kernel events. When inserting a USB adapter, the last few lines of 'dmesg' output will be similar to the following (note that this command may need to be run as the root user):

$ dmesg
...
scsi 54:0:0:0: Direct-Access     Generic  Storage Device   0.00 PQ: 0 ANSI: 2
sd 54:0:0:0: Attached scsi generic sg2 type 0
sd 54:0:0:0: [sdX] 3862528 512-byte logical blocks: (3.97 GB/3.84 GiB)
...

In this case, sdX is shown as a 3.97GB card with a single partition. Note that sdX is not a real device, it could be sda, sdb, mmcblk0, etc. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card. The instructions below to write to the device will destroy the partition table and any existing data!


The instructions below use the latest stock image.

Once the target /dev/ device has been located, the 'dd' command can now be used to backup/restore the card to our stock image:

# Specify the correct block device obtained above instead of /dev/sdX
# Note that this is a whole disk image, be sure to use /dev/sdX instead
# of a partition, e.g. /dev/sdX1
wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-latest.dd.bz2
bzcat ts7680-latest.dd.bz2 | dd conv=fsync bs=4M of=/dev/sdX


It is also possible to use this process to update the TS-7680 to the Linux 4.9 kernel with Debian Stretch image. Please take a look at the Caveats of using Linux 4.9 before proceeding in using this image.

# Specify the correct block device obtained above instead of /dev/sdX
# Note that this is a whole disk image, be sure to use /dev/sdX instead
# of a partition, e.g. /dev/sdX1
wget http://ftp.embeddedarm.com/ftp/ts-arm-sbc/ts-7680-linux/binaries/ts-images/ts7680-linux4.9-latest.dd.bz2
bzcat ts7680-linux4.9-latest.dd.bz2 | dd conv=fsync bs=4M of=/dev/sdX