Storage & userdata partition on ssd

  • Hi. Im sure this has been answered somewhere but i cant seem to find it. Im running libreelec 9.2.3 on rpi 4b. Im getting a ssd.

    Pending the rpi4 boot from usb update, i understand that the best method now is to move storage and userdata folder to the ssd.

    Can someone please point me to a guide on how to do this.

    Thanks you very much.

    • Official Post

    Generally you can just attach your SSD, and access music, videos etc. from LE's file browser. That's the easiest way.

    The /storage folder contains config data, too. I would keep those config data on RPi's microSD to have a clean cut among config and media data. Use symbolic links (ln -s command) to link /storage/videos etc. to SSD.

  • If you want to move to a USB/SSD only setup later it'd be best to partition the SSD with a 512MB VFAT as #1 (this will become the "/flash" boot partition later) and then the remaining space as an ext4 partition for storage.

    just copy the data from the ext4/storage partition on the SD card to the ext4/storage partition on the SSD and then change the disk=UUID=.... parameter in cmdline.txt (in the FAT partition of your SD card) to the UUID of the ext4 partition of the SSD (use "blkid" to get the UUID values).

    so long,

    Hias

  • If you want to move to a USB/SSD only setup later it'd be best to partition the SSD with a 512MB VFAT as #1 (this will become the "/flash" boot partition later) and then the remaining space as an ext4 partition for storage.

    just copy the data from the ext4/storage partition on the SD card to the ext4/storage partition on the SSD and then change the disk=UUID=.... parameter in cmdline.txt (in the FAT partition of your SD card) to the UUID of the ext4 partition of the SSD (use "blkid" to get the UUID values).

    so long,

    Hias

    Hi. I followed your guide. But the settings wasn't copied. libreelec started as a fresh installation.

    This is the original cmdline.txt

    ` boot=UUID=0106-1615 disk=UUID=f8fb3cf4-a55b-465a-8b04-55bf7c747aef quiet `

    this is what i got from blkid

    `

    LibreELEC:~ # blkid

    /dev/mmcblk0: PTUUID="b774a380" PTTYPE="dos"

    /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL_FATBOOT="LIBREELEC" LABEL="LIBREELEC" UUID="0106-1615" TYPE="vfat" PARTUUID="b774a380-01"

    /dev/mmcblk0p2: LABEL="STORAGE" UUID="f8fb3cf4-a55b-465a-8b04-55bf7c747aef" TYPE="ext4" PARTUUID="b774a380-02"

    /dev/loop0: TYPE="squashfs"

    /dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="a5c7bfd0-5cc1-4fda-a738-780210fe8db8"

    /dev/sdb2: SEC_TYPE="msdos" LABEL="NEW VOLUME" UUID="68F7-74C3" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="1ca9e39d-09e6-4f51-baf1-df5b13a57591"

    /dev/sdb3: LABEL="SSD2" UUID="f9d7e553-3349-d601-e0d7-e5533349d601" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="00008279-d7e0-53e5-33c9-d601f2040100"

    /dev/sda1: LABEL="ExtHDD2" UUID="f476f82e-a241-d601-f072-f82ea241d601" TYPE="ext4" PARTUUID="f9f5dbd2-01"

    /dev/sda2: LABEL="ExtHDD1" UUID="C65CC89E5CC88B1F" TYPE="ntfs" PARTUUID="f9f5dbd2-02"

    `

    this was the new cmdline content

    ` boot=UUID=0106-1615 disk=UUID=f9d7e553-3349-d601-e0d7-e5533349d601 quiet `

    i copied the whole storage folder into ssd using kodi interface.

    The ssd gets mounted a little late. about 30 seconds after the kodi interface. could this be an issue?

    if it matters, the ssd is mounted on the 2nd usb 3.0 port (2nd from the top)


    I also notice that the storage folder in sd card shows 50.69GB (i'm sure there is not that much data in there). Media files are in a separate HDD. storage folder in the ssd (copied) is only 52.11MB (reflective of the actual files in there).

    Edited 2 times, last by anand0412 (June 23, 2020 at 10:18 AM).

  • All the settings are stored in hidden directories (.kodi, .config, .cache), copying via kodi will probably have missed these - and it's not quite ideal to copy config files while they are being used (eg .kodi folder while kodi is running).

    I usually copy filesystems on my linux PC, mount eg both SD card and USB drive and then run `rsync -a ...` as root.

    An easier method is probably to use the backup and restore functions in LibreELEC settings. Boot from SD, backup everything eg to an external hdd/flash drive, then switch over to storage on SSD and choose restore.

    Stopping kodi and then using rsync (from the system tools addon) or tar to copy the /storage partition would be another method.

    so long,

    Hias

  • Hi HiassofT , thanks for the clarification. I may just do the backup and restore method.

    Before that, do i need to solve the late ssd mounting issue? My HDD mounts early. But the ssd mounts only after startup. Wouldnt this be a problem?

  • ssd mounting late seems odd, if /storage can't be mounted at boot time LE won't start at all...

    Just noticed your blkid shows a "Microsoft reserved partition" - my guess is that it might be this partition that gets mounted.

    I think it may be best to re-partition the SSD, using a classic MBR partition table ("Microsoft reserved partition" and the other PARTLABEL entries look like it's partitioned as GPT) and make sure the VFAT partition is the first one. GPT and/or VFAT partition on anything else than number one could be problematic for USB boot later (not 100% sure, maybe that's already implemented, but it's easier/safer to just follow the default partitioning scheme we also use on SD card).

    so long,

    Hias

  • hi HiassofT . repartitioned the ssd as your suggestion. it detected immediately after that. no delay. then I restored my backup. now its stuck in a restart loop.

    I get

    ```

    checking backup file ... ok

    This may take some time to complete, please be patient.

    Restoring.. \|/

    ```

    after a long time, it restarts and repeats the process.