le/win/linux triple boot on same hdd

  • I have the following hd layout on my laptop:

    /dev/sda1 small (300 MB) partition of no use;
    /dev/sda2 Windows 10;
    /dev/sda3 Linux swap;
    /dev/sda4 container for logical partitions with a Debian installation, including a large /dev/sda10 partition for media files. Grub2 is installed in the mbr and it boots both Windows and Linux, also it sees sda1 as bootable (though not functional at present).

    I would like to install LibreELEC in /dev/sda1 and have it use /dev/sda10 as its 2nd (data) partition, with /dev/sda3 as swap. I am afraid to just "let rip" the automatic USB installer because trashing this machine would be a serious disaster. Can anyone please provide some guidance? I am pretty experienced with Linux in general.

    Thanks,

    Denis

  • I found that LE doesn't like PCs. I could not make it work from a HDD, I thought I finally found a use for the boat anchor with a 40 GB HDD. Works fine from a flash drive.

    Maybe I'll try it on one of my 10 GB IDE drives one day. I know I still have them for some reason.


  • The LE installer will totally wipe clean the target device, so it's not an option for multi-boot computers.

    Have a look here for a manual installation: thread-5193-post-35326.html#pid35326
    Adjust the drive locations in the GRUB menu entry.

    LibreELEC doesn't really need a swap file, but it'll probably pick it up if it sees it.

    Thank you for the quick reply - I looked at the thread but there is only a description how to configure grub, what should I put on /dev/sda1? I have the downloaded image and have created the bootable USB stick.

    Btw my data partition is reiserfs - I suppose that is a deal-breaker?

  • It is likely a deal-breaker, AFAIK LibreELEC expects its own storage partition to be a EXT4 partition. Having your video/music collection on a seperate partition (with a different disk format) is another matter.

    LibreELEC needs its own TWO ext4 partitions preferably. The system partition can be put anywhere as primary or extended partition, as long as you don't exceed the maximum of 4 primary partitions. The storage partition is for all user settings, addons, skins, and other systemwide LE data such as the thumbnail cache, network settings and local databases.

    I cannot say if ReiserFS is supported by LE, my assistents would know this better than me. :D

  • Thanks again - I found a tool called fstransform which can change reiserfs to ext4 in-place. But I still don't know what to put on the system partition /dev/sda1 - do I just copy whatever is on the first partition of the live USB stick? Use dd or cp?

    Denis

  • The system partition, which only needs to be 512-1024MB, will hold the 4 files in the 'target' folder of the generic LibreELEC .tar file:
    - KERNEL
    - KERNEL.md5
    - SYSTEM
    - SYSTEM.md5

    These 4 files you can simply copy (cp, with admin rights) to the LE system partition using your Debian setup.

    Just for some generic information to me: which specific video card is in that PC?

  • Did it finally. List of steps (with parameters for MY situation, be careful if you copy this, you are root!):

    (0) transform /dev/sda12 from reiserfs to ext4 (obviously not if you already have ext4):

    # fstransform /dev/sda12 ext4

    The tool is SEMIautomatic, so pay attention! It instructs you how to monitor it so you can kill it with Ctrl-C before it damages data. Basically the file system needs to have at least 10% space free to be transformed safely.

    (1) make the installation SD stick and the bootable SD stick following instructions, check that the latter works.

    (2) format /dev/sda1 (the 300MB so-far-useless partition) and mount it:

    # mke2fs /dev/sda1
    # mkdir mountpoint
    # mount /dev/sda1 ./mountpoint

    (3) copy the KERNEL and SYSTEM files from the bootable SD stick and create their checksum files (I did that even though there were no checksums on the SD stick):

    # cp /media/System/KERNEL /media/System/SYSTEM ./mountpoint
    # cd ./mountpoint
    # md5sum KERNEL > KERNEL.md5
    # md5sum SYSTEM > SYSTEM.md5

    (4) edit the file /etc/grub.d/40_custom adding the entry

    menuentry "LibreELEC" {
    set root=(hd0,1)
    linux /KERNEL boot=/dev/sda1 disk=/dev/sda12 quiet
    }

    and update grub:
    # update-grub

    When I rebooted and selected LibreELEC from the grub menu, everything JUST WORKED. The new directories created by LibreELEC on /dev/sda12 peacefully coexist with my Debian installation which also mounts /dev/sda12. (I first looked at the live stick to make sure there would be no name collisions.)

    Thank everyone for their friendly input (I even ended up making the stick, and it did not spoil the party).

    Denis

    PS The laptop is a first-generation HP EliteBook 2540p with Intel on-board graphics. Originally HP had configured that 300 MB partition with a quick-boot Linux which launched into a browser directly, but it never worked for me because I trashed the MBR when installing Linux. So basically it is their idea.

    Edited once, last by deniss (March 19, 2017 at 3:31 PM).