menkalos
Posts: 6
Joined: Tue Oct 29, 2019 9:45 pm

How to install a limited OS like LibreELEC on a RPi 4b from a USB hard drive?

Sat Jul 18, 2020 11:45 pm

I've gotten my RPI 4b to run LibreELEC from my 8TB USB drive. I updated the boot firmware, then used the Image Installer to put the LibreELEC image on the hard drive. The problem is that the image installer only created 2 small partitions:

Code: Select all

Using /dev/sda
(parted) print
Model: WD My Book 25EE (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size    Type     File system  Flags
 1      4194kB  541MB  537MB   primary  fat16        boot, lba
 2      541MB   575MB  33.6MB  primary  ext4
The VAST majority of the drive is unused space. LibreELEC doesn't seem to have the tools to resize the partitions itself directly. So I rebooted off of an SD card with full Raspbian on it so I could install gparted. However, that refused to grow the ext4 partition to the maximum available size because of the "msdos" partition table. I don't know how to convert that to "gpt" (which is apparently what is need to handle the larger size) without destroying the existing partitions and setting me back to square one.

I can't find any web pages on either Raspberry Pi's site or LibreELEC's site that document how to do this.

Any help please? THANK YOU!!! :-)

User avatar
no3rpi
Posts: 28
Joined: Fri Mar 31, 2017 11:44 am

Re: How to install a limited OS like LibreELEC on a RPi 4b from a USB hard drive?

Sun Jul 19, 2020 9:41 am

Did you try to delete the second partition and recreate an extended partition to max space and inside create EXT4 partition to space you need ?
Edit the /flash/cmdline.txt with the correct UUID of new partition.or change the UUID to match the one from cmdline.txt.
RPI3^2 + RPI4 = :idea:

menkalos
Posts: 6
Joined: Tue Oct 29, 2019 9:45 pm

Re: How to install a limited OS like LibreELEC on a RPi 4b from a USB hard drive?

Sun Jul 19, 2020 4:07 pm

It won't let me create a partition that big:

partition length of 15626995712 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

So it is using the "msdos" partition table. How do I get LibreELEC to create the drive using the GPT partition table type instead? I can't just create a new one, because that will wipe the existing boot partition.

cleverca22
Posts: 2488
Joined: Sat Aug 18, 2012 2:33 pm

Re: How to install a limited OS like LibreELEC on a RPi 4b from a USB hard drive?

Sun Jul 19, 2020 4:18 pm

menkalos wrote:
Sun Jul 19, 2020 4:07 pm
It won't let me create a partition that big:

partition length of 15626995712 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

So it is using the "msdos" partition table. How do I get LibreELEC to create the drive using the GPT partition table type instead? I can't just create a new one, because that will wipe the existing boot partition.
copy all data you care about (the contents of both partitions) to another disk, re-format it with gpt, create partitions of the right sizes, and copy the contents back into it

if you where do copy it with `dd if=/dev/sda1 of=boot-part.img` then you dont have to format the partition itself, and you can just reverse the direction once its GPT

i believe the rpi4 requires that the boot partition be flagged as an efi system partition, for it to boot corrrectly

User avatar
no3rpi
Posts: 28
Joined: Fri Mar 31, 2017 11:44 am

Re: How to install a limited OS like LibreELEC on a RPi 4b from a USB hard drive?

Sun Jul 19, 2020 4:42 pm

For data safety I would not like to have LE OS installed on the same huge HDD where I keep all the mmedia data, you never know when something will go wrong on some update and you risk to lose all 8Tb of data.
I will prefer to have LE installed on a small 2Gb SD card and have the HDD mounted automatically on boot or if you want you can edit /flash/cmdline.txt to point to HDD ( after partitioned as GPT ) and it will be used also for LE data.
For LE to boot important is the first partition with system FAT16 and boot flags set as you have now on hdd.

p.s.
have a look at this LE mod that support LVM and crypt if you need, I am using that for some time without problems.
https://forum.libreelec.tv/thread/20338 ... post127305
RPI3^2 + RPI4 = :idea:

Return to “Beginners”