How to mount /storage on an external SSD?

  • Hello all,

    I have a RockPro64 and I'm using the image LibreELEC-RK3399.arm-10.0.2-rockpro64 and trying to use a bigger external USB3 SSD to mount the /storage partition while keeping the /flash partition on the smaller sd card so that I could have a better performance with the docker services I plan to run, since the sd card would just be used on boot time, I imagine. I formated it as ext4, labeled it as STORAGE, but the problem is that no matter what I do it won't boot properly.

    I changed the file /flash/extlinux/extlinux.conf to point to the UUID of the SSD but when I boot I get the following message:

    Code
    *** Error in mount_storage: mount_common: Could not mount UUID=bb727511-e7c2-43e0-9e76-348957aa1c82 ***
    ### Starting debugging shell for boot step: mount_storage... type exit to quit ###
    # 

    By the way, on this point if I manually mount the SSD doing mount /dev/sda1 /storage and exit the debugging shell it keeps booting and works normally (which means that everything would work if it was being mounted automatically).

    Searching for answers on this forum I found this, then I created the suggested script and adapted it to my needs. In fact it tries to boot, but then I get the following message:

    Code
    mount: mounting UUID=bb727511-e7c2-43e0-9e76-348957aa1c82 on /storage failed: No such file or directory
    mount: mounting /storage on /sysroot/storage failed: Invalid argument

    Followed by lots of errors due to the failure on the partition mounting.

    Based on these messages I believe it's happening because by the time LE tries to mount /storage the external disks (in my case /dev/sda1) probably are not yet available. Is there a way to force them to be available BEFORE it's time to /storage to be mounted?

    Any help or suggestion would be appreciated.

  • Go to Best Answer
  • Hey mglae , thanks for taking the interest in the issue and also your prompt reply.

    This is a blkid taken after the error msg but before the manually mounting the partition:

    Code
    *** Error in mount_storage: mount_common: Could not mount UUID=bb727511-e7c2-43e0-9e76-348957aa1c82 ***
    ### Starting debugging shell for boot step: mount_storage... type exit to quit ###
    # blkid
    /dev/sda1: LABEL="STORAGE" UUID="bb727511-e7c2-43e0-9e76-348957aa1c82" TYPE="ext4"
    /dev/mmcblk1p2: LABEL="STORAGE" UUID="8ff85d86-0886-4367-affc-e7e92877481a" TYPE="ext4"
    /dev/mmcblk1p1: LABEL="LIBREELEC" UUID="053-4902" TYPE="vfat"
    /dev/loop0: TYPE="squashfs"
    # mount /dev/sda1 /storage
    # exit
    LibreELEC (official): 10.0.2

    And this is the blkid after I manually mount the partition and access the box remotely via ssh:

    Code
    Nostromo:~ # blkid 
    /dev/mmcblk1p1: SEC_TYPE="msdos" LABEL_FATBOOT="LIBREELEC" LABEL="LIBREELEC" UUID="0503-4902" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="9b35c7c9-01"
    /dev/mmcblk1p2: LABEL="STORAGE" UUID="8ff85d86-0886-4367-affc-e7e92877481a" BLOCK_SIZE="1024" TYPE="ext4" PARTUUID="9b35c7c9-02"
    /dev/loop0: TYPE="squashfs"
    /dev/sda1: LABEL="STORAGE" UUID="bb717511-e7c2-43e0-9e76-348957aa1c82" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="STORAGE" PARTUUID="ccb42155-873d-40c3-82ea-5bb6729d00eb"

    In fact I had done that before on a Manjaro installation, the difference being that then I put the /boot content on the sd card and the rest of the files I transfered to the SSD. It worked fine.

  • Hi mglae, I did what you suggested and attached the corresponding dmesg. The only error I could notice is a couple of attempts of mounting the /storage partition.

    And also (from the kernel verbose debug):

    Maybe it happens because by the time it tries to mount the external drive in /storage it's not still detected/available?


    Hi tokul , thanks for the input!

    Well, the thing is I want to use this box as a little home server, you know, not only the "media server" part that LibreELEC provides. So that if I can make it run from the SSD instead of the sd card it would have a better performance for my needs. In fact I'd been using Manjaro with Kodi for some time exactly this way (/boot running on the sd card, / running on an external drive) and was very satisfied. But the problem with Manjaro is that their builds doesn't have hardware decoding as LE does (which, for a media server, is a deal breaker), and also these last Kodi versions from Manjaro have been very unstable to me.

  • This would work fine on CoreELEC and the system will boot with "storage" on the external drive:

    systemctl stop kodi

    e2label /dev/sda1 "STORAGE"

    e2label /dev/mmcblk1p2 "EXT-STORAGE"

    reboot

    I don't know if it will work in LE.

  • /storage got .config and .kodi directories. replace it with random file system and you are screwed.

  • tokul: I don't know what you're saying, in case of problems you just need to do a factory restore, plus a backup restore, and that's it. The external storage will already be mounted as "storage". I have done this many times with no problems with CoreELEC.

  • There are errors in detecting your external SSD. Due to the time delay it is not automatically mounted:

    Try to disable UAS with usb-storage.quirks=174c:1153:u kernel parameter.

  • elonesna hey, thank you so much for your help.

    Well, I tried your suggestion but unfortunately it didn't work... the thing is it seems that LE mounts its drives based on their UUID, so I don't think it makes much difference which are their LABELS.


    mglae hey man, you're my hero! :)

    It seems to be working now. At least I've done some 3 or 4 boots and it's working as expected.

    Here, just to compare:

    Before

    After

    I researched a little about this uas x usb-storage drivers and if I understood correctly the difference between them is basically some speed gain, right?

    You may consider this thread closed, the issue solved and I really appreciate your invaluable help but, just out of curiosity... is there any way I could load this module before the mounting of the external drive, so that I could keep using it?

    Edited once, last by xleox: Merged a post created by xleox into this post. (April 14, 2022 at 6:49 PM).

  • I researched a little about this uas x usb-storage drivers and if I understood correctly the difference between them is basically some speed gain, right?

    Theoretically speed gain but I doubt you do have an use case where you can notice it.

    is there any way I could load this module before the mounting of the external drive, so that I could keep using it?

    Both drivers are build into the kernel image there are no modules to load. The UAS firmware of the device is incompatible to the kernel implementation but luckily you can choose a different protocol.