Do I need to have SD card / USB flash drive to run OSMC? Or should I have it for installation only and then it could be removed?
You need an SDcard for installation and to run it.
I use the sd card just as a bootdisk, running the actual os off of a usb ssd drive… connected through a powered usb hub. I even add an 8gb usb stick as a swap drive, and add it to /etc/fstab. Not really necessary just for osmc/kodi, but if you dual-boot and have Raspbian installed, it surely helps if doing any native compiling on the pi.
The way to set up an external drive…
(1) write the initial image to an sd disk
(2) boot the sd disk in the pi, and go through the initial setup steps
(3) power off the pi
(4) make an image of the disk… I use “gnome-disk-utility” in Ubuntu… you can use dd instead if you want…
sudo dd if=/dev/(whatever your disk is) of=/(whateveryounameyourimage).img
It’ll be in your home directory.
(5) write that image to your external disk
(6) resize the storage partition to use up all the space on the drive… I used gparted… not sure the commands using the terminal.
(7) open the cmdline.txt in the /boot partition on the sd card, and change the /dev/mmcblk0p2 to /dev/sda2. If you have more drives connected, then it may be /dev/sdb2 or /dev/sdc2, etc… Mine’s /dev/sdc2.
(8) insert sd card into the pi, connect the external drive through the powered usb hub, and power everything up. The sd card will say “waiting for root on /dev/sda2”, a second or 2 later, OSMC is booting from the external drive. It runs so much faster too.
Or just use the option “on an USB Stick” from the official OSMC Installer Download - OSMC which will leave the boot files on the SD Card and copy the rest on your USB Stick (all data on that Stick will be deleted).
With the new ability to boot RPi3 from USB disk then I expect this will change.
Thanks. Doesn’t Raspbery Pi3 has internal (built-in) memory to run OSMC? Or is it too small to fit OSMC?
Crap… lol. I grabbed the rpi2 image instead. I saw the Wndows, Mac, and Linux links, but I guess I thought those were to install on a pc. I guess I should have read the page better.
The Pi 3 has 1gb of RAM. There is no storage.
Hmm… seems the usb installer option only writes to /dev/sda1… it doesn’t give an option to choose if you have more than just 1 external drive. I guess that’s what the “internal storage” would be, but it’s not clickable. You’d still need to modify the cmndline.txt if you have more than 1 usb stick/drive connected. Your “root=/dev/sda1” changes as soon as you add another drive.
Well as long as you only have one disk connected during install (no reason to attach more at that time) you should be fine
True, but you do still have to edit the cmdline.txt if you add another drive after the installation. I’ve already been through this in Raspbian while doing a native compile of kodi. After adding a usb stick as swap, my system disk changed /dev id’s and wouldn’t boot. I add my swap using the UUID now, but it still comes up as /dev/sda1. The optimal situation, is to boot the system disk using the UUID or PARTUUID… but I haven’t been successful doing that with the system disk. But that’s with my method of copying the initial image to both disks, partitions and all. Maybe it would work better using the OSMC installation method, where it just installs to the single partition… instead of /dev/sdx2. My system has 3 disks… swap (sda1), music (sdb1), and osmc (sdc2)… the installation was set up with the single disk, the swap and music disks were added later.
Connect the usb drive you want for the system, let the installer do it’s thing. Then ssh into the pi, and…
$ sudo blkid /dev/sda1
/dev/sda1: UUID="8bde87f2-a2c8-4768-b14f-0a5959abf155" TYPE="ext4" PARTUUID="000d7d48-01"
[code]$ sudo nano /boot/cmdline.txt
root=/dev/sda1 rootfstype=ext4 rootwait quiet osmcdev=rbp2
root=UUID=[whatever your uuid actually is] rootfstype=ext4 rootwait quiet osmcdev=rbp2[/code]
After that, I rebooted to make sure it loads. I then added my home directory as a source… just to make sure it showed to correct disk size. I then powered down, added my music and swap drives and rebooted… no issues. Added my swap to /etc/fstab using it’s UUID… everything’s working as it should.
Actually, we recommend you only attach the drive you intend to install to for the first boot. OSMC uses UUID based booting; so after that should be fine.
UUID is probably still experimental and not enabled by default in installer. That’s because we only added UUID support to the initramfs around December or so.
I looked at the bootdisk after the installation… the cmdline.txt is what I posted above… root=/dev/sda1. Even with the UUID manually inserted, the screen output says waiting for root on uuid=xxx, then it says it’s booting /dev/sda3. or something to that effect.
PARTUUID won’t work, as that’s only used by the kernel when no initramfs is present (so old OSMC versions).
In a post above you said UUID worked, so if you follow my instructions it should still work.
I only mentioned PARTUUID as that’s what was in pretty much every guide I came across… I only tried UUID out of chance. But you still need to do that manually… your installer, at least the Windows version, makes the bootdisk look for /dev/sda1. If I add my swap or any other disk after the initial setup… without altering the cmdline.txt… it won’t boot.
I seriously love OSMC though… I can actually add stuff… like perl to get my epg grabber working.
Re-read above re. UUID and the installer ;). You said that even with UUID manually inserted, it doesn’t boot. I would be very surprised at that. Surely when you manually install to USB you are manually adjusting cmdline.txt anyway
You missed the rest of my statement though…
My next post was to both correct myself, and to say that yes… it does work.
My original statement was from past experience with Raspbian, copying both partitions. For whatever reason, I couldn’t get it to boot from the 2nd partition. But that was using PARTUUID… as suggested in all the threads on rpb(.)org and Adafruit. If I tried the UUID with both partitions… it booted, but my home directory was only 980mb’s… instead of 110gb’s. So it seems as if it booted the external drive, but was still using the sd card as the system. But when using the installer, setting up a single partition… the UUID works.
I’m not quite sure what you’re saying, but UUID should work just fine if you edit cmdline.txt and fstab. Let me know if that’s not the case