09-03-2020, 06:43 PM
To flash the SD card, you need to replace the whole partition scheme and any file systems on the card with what's in the image. I.e. it's not enough to copy the image into an existing filesystem on the card; you need to overwrite whatever filesystem and partition setup that's on the card (which also means it doesn't matter how the card is formatted to begin with).
I prefer to use 'dd' to write disk images. Make absolutely sure you have the correct device name for your SD card; using the wrong one might overwrite your hard drive! I usually run 'sudo journalctl -f' and watch the output while inserting my card to see the device name. The output might look something like this:
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SL16G 14.5 GB
mmcblk0: p1 p2
This means that the card (block) device is called mmcblk0 (and it has two existing partitions: p1 and p2). Devices are accessed under /dev in the file system, so the complete path in this case is '/dev/mmcblk0' (which I will use in the example below).
The image is compressed with xz. Write it like this:
xzcat ubuntu-touch-pinephone.img.xz | sudo dd of=/dev/mmcblk0 bs=1M status=progress
This uncompresses the xz image and pipes it to dd that does the actual writing to the card.
I prefer to use 'dd' to write disk images. Make absolutely sure you have the correct device name for your SD card; using the wrong one might overwrite your hard drive! I usually run 'sudo journalctl -f' and watch the output while inserting my card to see the device name. The output might look something like this:
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SL16G 14.5 GB
mmcblk0: p1 p2
This means that the card (block) device is called mmcblk0 (and it has two existing partitions: p1 and p2). Devices are accessed under /dev in the file system, so the complete path in this case is '/dev/mmcblk0' (which I will use in the example below).
The image is compressed with xz. Write it like this:
xzcat ubuntu-touch-pinephone.img.xz | sudo dd of=/dev/mmcblk0 bs=1M status=progress
This uncompresses the xz image and pipes it to dd that does the actual writing to the card.