OSMC OS on USB SSD disk

 

As of now, the OSMC doesn’t seems to support booting from an USB device (see this post). But putting the OS on the SSD is still a lot better for performances than on the SD Card.

OSMC provides an installer, which has an option telling to run OSMC from an USB Stick. Sadly, the installer is no longer available for Linux (see this post).

In order to do this behaviour from a Linux OS:

  1. Download the OSMC image (https://osmc.tv/download/ under “Disk Images”)
  2. Check the md5sum and untar the file:
     $ md5sum OSMC_TGT_rbp4_XXXXXXXX.img.gz
     $ gzip -d OSMC_TGT_rbp4_XXXXXXXX.img.gz
    
  3. Install the file on an SD Card
      # Replace /dev/mmcblk0 by the device's path
      $ sudo dd if=Downloads/OSMC_TGT_rbp4_XXXXXXXX.img of=/dev/mmcblk0 bs=4M
    
  4. Then, mount the created partition and add a preseed.cfg file into it:
     $ sudo mkdir /media/osmc_boot
     $ sudo mount /dev/mmcblk0p1 /media/osmc_boot
     $ vim /media/osmc_boot/preseed.cfg
    

    preseed.cfg file:

     d-i target/storage string usb
     d-i network/interface string eth
     d-i network/auto boolean true
    

    Finally unmount the SD Card and remove it

     $ sudo umount /dev/mmcblk0p1
     $ sudo rm -rf /media/osmc_boot
    

    When this is done, plug in the SSD to the Raspberry Pi (with no other USB connected), put the SD Card on the Raspberry and turn it on. OSMC startup will begin, and will disclaim that the USB disk will be formatted. Wait the 60 seconds, and the filesystem should be installed on the SSD.

After OSMC has been installed and has booted, edit the /boot/cmdline.txt so that initramfs knows in which disk the root filesystem is located:

# Get the disk UUID
$ ls -l /dev/disk/by-uuid
lrwxrwxrwx 1 root root 15 Dec 14 18:31 <uuid1> -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 10 Dec 14 18:31 <uuid2> -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 14 18:31 <uuid3> -> ../../sdb1

# Edit cmdline.txt file
$ sudo vim /boot/cmdline.txt

/boot/cmdline.txt file:

root=UUID=<uuid2> rootfstype=ext4 rootwait quiet osmcdev=rbp4

After that, OSMC can boot even with multiple USB disks connected.