Jump to content

mgutt

Moderators
  • Posts

    11,355
  • Joined

  • Last visited

  • Days Won

    124

Everything posted by mgutt

  1. I bought two new USB3 adapters from different brands through Amazon. Both use the same "ASM1051E" controller from ASMedia, but the second does not display the correct "iSerial": Bus 002 Device 003: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 9 idVendor 0x174c ASMedia Technology Inc. idProduct 0x55aa ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge bcdDevice 1.00 iManufacturer 2 ASMedia iProduct 3 ASM105x iSerial 1 8CHUDHEE ... Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 9 idVendor 0x174c ASMedia Technology Inc. idProduct 0x55aa ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge bcdDevice 1.00 iManufacturer 2 CnMemory iProduct 3 USB3-SATA-Device iSerial 1 123456789012 But this seems not to be important as both forward the original disk ID: But the most important part: Both support forwarding the standby mode which solves the issue: sdb=disk3=bus002device003 sda=disk6=bus002device002 Performance is good as well: As I was not able to find out how to check the sleep state if the usb adapter does not support the command, I close this bug report as its not solvable. The user needs to use a different adapter.
  2. Feature Requests from Reddit: - determine which disks were involved and spin them down after script execution - multiple path support (to scan movies and tv shows through one script) realised - obtain recent tv shows through Plex database and add the X next episodes to the cache (alternative request: move complete episodes to SSD cache which could be part of an additional script)
  3. v0.5 released Renamed the script, so it's hopefully more clear, that it covers TV Shows as well.
  4. You don't need to backup "docker.img": https://forums.unraid.net/topic/58690-does-it-make-sense-to-backup-the-docker-image/ And what about the database with your "watched status", settings etc? PS maybe you like to backup the appdata folder with this script as its incremental: https://forums.unraid.net/topic/97958-incremental-backup-through-rsync/?tab=comments#comment-903782 Once per month (on the first of course) would be sufficient. Of course. Every write which uses direct disk access (/mnt/cache) will be much faster than with shared disk access (/mnt/user). PS You could enable disk share, disable all shared access of your disks except of your cache disk, mount a subfolder of the cache disk as a local network drive on your client and by that you even use direct disk access while transfering files to your server. I described this here in my Guide in #3: https://forums.unraid.net/topic/97165-smb-performance-tuning/ And here are some user experiences regarding this, too: https://forums.unraid.net/topic/92282-solved-workaround-how-to-write-to-nvme-pcie-cache-at-full-1-gbs-with-10-gbe-nic/ Don't get confused as they are talking about 10G only. This "overhead" is a general issue for all transfers. It's only much more present with 10G.
  5. Yes, use the same script and change these values: video_path="/mnt/user/Movie/" video_min_size="2000MB" # 2GB, to exclude bonus content as follows (set your TV path of course): video_path="/mnt/user/TV/" video_min_size="500MB" While "500MB" is only an estimate of the minimum size of a TV episode. You could even lower it to "1MB" to cover everything. If you use both scripts parallel (to cache Movies and TV Shows) you should think about reducing this value as well: free_ram_usage_percent=50 Like 25 for TV shows and 25 for Movies or similar.
  6. Here you can see the RAM usage in the column "buff/cache". Before Plex Preloader: sync; echo 1 > /proc/sys/vm/drop_caches free -m total used free shared buff/cache available Mem: 64358 1154 60873 1027 2330 61580 Swap: 0 0 0 After: free -m total used free shared buff/cache available Mem: 64358 1216 27655 1027 35485 61405 Swap: 0 0 0 This means it used 35485 - 2330 = 33155 MB as Preload RAM Cache. After that I spun down all my disks, opened PMP and started a recently added movie and it started without any latency. I spun down all disks again and started one of my very first added movies and it took 8 seconds until it started playing.
  7. I'm still experimenting on this. I like to write the preloaded movie parts directly to a swap file, but I can't find a solution for this at the moment (Linux decides on its own which data is swapped). If this would be possible the complete Movie collection could be preloaded to a "small" swap file located on an SSD. I even played around with vmtouch to make this preloading permanent (as vmtouch can lock it in the RAM), but at the moment vmtouch seems to be buggy in Slackware (vmtouch daemon becomes randomly killed and sometimes its not possible to get any caching status).
  8. Have fun: https://forums.unraid.net/topic/97982-plex-movie-preloader-avoids-hdd-spinup-latency/ Depending on your RAM size it will preload much more than 10 Movies. In my case the 400 most recent movies are preloaded.
  9. This was an idea of @frodr. After several testings I came to the following script which: Caclulates how many Video files (small parts of them) will fit into 50% of the free RAM (amount can be changed) Obtains the X recent Movies / Episodes (depending on the used path) Preloads 60MB of the Video file leader and 1MB of the ending into the RAM Preloads subtitle files that belong to the preloaded Video file Now, if your disks are sleeping and you start a Movie or Episode through Plex, the client will download the Video parts from RAM and while the buffer is emptied, the HDD spins up and the buffer fills up again. This means all preloaded Movies / Episodes will start directly without delay. Donate? 🤗 Notes: It does not reserve any RAM, so your RAM stays fully available RAM preloading is not permanent and will be overwritten through server uploads/downloads, which means if you upload some huge files to your server, your RAM cache will be probably completely overwritten and by that all your nice cached movie files, too. That is the reason why I suggest to execute this script multiple times per day (only missing video files will be touched). As long the movie parts are still in the RAM, the disks do not spin up, while "rebuilding" the cache list, but the cached movie parts become "more popular" in the Linux cache. Applications like backup processes can overwrite the complete RAM cache, too. To avoid that, you should consider executing applications inside of containers and limit their RAM usage through the extra parameter "--memory=1G" (or whatever a container needs) If you suffer from buffering at the beginning of a Movie / Episode, try to raise "video_min_size" All preloaded videos can be found in the script's log (CA User Scripts) Script #!/bin/bash # ##################################### # Script: Video Preloader v1.4 # Description: Preloads the recent video files of a specific path into the RAM to bypass HDD spinup latency # Author: Marc Gutt # ######### Settings ################## video_paths=( "/mnt/user/Movie" "/mnt/user/TV" ) # the size of a video files must be at least 2GB (to exclude bonus content) video_min_size="2000MB" # we preload 60MB of the beginning of the video file into the RAM (raise this value if your video buffers after ~5 seconds) preload_head_size="60MB" # we preload 1MB of the end of the video file preload_tail_size="1MB" # if a preload is faster than 0.150 seconds than the video is already preloaded to the RAM preload_threshold="0.150" # preload only video files with specific extensions https://support.plex.tv/articles/203824396-what-media-formats-are-supported/ video_ext='avi|mkv|mov|mp4|mpeg' # preload only subtitle files with specific extensions # https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/#toc-1 sub_ext='srt|smi|ssa|ass|vtt' # we use 50% of our free RAM for preloading (it will be still free, check https://www.linuxatemyram.com/) free_ram_usage_percent=50 # set this to "1" to remove all preloads (this is only usefull if you want to force reading from Disk) preclean_cache=0 # notify if the execution was sucessful (errors produce notifications by default) notification=1 # ##################################### # # ######### Script #################### # timestamping logs exec &> >(stdbuf -o0 sed 's/%/%%/g' | xargs -d '\n' -I {} date '+%F %T {}') # make script race condition safe if [[ -d "/tmp/${0///}" ]] || ! mkdir "/tmp/${0///}"; then exit 1; fi; trap 'rmdir "/tmp/${0///}"' EXIT; # check user settings video_min_size="${video_min_size//[!0-9.]/}" # float filtering https://stackoverflow.com/a/19724571/318765 video_min_size=$(awk "BEGIN { print $video_min_size*1000000}") # convert MB to Bytes preload_head_size="${preload_head_size//[!0-9.]/}" preload_head_size=$(awk "BEGIN { print $preload_head_size*1000000}") preload_tail_size="${preload_tail_size//[!0-9.]/}" preload_tail_size=$(awk "BEGIN { print $preload_tail_size*1000000}") # check if paths are used in docker containers if docker info > /dev/null 2>&1; then # get docker mounts of all running containers # shellcheck disable=SC2016 docker_mounts=$(docker ps -q | xargs docker container inspect -f '{{$id := .Id}}{{range .Mounts}}{{if .Source}}{{printf $id}}:{{.Source}}{{println}}{{end}}{{end}}' | grep -v -e "^$") for path in "${video_paths[@]}"; do if [[ $docker_mounts != *"$path"* ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "Plex Preloader failed!" -d "$path is not used by a docker container!" exit 1 fi done fi # clean the read cache if [ "$preclean_cache" = "1" ]; then sync; echo 1 > /proc/sys/vm/drop_caches fi # preload calculation preloaded=0 skipped=0 preload_total_size=$((preload_head_size + preload_tail_size)) free_ram=$(free -b | awk '/^Mem:/{print $7}') free_ram=$((free_ram * free_ram_usage_percent / 100)) echo "Available RAM: $(numfmt --to si $free_ram)" preload_amount=$((free_ram / preload_total_size)) preload_size=$(( preload_head_size + preload_tail_size )) echo "Amount of videos that can be preloaded: $preload_amount (each video occupies $(numfmt --to si $preload_size))" # find all video files while IFS= read -r -d '' file; do video_files+=("$file") done < <(find "${video_paths[@]}" -not -path '*/.*' -size +"$video_min_size"c -regextype posix-extended -regex ".*\.($video_ext)" -printf "%T@ %p\0") # no video files found if [[ ${#video_files[@]} -eq 0 ]]; then echo "No $video_ext files found in ${video_paths[*]}!" else # sort all video files while IFS= read -r -d '' file; do video_files_sorted+=("$file") done < <(printf '%s\0' "${video_files[@]}" | sort -znr) # preload video files into RAM for i in "${!video_files_sorted[@]}"; do # stop if we reached our preload limit if [[ $i -ge $preload_amount ]]; then break; fi # remove modification time file=$(echo "${video_files_sorted[$i]}" | cut -f2- -d" ") TIMEFORMAT=%R seconds=$( { time head -c "$preload_head_size" "$file" >/dev/null; } 2>&1 ) if awk 'BEGIN {exit !('"$seconds"' >= '"$preload_threshold"')}'; then preloaded=$((preloaded + 1)) echo "Preloaded $file in $seconds seconds" else echo "Skipped $file as loading needed only $seconds" skipped=$((skipped + 1)) fi tail -c "$preload_tail_size" "$file" > /dev/null video_path=$(dirname "$file") # fetch subtitle files find "$video_path" -not -path '*/.*' -regextype posix-extended -regex ".*\.($sub_ext)" -print0 | while IFS= read -r -d '' file; do echo "Preloaded $file" cat "$file" >/dev/null done done fi # notification if [[ $preloaded -eq 0 ]] && [[ $skipped -eq 0 ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "Plex Preloader failed!" -d "No video file has been preloaded (wrong path?)!" elif [ "$notification" == "1" ]; then /usr/local/emhttp/webGui/scripts/notify -i normal -s "Plex Preloader has finished" -d "$preloaded preloaded (from Disk) / $skipped skipped (already in RAM)" fi
  10. You mean those directories, which are visible in the screenshot? The most recent backup is inside "/20201019_044002" (generated at 2020-10-19 04:40:02). It contains a full 1:1 backup of the source path, but as you can see it has only a small size (because of the hardlinks): du -d1 -h /mnt/user/Backup/Shares/Music 168G /mnt/user/Backup/Shares/Music/20200701_044011 4.2G /mnt/user/Backup/Shares/Music/20200801_044013 3.8M /mnt/user/Backup/Shares/Music/20200901_044013 497M /mnt/user/Backup/Shares/Music/20201001_044014 4.5M /mnt/user/Backup/Shares/Music/20201007_044016 4.5M /mnt/user/Backup/Shares/Music/20201008_044015 4.5M /mnt/user/Backup/Shares/Music/20201009_044001 4.5M /mnt/user/Backup/Shares/Music/20201010_044010 4.5M /mnt/user/Backup/Shares/Music/20201011_044016 4.5M /mnt/user/Backup/Shares/Music/20201012_044020 4.5M /mnt/user/Backup/Shares/Music/20201013_044014 4.5M /mnt/user/Backup/Shares/Music/20201014_044015 4.5M /mnt/user/Backup/Shares/Music/20201015_044015 4.5M /mnt/user/Backup/Shares/Music/20201016_044017 1.1M /mnt/user/Backup/Shares/Music/20201017_044016 5.0M /mnt/user/Backup/Shares/Music/20201018_044008 4.5M /mnt/user/Backup/Shares/Music/20201018_151120 4.5M /mnt/user/Backup/Shares/Music/20201019_044002 172G /mnt/user/Backup/Shares/Music
  11. Different lines could mean different commands. But it depends on the type of shell/terminal. It should be possible for all shells if you use backslashes: https://stackoverflow.com/a/18599906/318765
  12. I wonder that this script works in the terminal as you passed two paths: "mnt/user/mini/myfolder/" and ".". Simply remove the dot. It means "search everywhere starting at the root folder" and when it tries to find something in "/sys/kernel/slab" it will be blocked, which produces the error. Other examples: https://stackoverflow.com/a/26234223/318765 Note: I would write the command in one line as "-exec" is part of the "find" command.
  13. Maybe I can update the USB adapter, need to organize an RPI (ARM binary): https://wiki.odroid.com/odroid-xu4/software/jms578_fw_update#rivision_history_of_firmware
  14. The following script creates incremental backups by using rsync. Check the settings to define your own paths. Donate? 🤗 https://codeberg.org/mgutt/rsync-incremental-backup > incbackup.sh Explanations All created backups are full backups with hardlinks to already existing files (~ incremental backup) All backups use the most recent backup to create hardlinks or new files. Deleted files are not copied (1:1 backup) There are no dependencies between the most recent backup and the previous backups. You can delete as many backups as you like. All backups that are left, are still full backups. This could be confusing as most incremental backup softwares need the previous backups for restoring the data. But this is not valid for rsync and hardlinks. Read here if you need more informations about links, inodes and files. After a backup has been created the script purges the backup dir and keeps only the backups of the last 14 days, 12 month and 3 years, which can be defined through the settings logs can be found inside of each backup folder Sends notifications after job execution Unraid exclusive: Stops docker containers if the source path is the appdata path, to create consistent backups Unraid exclusive: Creates a snapshot of the docker container source path, before creating a backup of it. This allows an extremely short downtime of the containers (usually only seconds). How to execute this script? Use the User Scripts Plugin (Unraid Apps) to execute it by schedule Use the Unassigned Devices Plugin (Unraid Apps) to execute it after mounting a USB drive Call the script manually (Example: /usr/local/bin/incbackup /mnt/cache/appdata /mnt/disk6/Backups/Shares/appdata) How does a backup look like? This is how the backup dir looks like after several month (it kept the backups of 2020-07-01, 2020-08-01 ... and all backups of the last 14 days): And as it's an incremental backup, the storage usage is low: (as you can see I bought new music before "2020-08-01" and before "2020-10-01"): du -d1 -h /mnt/user/Backup/Shares/Music | sort -k2 168G /mnt/user/Backup/Shares/Music/20200701_044011 4.2G /mnt/user/Backup/Shares/Music/20200801_044013 3.8M /mnt/user/Backup/Shares/Music/20200901_044013 497M /mnt/user/Backup/Shares/Music/20201001_044014 4.5M /mnt/user/Backup/Shares/Music/20201007_044016 4.5M /mnt/user/Backup/Shares/Music/20201008_044015 4.5M /mnt/user/Backup/Shares/Music/20201009_044001 4.5M /mnt/user/Backup/Shares/Music/20201010_044010 4.5M /mnt/user/Backup/Shares/Music/20201011_044016 4.5M /mnt/user/Backup/Shares/Music/20201012_044020 4.5M /mnt/user/Backup/Shares/Music/20201013_044014 4.5M /mnt/user/Backup/Shares/Music/20201014_044015 4.5M /mnt/user/Backup/Shares/Music/20201015_044015 4.5M /mnt/user/Backup/Shares/Music/20201016_044017 4.5M /mnt/user/Backup/Shares/Music/20201017_044016 4.5M /mnt/user/Backup/Shares/Music/20201018_044008 4.5M /mnt/user/Backup/Shares/Music/20201018_151120 4.5M /mnt/user/Backup/Shares/Music/20201019_044002 172G /mnt/user/Backup/Shares/Music Warnings Its not the best idea to backup huge files like disk images that changes often as the whole file will be copied. A file change while copying it through rsync will cause a corrupted file as rsync does not lock files. If you like to backup for example a VM image file, stop it first (to avoid further writes), before executing this script! Never change a file, which is inside a backup directory. This changes all files in all backups (this is how hardlinks work)! Do not use NTFS or other partition formats, which do not support Hardlinks and/or Linux permissions. Format external USB drives with BTRFS and install WinBTRFS, if you want to access your backups through Windows. Do NOT use the docker safe perms tool if you backup the appdata share to the array. By that all file permissions are changed and can not be used by your docker containers anymore. Docker safe perms skips only the /mnt/*/appdata share and not for example /mnt/disk5/Backups/appdata!
  15. Add script to CA User Scripts: #!/bin/bash # make script race condition safe if [[ -d "/tmp/${0///}" ]] || ! mkdir "/tmp/${0///}"; then exit 1; fi trap 'rmdir "/tmp/${0///}"' EXIT # defrag all xfs drives - stops automatically after 2 hours xfs_fsr -v Add custom schedule "0 4 * * *" and it will be executed every night a 04:00 and stops after 2 hours. No brainer.
  16. If you set the config path to "/mnt/disks/PLEX" and this path exists, it will create subfolders and files in it.
  17. Ok, and what's the purpose of your post? ^^
  18. Intel i3-8100 undervolt --gpu -50 --core -50 --cache -50 --uncore -50 --analogio -50 crashed Intel i3-9350K undervolt --gpu -75 --core -100 --cache -100 --uncore -100 --analogio -100 crashed
  19. Beware! Undervolting can cause system crashs and this could cause data loss! Use it on your own risk! Undervolting Undervolting reduces the power usage of your CPU. Depending on the CPU and used settings 5 to 10W on full load and 0 to 1W in idle. Important: At first you should stop your array to avoid data loss (and to avoid parity check on reboot)! Requirements (install them through NerdPack) - Python 3 - pip - setuptools Execute the following script by CA User Scripts (do not schedule it, until you did not stress test your setting!): #!/bin/bash # ##################################### # Script: Intel Undervolting v0.5 # Description: Undervolts your Intel CPU # Author: Marc Gutt # # Changelog: # 0.5 # - reset install method to v0.3 # 0.4 # - reset undervolt installation method # - check install file integrity # 0.3 # - changed undervolt installation method # 0.2 # - bug fix # - unraid notification added # - more log output # 0.1 # - first release # # ######### Settings ################## notification=1 # ##################################### # # ######### Script #################### # make script race condition safe if [[ -d "/tmp/${0///}" ]] || ! mkdir "/tmp/${0///}"; then exit 1; fi; trap 'rmdir "/tmp/${0///}"' EXIT; # Check if python3 is installed (can be installed through NerdPack) # check if Python 3 is installed if [[ "$(python3 -V)" =~ "command not found" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "Python 3 is missing!" fi # check if pip is installed if [[ "$(pip -V)" =~ "command not found" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "pip (Python package manager) is missing!" exit 1 fi # check if setuptools is installed if [[ ! "$(pip list)" =~ "setuptools" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "setuptools (Python package library) is missing!" exit 1 fi # Check and install undervolt if [[ ! "$(undervolt --version)" =~ "undervolt" ]]; then echo "Undervolt is missing and will be installed..." pip install undervolt fi # Get CPU Model cpu_model=$(lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1') echo $cpu_model # Undervolt CPU undervolt --gpu -50 --core -50 --cache -50 --uncore -50 --analogio -50 undervolt --read undervolt_read=$(undervolt --read | tr '\n' ' ') if [[ $notification == "1" ]]; then /usr/local/emhttp/webGui/scripts/notify -i normal -s "CPU undervolted" -d "$undervolt_read" fi -50mV should work with all CPUs, but I suggest to stop the array first, install stress and perform it as described in the next section, before using the undervolted CPU on your productive server. Other often used variants as an example: undervolt --gpu -75 --core -100 --cache -100 --uncore -100 --analogio -100 undervolt --gpu -50 --core -130 --cache -100 --uncore -130 --analogio -100 Feel free to post your CPU model and used command. Stress After setting the undervolting (you hopefully stopped your array, if not, do it!), you can now install stress as follows: wget https://packages.slackonly.com/pub/packages/14.2-x86_64/system/stress/stress-1.0.4-x86_64-1_slonly.txz -P /tmp upgradepkg --install-new /tmp/stress-1.0.4-x86_64-1_slonly.txz And execute it as follows if your CPU has 4 cores (change the value as needed): stress --cpu 4
  20. I opened a ticket at smartmontools, so the tool hopefully changes its behaviour.
  21. Dirty hack Add this to the Go file: # ------------------------------------------------- # USB HDD sleep bug fix # https://forums.unraid.net/bug-reports/stable-releases/683-usb-hdds-randomly-spin-up-but-status-stays-unchanged-r1091/?tab=comments#comment-11087 # ------------------------------------------------- sed -i -- 's/by %s -A/by %s -i/g' /usr/local/sbin/emhttpd Before that (which loads emhttpd): # ------------------------------------------------- # Start the Management Utility # ------------------------------------------------- /usr/local/sbin/emhttp & Note: This will suppress displaying the temps! And sadly it does not solve the icon issue. I think the active / inactive status is extracted from the "CHECK POWER MODE" status. In very rare cases the USB disks still wake up. I need to investigate this further, but I think the USB adapter itself is the problem
  22. I like to have undervolt: https://slackware.pkgs.org/current/slackware-x86_64/undervolt-20200612_07d0c70-x86_64-1.txz.html It allows undervolting the CPU/iGPU.
  23. haveged is loaded through Unraid in "/etc/rc.d/rc.M": # Start the haveged entropy daemon: if [ -x /etc/rc.d/rc.haveged ]; then /etc/rc.d/rc.haveged start fi If I download a file haveged produces load: I stopped the service as follows: /etc/rc.d/rc.haveged stop Stopping haveged. I found no impact. The server runs as usual. So same question. Why is it needed? EDIT: Regarding this blog post haveged becomes active if the entropy of haveged is stronger than the one of /dev/random (linux default). So it adds a little bit more strength to the smb encryption while transfering the file. Conclusion: Produces load, I don't need it. Will be disabled by default through the Go File: # ------------------------------------------------- # disable haveged as we trust /dev/random # https://forums.unraid.net/topic/79616-haveged-daemon/?tab=comments#comment-903452 # ------------------------------------------------- /etc/rc.d/rc.haveged stop
  24. Ok, catched it: top - 22:56:25 up 22:11, 2 users, load average: 0.01, 0.02, 0.00 Tasks: 257 total, 1 running, 250 sleeping, 0 stopped, 6 zombie %Cpu(s): 0.6 us, 0.1 sy, 0.0 ni, 89.4 id, 9.7 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 64358.4 total, 20504.6 free, 9912.9 used, 33940.9 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 53088.3 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4683 root 20 0 283604 4132 3416 S 0.2 0.0 3:24.90 /usr/local/sbin/emhttpd 5256 root 20 0 149776 8300 3752 S 0.2 0.0 0:18.49 nginx: worker process 17144 root 20 0 0 0 0 I 0.2 0.0 0:01.73 [kworker/3:3-events_freezable] 25275 root 20 0 7464 4676 3620 D 0.2 0.0 0:00.01 /usr/sbin/smartctl -n standby -A /dev/sdb 25276 root 20 0 0 0 0 Z 0.2 0.0 0:00.01 [smartctl] <defunct> 25278 root 20 0 7464 4580 3524 D 0.2 0.0 0:00.01 /usr/sbin/smartctl -n standby -A /dev/sda 25279 root 20 0 0 0 0 Z 0.2 0.0 0:00.01 [smartctl] <defunct> 1 root 20 0 2468 1684 1576 S 0.0 0.0 0:10.52 init Let's verify it. Spin down USB... takes long time, so it's spinning down mdcmd spindown 6 Check status of SATA... no delay /usr/sbin/smartctl -n standby -A /dev/sdg smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org Device is in STANDBY mode, exit(2) Check status of USB... takes very long time, so it's spinning up /usr/sbin/smartctl -n standby -A /dev/sda smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org CHECK POWER MODE: incomplete response, ATA output registers missing CHECK POWER MODE not implemented, ignoring -n option === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0 2 Throughput_Performance 0x0005 132 132 054 Pre-fail Offline - 96 3 Spin_Up_Time 0x0007 163 163 024 Pre-fail Always - 416 (Average 389) 4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 401 5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0 7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0 8 Seek_Time_Performance 0x0005 128 128 020 Pre-fail Offline - 18 9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 4336 10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 59 22 Helium_Level 0x0023 100 100 025 Pre-fail Always - 100 192 Power-Off_Retract_Count 0x0032 099 099 000 Old_age Always - 1683 193 Load_Cycle_Count 0x0012 099 099 000 Old_age Always - 1683 194 Temperature_Celsius 0x0002 187 187 000 Old_age Always - 32 (Min/Max 25/55) 196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0 197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0 Bug Fix "smartctl" ignores "-n standby" as the USB device does not support power checks: CHECK POWER MODE: incomplete response, ATA output registers missing CHECK POWER MODE not implemented, ignoring -n option The same message is displayed if the "-i" option is used, but this does not spin up the drive, so I suggest to use this command, before executing "-A" (to obtain the temps/errors etc): /usr/sbin/smartctl --nocheck standby -i /dev/sdb Sadly this won't solve the active / inactive icon, temps, etc as Unraid seems to rely on the correct answer of the "-A" option. I was not able to find out if the disk is active or not. I tried to obtain the usb power: lsusb -v|egrep "^Bus|MaxPower" But it returns all the time "896mA", sleeping or not. Even fully disabling the USB port is not possible anymore, as "suspend" has been removed from recent Kernels: https://unix.stackexchange.com/a/166601/101920
  25. At the moment I try to observe this. This are the things I found out: Status USB = sdb = disk3 SATA = sdg = disk7 USB smartctl --nocheck standby -i /dev/sdb smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org CHECK POWER MODE: incomplete response, ATA output registers missing CHECK POWER MODE not implemented, ignoring -n option === START OF INFORMATION SECTION === Model Family: HGST Ultrastar DC HC520 (He12) Device Model: HGST HUH721212ALE604 Serial Number: 8CHUDHEE LU WWN Device Id: 5 000cca 26fd9a3b2 Firmware Version: LEGNW3D0 User Capacity: 12,000,138,625,024 bytes [12.0 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 7200 rpm Form Factor: 3.5 inches Device is: In smartctl database [for details use: -P show] ATA Version is: ACS-2, ATA8-ACS T13/1699-D revision 4 SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Fri Oct 16 21:32:04 2020 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled SATA smartctl --nocheck standby -i /dev/sdg smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org Device is in STANDBY mode, exit(2) USB hdparm -C /dev/sdb /dev/sdb: SG_IO: bad/missing sense data, sb[]: 70 00 01 00 00 00 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 drive state is: unknown SATA hdparm -C /dev/sdg /dev/sdg: drive state is: standby Both commands do not wake up the disks. Monitoring - If the USB disks randomly spin up, they spin up both. Its never only one of it. - inotifywait does not return any file access Does Unraid periodically execute a command which checks the HDD status or similar? Next step is this command to log all processes: top -b -c -d 5 > /mnt/cache/top.log Sadly "lastcomm" is not available because of "accton: Function not implemented" which should mean the Linux Kernel of Unraid has not enabled accounting.
×
×
  • Create New...