What to do with a Linux OS microSD image file?

7

I am trying to install Ubuntu on the Odroid U2 SoC (http://www.hardkernel.com/renewal_2011/products/prdt_info.php)

From this site I downloaded the "Micro-SD image file" (http://com.odroid.com/sigong/prev_forum/t2005-linaro-ubuntu-1211-for-odroid-u2.html)

I will admit that I'm lost and unsure what to do at this point. Do I transfer this file (ending in .img.xz) onto the MicroSD card, then just plug in the microSD to the Odroid? Or do I somehow "install" the image on the microSD then when the microSD is plugged into the Odroid the OS boots automatically?

Thanks for any help.

JDS

Posted 2013-07-07T09:02:56.593

Reputation: 37

Answers

11

I don't use that board but the logic is that, you need to extract the compressed image (.xz) by

unxz image_file.img.xz

The image file should contain all you need (Linux File system, Kernel, ....)

Then locate your SD card by fdisk -l. If you are using micro-sd adapter, then it could be linked as /dev/mmcblk or if you are using USB-SD converter, the device name might be linked as /dev/sdb. (if you see sdb1 sdb2, etc., they refer the 1st partition, 2nd partition ...)

Make sure that the SD card (and any partition) is not mounted, you should use umount -a or umount /dev/sdb1 (2/3 ... for the partitions), otherwise you may need to deal further problems

then you can load the image to the SD card by

dd if=imagefile.img of=/dev/sdb bs=4M conv=fsync

when the process finishes, you can eject the SD card and place it into the board. Then power the board.

Angs

Posted 2013-07-07T09:02:56.593

Reputation: 900

Outstanding answer. I wish the BeagleBoard folks would have provided the same at BeagleBone Black | Flashing eMMC. It would have saved me so much grief...

– jww – 2015-12-22T05:40:21.170

I suspect that they considered it to basic to list. It is easy to make mistakes like that when you are a product expert. (And not just in computers). – Hennes – 2015-12-22T08:35:09.533

2image_file.img.xz doesn't look like a tar archive, just a single file compressed with xz. So a simple unxz image_file.img.xz should be enough to produce image_file.img. – liori – 2013-07-07T15:34:52.517

1liori, you are right. I amended the answer. – Angs – 2013-07-07T20:24:58.583

3

Here is the actual best way. In one step:

xz -dc yourthing.xz | dd of=/dev/sdX bs=4M

Make sure you get the right device for /dev/sdX (fdisk -l).

BONUS EDIT: To get output from dd, run this in another terminal:

while pkill -USR1 dd 2>/dev/null; do sleep 5; done

ACK_stoverflow

Posted 2013-07-07T09:02:56.593

Reputation: 501

1+1 for this being the correct answer. You can also use Ctrl+T on some terminal emulators to get the dd status without needing the extra command. – Yona Appletree – 2016-01-14T19:37:14.340

1

Use xz to extract the .img file, then use dd to write it directly to the card.

Ignacio Vazquez-Abrams

Posted 2013-07-07T09:02:56.593

Reputation: 100 516

1

the right steps:

xz -d nameofimage.img.xz

fdisk -l (see which letter yours cd card has)

umount dev/sdX (replace X with the letter)

A good step is always to clear your destination media first! dd if=/dev/zero of=/dev/sdX bs=4M

sudo dd if=nameofimage.img of=/dev/sdX bs=4M

sync (important)

user269213

Posted 2013-07-07T09:02:56.593

Reputation: 11