Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

5 Neutral

About CS01-HS

  • Rank


  • Personal Text
    [10TB UNRAID SERVER v6.8.3]
    Asrock J5005 • IBM H1110 IT mode • Intel® Pentium Silver @ 2.8GHz • 8GB DDR4 • 3x 5TB Data • 2x 500GB Cache
  1. I have a USB HDD in unassigned devices which I use for backups. The drive won't spin down for whatever reason, mounted or not. My solution was a modified version of this script that I have User Scripts run every hour. It takes a list of drives, checks for activity and spins them down if they're inactive and spun up. I thought I'd share it. NOTE: The green "led" in Unassigned Devices stays green even when the drive's spun down, I don't know how or if it detects power status. #!/bin/bash # This script looks for recent disk access, and if nothing has changed, puts /dev/disk/by-id/${drive} into spindown mode. # # Set your drive identifiers (listed in /dev/disk/by-id/) ignoring characters after the last "-" # e.g. listing: usb-WD_My_Passport_25E2_75831314363630505A37-0:0 # becomes: usb-WD_My_Passport_25E2_75831314363630505A37 drives=( "<DRIVE_IDENTIFIER_1>" "<DRIVE_IDENTIFIER_2>" ) # Set the directory where drive status files will be stored. # /tmp/ would be standard but that may wake the array # so maybe somewhere under /mnt/cache is better status_dir="/tmp" current=`date` DEBUG="false" # create status_dir if it doesn't exist mkdir -p ${status_dir} for device_id in ${drives[*]} do device=`ls -l /dev/disk/by-id/ | grep ${device_id} | head -1 | tail -c4` filename="${status_dir}/diskaccess-${device_id}.status" stat_new=`cat /sys/block/${device}/stat | tr -dc "[:digit:]"` if [ -f "${filename}" ]; then stat_old=`cat ${filename} | tr -dc "[:digit:]"` if [ "${stat_old}" == "${stat_new}" ]; then if [ ${DEBUG} == "true" ]; then echo ${current} "- Executing: smartctl --nocheck standby -i /dev/${device} | grep 'Power mode is'" power_mode=`smartctl --nocheck standby -i /dev/${device} | grep 'Power mode is'` echo ${current} "- ${power_mode}" fi is_awake=`smartctl --nocheck standby -i /dev/${device} | grep 'Power mode is' | egrep -c 'ACTIVE|IDLE'` if [ "${is_awake}" == "1" ]; then echo ${current} "- Drive /dev/${device} is awake but hasn't been used; spinning down" hdparm -y /dev/${device} > /dev/null 2>&1 fi else echo ${current} "- Drive /dev/${device} has been used..." echo ${stat_new} > ${filename} fi else echo ${current} "- ${filename} file does not exist; creating it now." echo ${stat_new} > ${filename} fi done
  2. Glad it worked. It's a nice little board.
  3. With the official EmbySever container, follow the instructions here, substituting Emby where appropriate: Then go to Main -> Flash -> Syslinux Configuration -> Unraid OS and change the line: append initrd=/bzroot to append initrd=/bzroot intel_iommu=igfx_off Hit "Apply" and reboot. At this point hardware encoding should be working but the video output will be garbled. Follow instructions here to resolve that:
  4. I'm in the same boat. External disks work consistently, iPhone not at all. Unfortunately my board has a single integrated USB controller and no free PCIe slot so the "pass a controller" solution doesn't work. I tried VirtualHere (USB over ethernet) but apparently iPhone sync with a Mac host requires a Mac client. That didn't work in my case but may work for others.
  5. Same. Tell me if this makes sense: In "target mode" there are two basic conditions to handle: (1) a large cache write (2) many small or medium cache writes Case (1) has the potential to fill the drive if a high target (say 75%) is specified, so mover must run frequently enough to detect it and free cache space. With frequent mover runs, assuming the age logic is granular (find sorted by age and iterate the files summing size), case (2) will cause very frequent array writes as a handful of files are moved on each run to maintain the target %. Better then to move the old files off in larger chunks, time rounded to the day (e.g. first all files older than 30 days from current date at 12am, then all older than 29, etc.) That was all preface (sorry!) to answer your question: I think it's almost entirely a UI decision. You could handle a target % and complex rules in code by calling your current rules logic in a loop from e.g. i=30 down, find older than i days until target free space is reached. And if it fails to free enough space that's on the user. Your "Or..." which is my preference (your range is good), would be similar but skip over the complex rules logic avoiding failures due to user error. Both proposals are a little hack-y (maybe you have a better idea) but I think until smart caching's built in every solution will be somewhat hack-y. I really appreciate this exchange but please don't let me derail what's obviously a popular plugin to handle my (potentially minority) use case.
  6. I'm all caught up on the thread. Just thinking out loud but maybe an easier method that gets most of the benefits is to use last-modified (as you do in the age setting) and when a user-specified target cache % is exceeded iterated find commands (which should be cheap on an SSD) slice off the oldest files until the target % is restored.
  7. Well that makes things tougher! I wonder if SMB/AFP requests could be intercepted and stored with a timestamp. Thanks for the direction, I'll read up.
  8. Glad I could contribute a little and thanks for a great plugin. All was well with my cache until I added time machine - now my once-sleepy parity disk (and every other disk thanks to turbo write) never rest. Mover Tuner has helped greatly but I'm thinking for my purposes (media and Time Machine) a cache that stays relatively full and evicts based on last access date would be ideal. I'll research to see if that's even possible and how difficult it would be and maybe write something.
  9. I think there's a bug where the script doesn't quote share directories so e.g. a share with the name "Time Machine" will cause this error: May 11 05:42:07 NAS root: find: '/mnt/cache/Time': No such file or directory May 11 05:42:07 NAS root: find: 'Machine/': No such file or directory which I hadn't seen previously (though it's possible I missed it.) It's probably not best practice to include spaces in share names and I've solved it by renaming but thought I'd mention it. Great plugin by the way, thanks.
  10. Since this patch is required whenever the container's reinstalled I wrote a quick script for the User Scripts plugin. It removes the iHD driver because why not. #!/bin/bash docker exec EmbyServer /bin/sh -c "rm /lib/dri/iHD_drv_video.so" 2>/dev/null if [[ $? -eq 0 ]]; then echo "Detected iHD driver. Deleting and restarting EmbyServer..." docker restart EmbyServer echo "Done." fi exit 0
  11. The instructions here enabled hardware decoding on my j5005 board (UHD Graphics 605/Gemini Lake) but encoding produced garbled output. I assumed it had something to do with Unraid or the 4.19 kernel but apparently not - it's solved by forcing Emby to use the container's i965_drv_video.so instead of iHD_drv_video.so. Here's how to do that: # Launch an EmbyServer shell: docker exec -it EmbyServer /bin/sh # Inside the shell disable iHD_drv_video.so cd lib/dri/ mv iHD_drv_video.so iHD_drv_video.so.bak # Restart EmbyServer Now both hardware decode and encode should work. NOTE: You must add intel_iommu=igfx_off to your syslinux.cfg NOTE: I'm using the official EmbyServer release in Community Apps