Manual Installation
| 20px | ▶ installation | ▶ Manual Installation |
In this tutorial we will demonstrate the installation of OpenELEC onto a single hard drive system (USB, SSD, HDD, CF, etc).
First off all boot your Linux System or download and boot Ubuntu Live CD. If you use a live cd, remember to enable the needed universe repository for the extlinux installation.
Contents
Manual Installation
Locate the device (SD,CF,SSD or HDD) to use.
In my case /dev/sdb.
sudo fdisk -l
Create the needed partitions
1 - System 250MB | 2 - Storage reminding free space
Or use Gparted and set the partition size option to cluster.
sudo fdisk /dev/sdb
o - create DOS partition table
n - new partition
p - primary
1 - partition number
ENTER - use default start point
+250M - for 250 MB System Disk
n - new partition
p - primary
2 - partition number
ENTER - use default start after partition 1
ENTER - use default end for all free space usage of partition 2
a - set partition boot flag
1 - partition 1
p - show partitions
Now you have 2 linux partitions like this.
...Device...boot.....Start........End......Blocks...Id..System /dev/sdb1....*............2..........261.......48976+..83..Linux /dev/sdb2.............261........1021......730991+..83..Linux
Create filesystem on partitions.
sudo mkfs.ext4 -m0 /dev/sdb1
sudo mkfs.ext4 -m0 /dev/sdb2
Set disklabels to partitions.
sudo e2label /dev/sdb1 System
sudo e2label /dev/sdb2 Storage
For SD, CF & SSD disable ext4 journal.
sudo tune2fs -O ^has_journal /dev/sdb1
sudo tune2fs -O ^has_journal /dev/sdb2
Experts All in One Command.
sudo mkfs.ext4 -v -m0 -O ^has_journal -L System /dev/sdb1
sudo mkfs.ext4 -v -m0 -O ^has_journal -L Storage /dev/sdb2
SSD Trim Support
For SSD you can enable the discard mount option if TRIM is supported.
sudo hdparm -I /dev/sdb1 | grep TRIM
If you get the output TRIM supported activate discard.
sudo tune2fs -o discard /dev/sdb1
sudo tune2fs -o discard /dev/sdb2
Install the needed extlinux bootloader.
sudo apt-get install extlinux
Write MBR (Master Boot Record Code) to the device.
sudo dd if=/usr/lib/extlinux/mbr.bin of=/dev/sdb bs=440 count=1
Mount System partition for bootloader & system installation.
sudo mkdir -p /media/System
sudo mount /dev/sdb1 /media/System
Install extlinux bootloader.
sudo extlinux -i /media/System/
Create bootloader menu config file.
sudo gedit /media/System/extlinux.conf
And paste the following lines.
In case of problems with the Partition Labels use APPEND boot=/dev/sdb1 disk=/dev/sdb2 quiet
DEFAULT linux PROMPT 0 LABEL linux KERNEL /KERNEL APPEND boot=LABEL=System disk=LABEL=Storage quiet ssh
Install OpenELEC
Now copy the KERNEL & SYSTEM file from the OpenElec.tar.gz/target/* folder to the System partition.
sudo cp ./OpenELEC.tv/target/KERNEL /media/System/
sudo cp ./OpenELEC.tv/target/SYSTEM /media/System/
Umount and enjoy...
sudo umount /dev/sdb1