Host ID SD Card Generic 4GB: Difference between revisions

From embeddedTS Manuals
(Initial creation. Turned in to a subpage for ease of use. Removed use of "you".)
 
(Cleaned up formatting, more clarifications)
Line 1: Line 1:
Plug the SD card into a USB reader (or native port if the host PC offers one) and connect it to a Linux workstation PC. Newer distributions include a utility called 'lsblk' which lists all block devices like a USB SD card adapter:
''' 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|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 that this command may need to be run as the root user):
<source lang=bash>
<source lang=bash>
lsblk
$ 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 
</source>
</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 "sdX" is not the real device name, it could be sda, sdb, mmcblk0, etc., so be sure to match up the real device name with the SD card. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.
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' '''
----


Alternatively, after plugging in the device after Linux has booted, the command 'dmesg' can be used to print out the kernel log. When a new device is added to the system, information about it will be appended to the kernel logs. For example:
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):
<source lang=bash>dmesg | tail -n 100</source>


  scsi 54:0:0:0: Direct-Access    Generic  Storage Device  0.00 PQ: 0 ANSI: 2
<source lang=bash>
  sd 54:0:0:0: Attached scsi generic sg2 type 0
$ dmesg
  sd 54:0:0:0: [sdX] 3862528 512-byte logical blocks: (3.97 GB/3.84 GiB)
...
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)
...
</source>


In this case, sdX is shown as a 3.97GB card. Note that "sdX" is not the real device name, it could be sda, sdb, mmcblk0, etc., so be sure to match up the real device name with the SD card. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.
In this case, sdX is shown as a 3.97GB card. 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!

Revision as of 17:46, 24 January 2020

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 that 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. 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!