I would like to install OSMC on my RPi3 with root filesystem residing on a designated partition on a USB drive. The OSMC installer does provide this ability, but it just formats the entire USB drive as part of the installation, which I don’t want as there are other partitions on the USB drive that I want to preserve.
Is there a manual install method that provides more control over the installation process?
For example, I can easily extract the files from the OSMC RPi3 image and dump the boot files in the FAT-formatted boot partition on the SD card and extract the contents of filesystem.tar.xz into the ext4-formatted target partition on the USB drive before the first run. However, what configuration do I need to tweak to tell the installer that this step has already been completed so that it skips the destructive partitioning and just proceeds from this point on? I guess it would be preseed.cfg or cmdline.txt, but need to know exactly what changes would be required to achieve this.
I should also note that I have used openelec until now, and it was pretty easy to do this: I would just dump the contents of the system partition from the openelec image into FAT-formatted boot partition on the SD card and tweak the cmdline.txt to use the USB partition as root. I’m hoping it’s possible to do something similar with OSMC too…
Put everything but /boot on ext4.
Adjust fstab and cmdline.txt accordingly. Then all will be fine.
If you are unsure of options for cmdline and fstab, either see the source in Git, or do a quick install on a USB and make a note of it.
Thanks a lot for the pointers - it worked flawlessly. The only additional thing I did was to create a /config.txt in the boot partition. Looking through the git source, I figured that installer is doing this as well – so I just replicated that step. To summarize, here’s what I did, with a bit more detail:
- Extract “filesystem.tar.xz” from the downloaded OSMC image. No other files from the image are needed.
- Format the root partition on USB (/dev/sda1, in my case) as ext4 & extract the contents of filesystem.tar.xz into this partition
- Format the boot partition on SD card (/dev/mmcblk0p1, in my case) as vfat & move the contents of the /boot directory on the USB root partition into this partition
Adjust /etc/fstab in the root partition (/dev/sda1):
/dev/mmcblk0p1 /boot vfat defaults,noatime 0 0
/dev/sda1 / ext4 defaults,noatime 0 0
Create /cmdline.txt in the boot partition (/dev/mmcblk0p1):
root=/dev/sda1 rootfstype=ext4 rootwait quiet osmcdev=rbp2
Create /config.txt in the boot partition (/dev/mmcblk0p1):
Stick in the USB drive & SDHC card & power up RPi3. It will go through the remainder of the install process and finally boot into OSMC.
Correct. I had forgotten to mention that. What you have effectively done, with the above instructions, is replicate the functionality with the installer.
As said before, we won’t touch cmdline.txt or fstab in updates, so this will stay working across updates from OSMC.