Libreelec Install Can't Expand STORAGE Partition on 2TB NVME SSD

  • Tried to install Libreelec/Kodi directly on a 2TB SSD on an RPi5. The install doesn't expand the STORAGE partition. After some investigation and tinkering with Gparted, I think the issue is that the default block size on the STORAGE EXT4 partition is 1024 and that means the partition can't support the total size of the SDD with that block size. I changed the block size using Gparted to 4096 and the partition looks good in Linux. However, booting to Kodi, I get the "Error in mount_stoagre: mount_common: Could not mount UUID:{unique value}" I changed the UUID to the correct UUID of the altered storage partition by editing the cmdline.txt file on the LIBREELEC partition. The same error comes up. Is there any way to alter the boot process to bring up the new STORAGE partition?

  • OK. I am an idiot. The method above does solve the problem of the base install of libreelec/KODI (12.0.0.0) not expanding the STORAGE partition on install with large disks. I mis-typed the new UUID in the cmdline.txt by one character and even though I double checked it, I had should have triple checked it. So process to fix STORAGE partition size on large disks after install is:

    1. Create Gparted Live bootable USB and run.

    2. Run Gprarted and attach libreelec drive you used somehow.

    3. In terminal, use mke2fs to change the block size of the STORAGE partition to 4K (4096 bytes) -or- you could probably blow away the original STORAGE partition and recreate it using Gparted graphical interface.

    4. Properly note the new UUID of the STORAGE partition as changing block size or recreating it will chnage UUID.

    5. Edit the cmdline.txt on the LIBREELEC partition with new UUID.

    6. This means change this part of the command in the file to:

    Code
    disk=UUID={new unique UUID you noted in step 4}

    There are probably other ways to solve this problem but this has been my journey.

  • Sensible way would be to separate storage devices used for OS and media. Use smaller/cheaper device for OS that you can rebuild without losing data and store media on other device. But since it is RPi, you probably got only one disk.

  • ext4 with 32bit feature and 1024 bytes block size support up to 4TiB file systems.

    There are issues with resize2fs, see this PR (only in nightlys).

    Please execute paste /flash/fs-resize.log and post the URL for verification.

  • I started working on "nvmetool" based on the existing "emmctool" script in Amlogic images:

    https://paste.libreelec.tv/credible-osprey.sh

    The basic workflow is to download an LE .img.gz file to /storage and then run "nvmetool w <filename>.img.gz" to write it to the nvme drive, expand storage to 100% size, then relabel the partitions so they don't clash with an SD card. The last step (not implemented in the script) is to set the eeprom for nvme boot.

    NB: It's not particularly tested.. I ended up using the nvme drive instead of developing and testing it properly /shrug