Question

I am operating a Linux live image on a small USB flash drive and would like to flash an SD card with it. The image is zipped already too big for my flash drive, so I can not write it to disk. I have enough RAM to buffer the zipped and the unzipped image, so my solution was this:

$ sudo mount -t tmpfs -o size=2.5G none /mnt 
$ cd /mnt && wget http://example.com/linux.zip
$ cd /mnt && unzip linux.zip
$ sudo dd if=/mnt/linux.img of=/dev/sdb bs=4M

This feels cumbersome. How one write an image to SD card, unzipped from an archive, downloaded from the internet, without writing anything to disk in one line?

Was it helpful?

Solution 2

If your live image comes with curl, funzip and dd, something like the following should work:

$ curl -L http://example.com/linux.zip | funzip | dd of=/dev/sdb bs=4M

OTHER TIPS

Try with this: wget http://example.com/linux.zip -q -O -| funzip | dd of=/dev/sdb bs=4M

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top