Skip to content

Manual Installation of OS

ninyule edited this page Apr 11, 2016 · 1 revision

First off all boot your Linux System or download and boot Ubuntu Live CD.

If u use a live cd, remember to enable the needed universe repository for the extlinux installation.

Locate the device (SD,CF,SSD or HDD) to use.

In my case /dev/sdb.

sudo fdisk -l

Now create the needed partitions (1 - System 200MB | 2 - Storage reminding free space)

If you have a small disk and problems with the alignment of partitions refer to this thread.

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

200 - for 200 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

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

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