LE 11.0.1: Unable to mount /storage to a BTRFS partition

  • Model = Pi4 B

    LE Image: LibreELEC-RPi4.arm-11.0.1.img.gz

    I'm trying to run SYSTEM from an 8GB sdcard and mount /storage to a 512GB USB thumb drive. This is what my cmdline.txt looks like:

    Code
    boot=UUID=1803-0729 disk=UUID=b496e163-ea71-4d6e-a825-783d313c95de video=HDMI-A-1:D video=HDMI-A-2:D

    I have also tried disk=/dev/sda1 and disk=LABEL=STORAGE

    Here is the output of blkid

    Code
    /dev/loop0: TYPE="squashfs"
    /dev/sda1: LABEL="STORAGE" UUID="b496e163-ea71-4d6e-a825-783d313c95de" TYPE="btrfs"
    /dev/mmcblk0p2: LABEL="STORAGE" UUID="d34cd6c2-1dbd-4333-8d42-a1c2a6506acf" TYPE="ext4"
    /dev/mmcblk0p1: LABEL="LIBREELEC" UUID="1803-0729" TYPE="vfat"


    Every time LE fails to boot with the usual:

    Code
    *** Error in mount_storage: mount_common: Could not mount UUID=b496e163-ea71-4d6e-a825-783d313c95de ***

    If I format the thumb drive as EXT4, everything works as expected. Is the BTRFS filesystem supported for mounting partitions during boot? (fyi...XFS also fails to mount).

    Last thing I tried was adding USB Storage quirks to the `cmdline.txt but realy didn't have high hopes:

    Code
    boot=UUID=1803-0729 disk=UUID=b496e163-ea71-4d6e-a825-783d313c95de video=HDMI-A-1:D video=HDMI-A-2:D usb_storage.quirks=13fe:6700:u

    DMESG below...

    ps. if you ask why BTRFS instead of EXT4, I see fantastic performance when I plug the BTRFS thumb drive into my unRAID server for the sake of copying new media to it (~400MB/s). If I do the same with EXT4, it slows to a crawl (down to ~7MB/s at times). XFS usually bottoms out around ~120MB/s.

    TIA,

    John

    Edited 5 times, last by johnodon (April 19, 2023 at 12:25 PM).

  • When it fails you're dumped to the initramfs console. This is rather limited in capabilities, but you should be able to connect a USB keyboard and attempt manual mount of the BTRFS volume. I'd expect this to fail, but it might output some useful error messages?

  • When it fails you're dumped to the initramfs console. This is rather limited in capabilities, but you should be able to connect a USB keyboard and attempt manual mount of the BTRFS volume. I'd expect this to fail, but it might output some useful error messages?

    I tried a straight up...

    mount UUID=b496e163-ea71-4d6e-a825-783d313c95de /storage

    ...and it produced...

    mount: mounting /dev/sda1 on /storage failed: Invalid argument

  • Have you tried formatting your USB stick with exfat. If so has that worked for you.

    Not exFat since I want it to be a native Linux FS. But, EXT4 mounts without issue.


    One other point...

    If I let LE use the sdcard for both SYSTEM and STORAGE and then plug in the BTRFS formatted USB drive after LE has booted, LE recognizes it without issue (indicating it recognizes the FS). It is only the mounting of the disk at startup that is failing.

    John

    Edited once, last by johnodon: Merged a post created by johnodon into this post. (April 19, 2023 at 2:53 PM).

  • Not exFat since I want it to be a native Linux FS. But, EXT4 mounts without issue.


    One other point...

    If I let LE use the sdcard for both SYSTEM and STORAGE and then plug in the BTRFS formatted USB drive after LE has booted, LE recognizes it without issue (indicating it recognizes the FS). It is only the mounting of the disk at startup that is failing.

    John

    exFAT With Linux 6.2 Allows Creating Files & Directories Much Faster - Phoronix

  • The problem is that the latest version on unRAID is only on a 5.19 kernel. This is the box where I will be doing the native copies.

    Linux UNRAID 5.19.17-Unraid #2 SMP PREEMPT_DYNAMIC Wed Nov 2 11:54:15 PDT 2022 x86_64 Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz GenuineIntel GNU/Linux

    Regardless, I'll test exFat, NTFS, EXT4, XFS and BTRFS and report the results.

    All of that being said still doesn't resolve the issue of not being able to mount and BTRFS or XFS volume at boot.

    John

  • Using a btrfs filesystem as /storage is not supported, the btrfs kernel driver is built as a module (so not available during initramfs stage) and also the initramfs doesn't contain fsck.btrfs - this is only available via the btrfs-progs addon (so in case anything goes wrong you won't be able to fix the issue on LE).

    Stick to ext4 for /storage - you can use btrfs on additional drives though.

    so long,

    Hias

  • Using a btrfs filesystem as /storage is not supported, the btrfs kernel driver is built as a module (so not available during initramfs stage) and also the initramfs doesn't contain fsck.btrfs - this is only available via the btrfs-progs addon (so in case anything goes wrong you won't be able to fix the issue on LE).

    Stick to ext4 for /storage - you can use btrfs on additional drives though.

    so long,

    Hias

    Thank you for that explanation! I can now move on. :)

    Marking as resolved.


    resolved

    Edited once, last by johnodon: Merged a post created by johnodon into this post. (April 19, 2023 at 3:58 PM).