CoreELEC SD mounted as a different user

  • Not quite the same but related to it.

    If I plug my CoreElec SD card into my Linux (opensuse) computer it loads the STORAGE partition as a different user to my Linux account and then wont let me alter anything on the card. This is very inconvenient as it forces me to do modifications over SAMBA whilst the card is running the CoreElec system. I need to copy over some Userdata Addon-data folders to customise my build.

    If I try to run my file browser as ROOT it doesn't show either of the SD partitions because they have been allocated to the user account on plugging in the SD card.

    This maybe a consequence of the draconian permissions policy within Opensuse, but when I try to mount the card in Win7 it only shows the SYSTEM partition and the STORAGE is missing because its ext4 format.

    Any clues.

    Shoog

  • Ask CoreELEC or Suse ;)

    Only speaking for myself, but I'm absolutely not familiar with OpenSUSE. It really wonders me, that a partition on a SD card is mounted as a different user.

    I didn't use CoreELEC yet, but I highly guess you have many alternatives to connect to it. May it be SSH, Filezilla, Samba, whatever

    I need to copy over some Userdata Addon-data folders to customise my build.

    Could you please explain what you are trying to achieve? Maybe there's a different solution for you.

  • I went into the ROOT account and then plugged in the SD card, this gave me access to the STORAGE partition and from there I changed the permissions on the partition to allow general users to access it.
    The purpose of this was to be able to copy across my TVH and Webgrabplus user folders from a running system to the SD card. Its the final stage of performing a clean install on the SD card which I can then copy over the internal install I just copied out of. Anyone who has gone through the various stages of tweaking a TVheadend server and Webgrabplus setup will appreciate why I wanted to save myself the hours of hassle.

    Shoog

  • OK there are consequences from changing the permissions in the way I did because the permissions are now to permissive for SSH and it will not allow a connection. Going to have to revert permissions.

    Follow this to restore permissions:

    No SSH Access

    Note that the SSH password has changed to "coreelec"

    Shoog

    Edited once, last by Shoog (April 19, 2018 at 11:27 PM).

  • Final word. You should be able to access the SD card STORAGE partition if you boot into a ROOT session (since ROOT is the owner of STORAGE). The reason I didn't do this was because samba is not working from ROOT on my system and so I could not access the running Libreelec system to copy files out of it.

    A better solution would probably be to:

    -login to Linux as user account

    -copy files from the running Libreelec into a folder on your user account via samba.

    -change owner of this folder to ROOT and then reboot Linux into a ROOT graphical session

    -plug in SD card giving ownership to ROOT session

    -copy files across from folder to STORAGE

    Altering permission on STORAGE has a real potential to mess things up badly so it is safer to access it as ROOT session. Of course this becomes difficult on Ubuntu type systems since there is no ROOT account and everything will have to be carried out in the command line through SUDO. Of course you may not encounter these issues in a Ubuntu session.

    Shoog

  • I'm honestly failing to see why you'd go to all that trouble. I edit stuff on libreelec via smb regularly (from windows) with no issues. Either run 'systemctl stop kodi' first in ssh if changing stuff on a working install, or stick the new sd card in an already running libreelec if it's for something else.

    Isn't that easier?

  • I don't have much love for Samba reliably moving stuff about - ensuring that correct permissions are maintained on a system which doesn't use permissions. SAMBA has always been somewhat unreliable on Linux systems.

    Shoog

  • Shoog

    Well, tbh. I'm with trogggy in that case.

    You can SSH into LibreELEC easily and change nearly everything while using the command line

    You can share files over SMB by default. Just enter \\<ip.of.LE.machine\ in your file explorer. See:

    Accessing LibreELEC [LibreELEC.wiki]


    Changing owners of files and/or groups is not necessary if you want to modify LE in any way.

    I'll try later what happens on Ubuntu/Fedora/ArchLinux if I plug in a SD card. My guess is, that I'm able to edit files pretty easily.

  • I don't have much love for Samba reliably moving stuff about - ensuring that correct permissions are maintained on a system which doesn't use permissions. SAMBA has always been somewhat unreliable on Linux systems.

    Shoog

    That's not been my experience with libreelec / openelec.

    I've also edited directly in ubuntu in the past without any issues.

  • Opensuse has some ridiculous security settings. If you plug in some hard drives in a user session it will allocate that HDD to the Root user and then only allow the user to read the hard drive. It has taken me lots of digging to get a plugged in HDD to mount to the user as owner.

    Hence why plugging in a Libreelec SD card into a Opensuse session will block write access. Strangely because the SYSTEM partition is FAT it allows full access to that.

    Shoog

  • That's not been my experience with libreelec / openelec.

    I've also edited directly in ubuntu in the past without any issues.

    I think its a Opensuse issue related to their "business" level security policies.

    Its a reality I have had to grapple with for years since plugging in any external storage often blocks write access because ROOT takes ownership by default. Not at all user friendly.

    However, in hindsight it would have been a damn sight easier to use SSH and copy the files that way.


    Shoog

  • I don't have much love for Samba reliably moving stuff about - ensuring that correct permissions are maintained on a system which doesn't use permissions. SAMBA has always been somewhat unreliable on Linux systems.

    Shoog

    Don't blame user error on the software, Samba is definitely reliable (used it in professional settings for years).

  • It seems your OS is auto-mounting the partitions on the SD card when you insert it.

    (one of those 'lets do it like Windows' settings that I hate)

    I do not allow automounting on insertion of removable media.

    Unmount the partition (or disable automounting) and mount it as root and you will have full access from a file manager launched with root privileges, in your user account.

  • Don't blame user error on the software, Samba is definitely reliable (used it in professional settings for years).

    Quote
    • Samba is a bitch to cross-compile for different platforms so different versions of Kodi run different samba (smbclient) versions. AFAIK both MacOS and Android are still on 4.1 while Linux (depending on distro) will have newer things available - LE is using current versions and is quite advanced in this respect. Other iOS apps may use different SMB libs and not Samba or OS native functions. macOS uses its own SMB stack not Samba although there are legacy references to conf files. Combined .. it's a mucking fess.



    Simple SMB Question

    I beg to differ, getting a stable reliable SAMBA setup to run on Opensuse has been an ongoing ordeal for years, and I am not the only one who says so. It is my experience that it breaks on just about every upgrade. Keeping various computers running various OS's into a stable configuration is a nightmare.

    Shoog