Posts by csimai

    No there shouldn't be a link

    Moving /storage to a different drive shouldn't be an issue at all as long as you copy all the relevant data.

    Irusak - you are absolutely correct. In this post [ thread-5519-post-37685.html#pid37685 ] mglae has identified that I have used the wrong rsync options - so my originally posted rsync -rtv ... should have been rsync -av ... which is the archive option (this ensures all symlinks are copied as well).

    Having done this correctly everything works now.

    Still I don't understand how systemd in works in LE8 however - there must be a symlink somewhere - but it is not in /etc/systemd ...


    Unfortunately your rsync line does not copy all content, i.e. symlinks are skipped.
    I recommend wiping the USB disk and retry with

    Code
    rsync -a /storage/ /var/media/TV-201702/

    Thank you mglae - I'm happy to report that this works! For future reference, given a USB disk with label TV-201702, here are the steps that have worked (assuming that the destination is a newly formatted ext4 disk - otherwise wipe it clean first):

    # systemctl stop kodi# rsync -av /storage/ /var/media/TV-201702/# mount -o remount,rw /flash# nano /flash/cmdline.txt

    In my case, given a clean EXT4 formatted usb disk labelled TV-201702, change disk=/dev/mmcblk0p2 to:

    boot=/dev/mmcblk0p1 disk=LABEL=TV-201702 quiet

    Save the file (ctrl-x y enter). Then:

    # mount -o remount,ro /flash# reboot

    Checking the result after reboot, do:

    # dfFilesystem      . . .  Mounted on ./dev/mmcblk0p1  . . .  /flash/dev/sda1       . . .  /storage . . ./dev/mmcblk0p2  . . .  /var/media/mmcblk0p2-mmc-00000_0xb8c813ec

    That checks. Then do:

    # systemctl status service.tvheadend42service.tvheadend42.service - TVHeadend42 Service   Loaded: loaded . . .   Active: active (running) . . .  .  .  .

    Done!

    Thanks - I will not make any changes to the system - but I think this symlink is somehow related. I'm not familiar with the LibreELEC 8 OS so I'm doing some 'brute force' investigation - for example grepping all files for anything that contains 'tvheadend' and brute force searches for all symlinks with 'system' in them, etc.

    It seems that it would be safe to redirect anything that is not a hidden directory (and lost+found) under /storage. But the .kodi directory will be subject to frequent writes and the /run directory appears to contain the system logs (journals) - so they are going to put some wear and tear on a less reliable MicroSD. I've just gone through a failed MicroSD (using another OS, not LE) but fortunately when I set up the system a year or so ago I redirected all data and logs to a USB drive - so I didn't lose any data.

    Under LE8, what would be the best way to redirect a /storage directory, say /storage/videos; by fstab or by symlink? You see, with /flash/cmdlne.txt (and the related init scripts - a very clever implementation actually), I don't understand when fstab will be of use (if at all) ...

    Thanks again - should there be a link /etc/systemd/system -> /storage/.config/system.d? Is this correct?

    I am asking this because I have tried to move /storage from my microsd to a usb but presently this breaks systemd services, most notably for me tvheadend ... if it is safe to do so I can apply a link and I think this may solve the problem ... I just do not want to break anything in the process ...

    there is no .hts folder, the stuff that is usually at these folder is at /storage/.kodi/userdata/addon_data/service.tvheadend42 <- this should be there

    I guess that systemd isn't aware of the different disk and the service.tvheadend42.service aren't created. Idk if this is intention or an bug.

    Btw I have no real idea why you want to use the USB Stick instead of the SD card as it has speed wise downsides (USB stick, network and DVB stick sharing the same lousy bandwidth).

    CvH - I've made an enquiry [ thread-5672-post-37514.html#pid37514 ] as to documentation for systemd on LE8 - I don't yet understand how it works. A reply (Irusak) has indicated that there should be a symlink from /etc/systemd/system -> /storage/.config/system.d. My installation of LE8 does not have this link. Could this be the source of the problem?


    systemd on LibreELEC works exactly the same as on any other system. The only difference is that /etc/systemd/system is a symlink to /storage/.config/system.d

    Thank you for this Irusak - I've located /storage/.config/system.d but there is no link from /etc/systemd/system on my LE8 installation. I get:

    # ls -la /etc/systemd/total 6drwxrwxr-x 2 root root 91 Feb 21 19:48 .drwxrwxr-x 20 root root 929 Feb 21 19:52 ..-rw-r--r-- 1 root root 1017 Feb 21 19:48 journald.conf-rw-r--r-- 1 root root 1021 Feb 21 19:48 logind.conf-rw-r--r-- 1 root root 1604 Feb 21 19:48 system.conf-rw-r--r-- 1 root root 1130 Feb 21 19:48 user.conf

    This is why I am confused ...

    there is no .hts folder, the stuff that is usually at these folder is at /storage/.kodi/userdata/addon_data/service.tvheadend42 <- this should be there

    I guess that systemd isn't aware of the different disk and the service.tvheadend42.service aren't created. Idk if this is intention or an bug.

    Btw I have no real idea why you want to use the USB Stick instead of the SD card as it has speed wise downsides (USB stick, network and DVB stick sharing the same lousy bandwidth).

    Thanks again. Yes I understand that there should not be an .hts and that there is a userdata folder instead (which I think is a better solution). I just wanted to identify my surprise that an .hts was created when /storage was moved. Sorry if I have belaboured the issue.

    I wanted to have the flexibility to add more storage capacity on the RasPi 2. It's not really for speed. Also there is some debate over the reliability and lifespan of USB vs MicroSD - I have recent experience of a MicroSD failing (16 GB Samsung Ultra - have just thrown it out) whereas the USB still chugs on. They were both on the same RasPi box for about 18 months.

    Thanks for your help CvH I hope this can be resolved now.

    I've tried to find information that explains how systemd is implemented in LE8 - without any success. Can anyone point me to a resource that can explain the structure and how services are managed? LE8 does not appear to follow the traditional /etc/systemd init script approach - and it is difficult to figure out what is happening without some documentation ...

    the userdata is at /storage/.kodi/userdata/addon_data/service.tvheadend42
    and the binaries are at /storage/.kodi/addons/service.tvheadend42

    you could run systemctl status service.tvheadend42 if it shows something crazy

    at /storage/.kodi/userdata/addon_data/service.tvheadend42/service.log you have the tvh log and you can look if there is happening something crazy

    Thank you CvH. Yes when I examined the initial /storage location I could not find the .hts directory. When I moved the /storage to USB and the tvheadend server did not start, I manually tried to start it - this led to an .hts directory being created under the new (usb) /storage location. There are no journal messages and there is no service.log created, even after I manually start it. The messages I have provided are those emitted (to stdout/stderr) to the console.

    When I point /storage to USB (/dev/sda1), the original disk is moved to /var/media/mmcblk0p2-mmc-00000_0xb8c813ec/. Are there libraries on that disk mount that tvheadend under /dev/sda1 cannot locate?

    I have tried your suggestion to do 'systemctl status service.tvheadend42' (which works under the original installation) but the message I get in reply is:

    Unit service.tvheadend42.service could not be found

    Doing just 'systemctl status tvheadend42' yields:

    Unit tvheadend42.service could not be found

    Any ideas? For example would a symlink to service.tvheadend42 as tvheadend42.service solve the problem?

    I've just compared the PATH env variable of both installations and they are identical: /usr/bin:/usr/sbin:/storage/.kodi/addons/service.tvheadend42/bin:/storage/.kodi/addons/virtual.network-tools/bin:/storage/.kodi/addons/virtual.rpi-tools/bin:/storage/.kodi/addons/virtual.system-tools/bin

    CvH : I've posed a question on another board thread-5519-post-36819.html#pid36819 that has broken the TVHeadend42 server under LE8. I was directed here (to you) via the #hts irc.

    I have installed LE8 and TVHE42 on a RPi 2 microsd (8GB). It is working excellently - but I wanted to move the storage to a 32 GB Sandisk USB flash drive attached to the same device. This disk has the label TV-201702. So I did the following:

    Code
    # systemctl stop kodi
    # rsync -rtv /storage/ /var/media/TV-201702/
    # mount -o remount,rw /flash
    # nano /flash/cmdline.txt

    boot=/dev/mmcblk0p1 disk=LABEL=TV-201702 quiet

    Saved the file (ctrl-x y enter).

    Code
    # mount -o remount,ro /flash
    # reboot

    LE8 started as normal, Kodi started as normal, checking df shows that the storage was moved to /dev/sda1. But the TVHE42 server did not start.

    I've spent some time trying to resolve this. I tried to set up the system via cmdline.txt to point to /dev/sda1 (instead of LABEL=TV-201702). I checked the PATH and HOME environment - they are OK. I've gone through /etc/profile and /etc/profile.d/ to see if there is any issue there. I've also gone through the script /storage/.kodi/addons/service.tvheadend42/bin/tvheadend42.start to see if I could find anything. I tried to manually start tvheadend but no success. Oddly there is not much if anything reported in the logs, from what I can see. However when starting from command line I get the following:

    2017-02-27 17:03:34.256 [ INFO] htsp: Got connection from 192.168.1.3
    2017-02-27 17:03:34.258 [ INFO] htsp: 192.168.1.3: Welcomed client software: Kodi Media Center (HTSPv25)
    2017-02-27 17:03:34.259 [ INFO] htsp: 192.168.1.3 [ Kodi Media Center ]: Unauthorized access
    2017-02-27 17:03:39.260 [ INFO] htsp: 192.168.1.3 [ Kodi Media Center ]: Disconnected
    2017-02-27 17:03:39.262 [ INFO] htsp: Got connection from 192.168.1.3
    2017-02-27 17:03:39.262 [ INFO] htsp: 192.168.1.3: Welcomed client software: Kodi Media Center (HTSPv25)
    2017-02-27 17:03:39.264 [ INFO] htsp: 192.168.1.3 [ Kodi Media Center ]: Unauthorized access

    and so on ...

    I have been working with Linux systems for some years but the LibreElec (presumed derivative of OpenElec/BusyBox) architecture is new to me - I don't understand the init system - perhaps this is where the problem lay, I don't know.

    In any case I redirected cmdline.txt back to the microsd and the system is working as before. Any ideas as to why moving storage would break the TVHE42 server?

    Thanks Troggy - OK - I've tried to implement this but it breaks the TVHeadEnd 4.2 server.

    Here's the situation more explicitly; my default /flash/cmdline.txt contains:

    boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet

    I have a 32 GB USB (ext4) disk with the label TV-201702 mounted at /var/media/TV-201702.

    So here's what I did: 1) copy over the contents of /storage to the flash drive, 2) replace contents of cmdline.txt, and 3) reboot:

    Code
    # systemctl stop kodi
    # rsync -rtv /storage/ /var/media/TV-201702/
    # mount -o remount,rw /flash
    # nano /flash/cmdline.txt

    boot=/dev/mmcblk0p1 disk=LABEL=TV-201702 quiet

    Saved the file (ctrl-x y enter).

    Code
    # mount -o remount,ro /flash
    # reboot

    Now as I understand it, disk=LABEL=TV-201702 will become the data storage location - and sure enough checking the disks with df we find:

    /dev/mmcblk0p1 524008 141600 382408 27% /flash
    /dev/sda1 29766716 495272 27736316 2% /storage

    So far so good - but now there is no TVHeadEnd server.

    I've since reverted cmdline.txt back to default and rebooted - the TVHeadEnd server is working as before. I need to do some more investigation of this. There is no /storage/.hts subdirectory - the TVHeadEnd configuration must be somewhere else.


    The obvious ways are either, as vitorp07 suggests, to boot from usb (which has only recently become an option) or to boot from sd card but use a usb stick formatted to ext4 as a storage partition - that can be accomplished by editing cmdline.txt on the fat partition of your sd.

    I've got an 8 gb microsd with LE 8 on it. For the moment all source is on this disk. Then there is an empty SanDisk Cruizer 32 gb usb formatted to ext4 (it is recognized but not used at the moment).

    With cmdline.txt is there a way to redirect just the storage directory to the usb or will the entire root have to be redirected?


    Easiest way would be to actually install LibreELEC to the USB drive.

    Not disputing your advice, in hindsight this could be best, but I've already installed it on the microsd - don't want to re-install now. With other RPi OS's I've followed the traditional method using fstab. But I got a shock when I opened fstab and found nothing there.

    Another possible method is to just put a symbolic link from the microsd to the flash drive although it is not what I would want to do.

    Wondering if this should be done by other means, the LibreElec way, such as, for example, altering autostart.sh or setting up a systemd device?

    By the way I am very very impressed with this distro.

    Installed LE 8 today and wanted to move locations of frequent disk writes away from the sd card and to a usb flash drive. I had a peek at fstab and it is empty (first time I have observed this in Linux). Flash drive is installed and recognised.

    My interest is to redirect /storage and /var to the flash drive - but what is the recommended approach with the LE architecture?