[HowTo] put OSMC on SD card manually in Linux

Hi, just a quick tip for all of you who don’t want to or can’t use the osmc-installer package.

Prerequisites: Using the command line in Linux, packages gdisk, md5sum, gzip installed
Optional: package pv installed

You have to download the image manually under “disk image” from the download page. You will get an .img.gz file which is a gzipped version of the disk image.

Then you check if the md5 checksum mentioned next to the download is the right one (replace the actual checksum and file name with your own):

md5sum -c - <<<"b2839349c456de61b2921c0dfcd7dd43 OSMC_TGT_rbp2_20151027.img.gz"

Next you put in your SD card and check if it got automatically mounted with lsblk. If it is, you should unmount the corresponding file system first with umount /dev/sdx1.

Because you want to be sure you leave no traces of a partition table (WARNING: you can destroy your data! Double check if it’s the right disk with fdisk -l first!), you do a quick gdisk /dev/sdx (without the partition number!) and zap the GPT with x, z and two times y.

Then you’re finally able to transfer those SD card installation files onto the card:
(WARNING: you can destroy your data! Double check the right disk with fdisk -l first!)

gzip -dc OSMC_TGT_rbp2_20151027.img.gz | pv | sudo dd of=/dev/sdx && sync

(you can leave out pv if you don’t want to see progress)

Done! You now just have to remove the SD card from your computer, put it in your OSMC device and power it on. The image will then boot and automatically install OSMC to the whole card.

2 Likes

If you have a machine running Linux Mint (or Ubuntu, I suppose), just double-click the tar file to open the archive manager, then double-click the .img file. This will open gnome-disks and a dialog to “restore” the image to a disk. Select your SD card (carefully!) from the drop-down, ignore the warning that the disk image is smaller than the card and just hit Start restoring.

This will automatically wipe the partition table (as will dd, so why the gdisk commands?)

This is nice, but you do lose preseeding capabilities: the ability to install to a USB drive, an NFS share, or set up network settings beforehand.