Android dropping off folders; veto files not working; cron job not working; help!

  • Hi folks,

    I have LibreELEC 8.0.1 running flawlessly on my recently acquired Intel NUC. I have a 4TB HDD attached to the NUC via USB 3.0. The consistency of LibreELEC's network reliability is stunning compared to Windows or Mac, and I love it.

    I just need to make a small change and I found a discussion online somewhere, but it really didn't elaborate enough.

    My Nvidia Shield TV, in another room, regularly accesses the LibreELEC share I've created for my media. The problem is - the Android OS marks its territory with the creation of an "Android" folder in EVERY directory and subdirectory that I navigate to.

    I consistently check my media manager software counts, Kodi counts, and item counts in my shares, and I'd like them to be right without having to subtract 1 for "Android" in each shared folder.

    Is it possible to create a rule in LibreELEC as specific as *Remote Android SMB User cannot create folders.* (something to that effect) Or do I need to fix this another way?

    Thanks in advance!

  • I'd love some help here from any of you fine folks, pretty please! Simply tell me what you need me to provide.

    I'm also running into errors on bootup. (see TEXT below - screenshot is just a directory listing for the heck of it)

    I do have a Win10/Ubuntu/LibreELEC setup, but I followed very explicit instructions for a multi-boot to set it up correctly from one of the LibreELEC board regulars, and LibreELEC had been working fine since. (Until this attempt to stop my Nvidia Shield TV from its Android folder generation spree...)

    I would not normally have 3 operating systems, but my 2017 NUC had a lot of audio issues that Intel needed to sort out before I could get Kodi to properly output multichannel PCM to my older receiver - this has been a multi-month process.

    Now that I've created the samba.conf from samba.conf.sample, all of this is happening. Does anyone see any any syntax errors in my editing of the samba.conf file above? I believe I followed Chewitt's instructions correctly.

    *** Error in mount_storage: mount_common: Could not mount /dev/sda8 ***

    LibreELEC is actually (for sure) /dev/sda7, and it said sda7 on the 1st reboot, but when I tried to boot again the error now says sda8, and I'm worried I may be in some deep doo doo.

    ----BEGIN ABNORMAL BOOTUP MESSAGES----
    ### Starting debugging shell... type exit to quit ###
    sh: can't access tty; job control turned off
    # exit
    cp: can't stat '/flash/SYSTEM' : No such file or directory
    *** Error in prepare_sysroot: mount_common: Could not mount /dev/SYSTEM ***
    ### Starting debugging shell... type exit to quit ###
    sh: can't access tty; job control turned off
    # _<---cursor
    ----END ABNORMAL BOOTUP MESSAGES----

    • Official Post

    Creating /storage/.config/samba.conf will not cause a boot failure. That code is relatively unchanged since OE 1.0 days and we would see thousands of forum posts if it were true. The boot message says it cannot find the SYSTEM file in the boot partition (first partition of two used by LE) which is normally because some other process messed with the bootloader config so the partition is wrongly identified or the file is not present or corrupted (cannot uncompress).

    I've also tested this out now that I'm not on vacation and (sorry) it doesn't work quite as expected. It's not blocking creation of a directory; samba docs only talk about blocking files so it might be that explicit. Also, blocking a Thumbs.db file that I copy/paste prompts macOS/finder to ask for credentials instead of the copy operation silently failing. It may be easier to let Android do its thing uninterrupted and just run a regular find/delete command via cron instead.

    NB: In MacOS you can prevent write of _ and . files: Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connections - Apple Support so no need to do that with Samba


  • Creating /storage/.config/samba.conf will not cause a boot failure. That code is relatively unchanged since OE 1.0 days and we would see thousands of forum posts if it were true. The boot message says it cannot find the SYSTEM file in the boot partition (first partition of two used by LE) which is normally because some other process messed with the bootloader config so the partition is wrongly identified or the file is not present or corrupted (cannot uncompress).

    I've also tested this out now that I'm not on vacation and (sorry) it doesn't work quite as expected. It's not blocking creation of a directory; samba docs only talk about blocking files so it might be that explicit. Also, blocking a Thumbs.db file that I copy/paste prompts macOS/finder to ask for credentials instead of the copy operation silently failing. It may be easier to let Android do its thing uninterrupted and just run a regular find/delete command via cron instead.

    NB: In MacOS you can prevent write of _ and . files: Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connections - Apple Support so no need to do that with Samba

    Thanks for your help Chewitt!

    I included the steps I followed from fellow board member Klojum below for my multi-boot setup. I'm new to Linux but a lot of the CLI stuff is of course quite similar to using Terminal in macOS.

    I agree that it's not the .conf file, though when I reverted to the embedded .conf (leaving only the sample) bootup went back to normal. I think it's some trouble I had post-installation when I was doing using "Grub Customizer" - it nuked my grub.cfg. I ended up using a repair tool that 95% fixed things. I think it was this: boot-repair-disk download | SourceForge.net. I ended up with two Windows references on my Grub2 screen though. Unsure why.

    ---START KLOJUM TUTORIAL---
    (Mind you, this tutorial is all with no guarantee whatsoever if you yourself fcuk up.)
    Since you are using Ubuntu and talk about extended partitions, you should also be comfortable using bootable tools like Gparted Live. If so, create 2 EXT4 partitions : one 512MB system partition, the another one using up the rest of the availabe free space for LibreELEC's storage partition. Whether those are primary or extended is up to you. All primary is possible when you have no seperate partitions for Linux's home, boot, or its other options. So if you have currently only a single EXT4 partition for Ubuntu along with a SWAP partition, it's possible. Otherwise, create the 2 EXT4 partitions in the extended partition area. Also, give the new partitions labels, to identify them more easily.

    Reboot the machine, Ubuntu should start.
    Go into a terminal. Type sudo blkid
    You will get a list of drives/partitions, pick out your two new partitions, and remember their device numbers. You will need them later on.
    Now you need to add the LibreELEC menu item to the GRUB2 boot system.
    In the terminal, type sudo nano /etc/grub.d/40_custom .
    Paste in the following text:
    menuentry "LibreELEC 8.0 Krypton" {
    set root=(hd0,6)
    linux /KERNEL boot=/dev/sda6 disk=/dev/sda7 quiet
    }

    Replace all three drive numbers (in my case, twice 6 & 7) with the ones you got for your respective system and storage partitions from the blkid command.
    CTRL-O for storing the file changes
    CTRL-X for leaving the nano editor

    Update the GRUB2 menus: sudo update-grub2 .
    ---END KLOJUM TUTORIAL---

    Everything worked great except for the audio, but I'd been warned. After all the fuss with Grub Customizer + the repair tool, I knew there were probably some deep-seated issues, but I figured I'd leave it alone after LibreELEC finally started producing multi-channel audio with new Intel HDMI firmware. That whole situation is probably why I'm having issues now.

    I attached /boot/grub/grub.cfg as grub.txt if anyone cares to take a look at it and see what the heck happened between Grub Customizer and the repair tool.

    I have no experience with cron jobs unfortunately. After all the time I've spent on this I'm just drained. I'll take a look but I'm worried that I'll destroy something else in the process at this point. :/

    I'll execute that command in macOS - I noticed it in your original post as well. Btw, when I read the veto files instructions, I thought I saw it say files or directories. Hmm.


  • Creating /storage/.config/samba.conf will not cause a boot failure. That code is relatively unchanged since OE 1.0 days and we would see thousands of forum posts if it were true. The boot message says it cannot find the SYSTEM file in the boot partition (first partition of two used by LE) which is normally because some other process messed with the bootloader config so the partition is wrongly identified or the file is not present or corrupted (cannot uncompress).

    I've also tested this out now that I'm not on vacation and (sorry) it doesn't work quite as expected. It's not blocking creation of a directory; samba docs only talk about blocking files so it might be that explicit. Also, blocking a Thumbs.db file that I copy/paste prompts macOS/finder to ask for credentials instead of the copy operation silently failing. It may be easier to let Android do its thing uninterrupted and just run a regular find/delete command via cron instead.

    You can ignore my last long babbling post; I overcame a couple hurdles, but got nowhere. I finally got the OS to allow the presence of a manually edited samba.conf file with the two veto files lines added to each share.

    AND - I have a cron job running every 10 minutes that is supposed to delete the Android folders. (It works manually, but not via cron, as you can see in the screenshot below. Notice that the find command returns no results after I manually execute the remove command.) But even with BOTH of these in place, the Android folders are still appearing. :huh:

  • It says Active, yet in the line above it says disabled AND vendor preset disabled. (I switched it on in LibreELEC settings, so I understand why it says vendor preset disabled...but what about the other disabled remark?)

    Anyone out there?