Jump to content

mgutt

Moderators
  • Posts

    11,355
  • Joined

  • Last visited

  • Days Won

    124

Everything posted by mgutt

  1. Ja das passiert bei manchen USB Controllern. PS wenn du Pech hast, geht die Platte jetzt nicht mehr schlafen. Fahr sie mal runter und führe diesen Befehl aus ("sde" bei Bedarf anpassen): /usr/sbin/smartctl -n standby -A /dev/sde Wenn der Befehl kurz steht und dann ein Fehler und Informationen der Platte kommen, dann wird der Power Mode nicht unterstützt. Dann ist der Adapter nicht für Unraid geeignet. Die korrekte Antwort enthält zwei Zeilen und das Wort "STANDBY". Dazu würde ich gar nicht raten. Erstmal hast du nicht gefragt wann er das letzte mal die Parität geprüft hat. Und dann dauert dein Vorschlag viel länger, weil er die komplette Platte neu schreiben muss. New Config mit Preserve Parity und Cache geht viel schneller. Dann kann er die Platten genau wie vorher zuordnen und muss nur noch mal abschließend einen Parity Check mit Korrektur durchführen. Der sollte dann keine Fehler finden. Kommt aber übrigens bei USB vor, siehe mein Ergebnis nach dem gestrigem Adapterwechsel und da war die Parität gerade mal 2 Tage alt: Jedenfalls geht der Check viel schneller, weil er nur liest. Natürlich muss man vorher einen Screenshot machen, damit man noch weiß welche Disk wohin kommt. Im Notfall steht es übrigens auch in der super.dat old. Er nutzt doch USB. Hat er doch gesagt. 3x darfst du raten was dann langsam ist ^^ @zero_neverload Nach dem Alter der CPU wird es wohl kein USB3.0 sein?
  2. My first plugin will add file browser features to the WebGUI. But don't tell anyone ^^
  3. If a file needs to be defragmentated, it will update the Parity as usual. So it does not "bypass" the parity if this was your thought. Is this even possible? I don't know.
  4. Ok done. The Script v0.2 now automatically recognizes SSDs and skips them.
  5. Ok, now I'm confused as both code variants work. Edit v0.7 and search for: size=$(stat -c%s "$file") Replace it against: size=$(stat -c%s "$file") echo "$file has a size of $size" After execution. Do you see an massive amount of entries in the logs or does it still only return srt filenames?
  6. No. Only the link to the file is deleted. A hardlink is only an additional link to the file and as long links exist, the file exists. No. You need only one of the folders. Nice, isn't it I'm not sure if I understand the question properly. I try to explain as follows: - the backup from 10th October 2019 will be deleted if 14 newer daily backups exist - the 10th of October is not kept as monthly backup as it's not generated on the 1st of a month - the 10th of October is not kept as yearly backup as it's not generated on the 1st of January Note: I know this is not an optimal situation. I'm still working on a solution for that.
  7. When this happens execute the following to see all Plex processes top -b -c -d 5 | grep -i -E "(top -|tasks:|%cpu|mem:|swap:|plex)" I guess Plex: - rescans the library - Plex generates Thumbnails - Plex tries to find tv show intros (so they can be skipped)
  8. If you are interested: https://forums.unraid.net/topic/98033-xfs-extended-defragmentation/ Solved it as follows: parity_id=$(mdcmd status | grep rdevName.0 | cut -d = -f 2) echo "Parity has device id $parity_id" parity_state=$(smartctl -n standby "/dev/$parity_id")
  9. Ok, you asked for it ^^ https://forums.unraid.net/topic/98033-xfs-extended-defragmentation/
  10. Does anyone know how it could be possible to check if a disk is an SSD? By that we could automatically obtain the SSD disk IDs and remove the "ignore_disks" setting from the script.
  11. The default xfs_fsr command defragmentates all XFS disks. For SSDs it isn't only useless, but also wears them out. This script: does not defrag SSDs does not defrag NVMe defrags for a specific time in seconds (default is 7200 seconds = 2 hours) defrag_only_sleep=1 (defrags only if parity is not spinning) #!/bin/bash # ##################################### # Script: XFS Extended Defragmentation v0.2 # Description: Defragmentate only HDDs (SSDs will be ignored) if requirements met for a selectable running time. # Author: Marc Gutt # # Changelog: # 0.2 # - SSD recognition added # 0.1 # - first release # # ######### Settings ################## defrag_seconds=7200 defrag_only_sleep=1 notification=1 # ##################################### # # ######### Script #################### # make script race condition safe if [[ -d "/tmp/${0///}" ]] || ! mkdir "/tmp/${0///}"; then exit 1; fi; trap 'rmdir "/tmp/${0///}"' EXIT; # defrag only if parity is not spinning if [[ $defrag_only_sleep == "1" ]]; then # obtain parity disk's device id parity_id=$(mdcmd status | grep rdevName.0 | cut -d = -f 2) echo "Parity has device id $parity_id" # we defrag only if parity is not spinning parity_state=$(smartctl -n standby "/dev/$parity_id") if [[ $parity_state != *"STANDBY"* ]]; then echo "Defragmentation has been skipped because of active parity disk" exit fi fi echo "Search for HDDs..." # parse /etc/mtab and check rotational status declare -a mtab while IFS= read -r -d '' line; do disk_id_regex="^/dev/md([0-9]+)" if [[ "$line" =~ $disk_id_regex ]]; then disk_id=${BASH_REMATCH[1]} rotational=$(cat /sys/block/md${disk_id}/queue/rotational) if [[ "$rotational" == "1" ]]; then mtab+=("$line") echo "Found HDD with id md${disk_id} (added)" continue fi echo "Found SSD with id md${disk_id} (skipped)" fi done < <(cat /etc/mtab | grep -E '^/dev/md' | tr '\n' '\0') if [ ${#mtab[@]} -eq 0 ]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "XFS Defragmentation failed!" -d "No HDD found!" exit fi printf "%s\n" "${mtab[@]}" > /tmp/.xfs_mtab echo "Content of /tmp/.xfs_mtab:" cat /tmp/.xfs_mtab # defrag xfs_fsr -v -m /tmp/.xfs_mtab -t "$defrag_seconds" -f /tmp/.xfs_fsrlast
  12. I meant through a command. I mean I could filter the syslog, but is this the only solution?
  13. This is strange. I mean I changed the code, but a) it works for me and b) it was not a huge change 1.) Are you using unraid 6.8.3? 2.) Do you execute the script through CA User Scripts? Please test this code: movie_path="/mnt/user/Movies" echo "Process substitution test" while IFS= read -r -d '' file; do echo "$file" done < <(find "$movie_path" -iname "*.mkv" | tail -3 | tr '\n' '\0') echo "Piping test" find "$movie_path" -iname "*.mkv" | tail -3 | tr '\n' '\0' | while IFS= read -r -d '' file; do echo "$file" done You could even execute it through the WebTerminal. Both tests should return 3 filenames. If not, do you get an error message?
  14. No need to modify the script. It does nothing special except of preloading data into the RAM. Maybe you suffer from a deep idle state. As an example, Seagate Ironwolf and Exos have 4 different idle states, and some of them even reduce the RPM to save energy, which raises latency: https://www.seagate.com/files/docs/pdf/en-GB/whitepaper/tp608-powerchoice-tech-provides-gb.pdf If you want to test only 4K movies you could raise "video_min_size" to "50000MB" (50GB) and if you want to raise the preloading size, change "preload_head_size" to "75MB", "150MB" or "500MB". This should be the sizes which are used through the client: https://forums.plex.tv/t/how-can-i-delay-playing-of-a-video-until-the-cache-is-full/179749/3?u=mgutt
  15. I like to know if the Parity Disk is sleeping. The command would be: smartctl -n standby /dev/sdX But how do I obtain the sdX of the (first) parity disk? lsblk does not return the correlation between sdX and mdX: lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 9.1M 1 loop /lib/modules loop1 7:1 0 7.1M 1 loop /lib/firmware loop2 7:2 0 20G 0 loop /var/lib/docker sda 8:0 0 10.9T 0 disk └─sda1 8:1 0 10.9T 0 part sdb 8:16 0 10.9T 0 disk └─sdb1 8:17 0 10.9T 0 part sdc 8:32 1 14.2G 0 disk └─sdc1 8:33 1 14.2G 0 part /boot sdd 8:48 0 10.9T 0 disk └─sdd1 8:49 0 10.9T 0 part sde 8:64 0 10.9T 0 disk └─sde1 8:65 0 10.9T 0 part sdf 8:80 0 10.9T 0 disk └─sdf1 8:81 0 10.9T 0 part sdg 8:96 0 10.9T 0 disk └─sdg1 8:97 0 10.9T 0 part sdh 8:112 0 10.9T 0 disk └─sdh1 8:113 0 10.9T 0 part sdi 8:128 0 10.9T 0 disk └─sdi1 8:129 0 10.9T 0 part sdj 8:144 0 10.9T 0 disk └─sdj1 8:145 0 10.9T 0 part sdk 8:160 0 10.9T 0 disk └─sdk1 8:161 0 10.9T 0 part md1 9:1 0 10.9T 0 md /mnt/disk1 md2 9:2 0 10.9T 0 md /mnt/disk2 md3 9:3 0 10.9T 0 md /mnt/disk3 md4 9:4 0 10.9T 0 md /mnt/disk4 md5 9:5 0 10.9T 0 md /mnt/disk5 md6 9:6 0 10.9T 0 md /mnt/disk6 md7 9:7 0 10.9T 0 md /mnt/disk7 md8 9:8 0 10.9T 0 md /mnt/disk8 md9 9:9 0 10.9T 0 md /mnt/disk9 nvme0n1 259:0 0 931.5G 0 disk └─nvme0n1p1 259:1 0 931.5G 0 part /mnt/cache
  16. @JorgeB Maybe its useful to throw an error notification if the /usr/sbin/smartctl --nocheck standby -A /dev/sdb returns this? CHECK POWER MODE not implemented So the user knows that he needs to use a different adapter.
  17. All Intel and Aquantia will work flawlessly. The only driver problems I know of, are related to the new 2.5G Realtek chip, but as far as I know its solved in the recent 6.9 Beta. If you want the lowest possible energy consumption, use direct connection between Server and Client, as the active 10G connection to a Switch consumes constantly 3W and if you switch off the client, this would fall away. PS I should test the power consumption if the connection speed is reduced to 1G.
  18. The files of all paths are added to one huge list, which is sorted by date and by that the most recent video files of all paths will be preloaded. Example: If your RAM allows preloading of 100 videos and you added 90 new movies to your collection, it will preload only 10 episodes. This means if you prefer 25/25 you still need to use one script per path.
  19. v0.6 released Multiple video path support added v0.7 released Unraid Dashboard notification added (can be disabled) Benchmark for Subtitles removed Compact log output
  20. I started a new config because one of my disks became a different ID after switching the USB adapter. After that all my SMB Security Settings were resetted. This means all disks were writable even by guests. Possible Fixes: a) Do not reset the disk share settings b) Make Export "No" and Security "Private" the new default
  21. Then the given "video_path" seems to be wrong. Did you change it, so it fits to your movie collection path?
  22. @kizer Check if the movie is listed in the script's logs and how much time it took to read the file part. It will look similar to this: Available RAM in Bytes: 32628881400 Amount of Videos that can be preloaded: 534 ... Preload Video /mnt/user/Movie/EF/Falling Down - Ein ganz normaler Tag (1993)/Falling Down - Ein ganz normaler Tag (1993) 1080P FSK16 EN JP FR IT ES PT IMDB7.6.mkv real 0m0.545s user 0m0.007s sys 0m0.033s Now repeat the script and check the logs again. 1.) Did the "real" time of this movie fall under 0.100s? a) If not, then it was re-read from disk and the caching failed. This means other processes are blocking or permanently overwriting your RAM. Possible solutions: More RAM or execute the Plex Preloader script after your processes finished their work b) If yes, then the video file part is in the RAM and you can try to start the movie while your disks are sleeping. 2.) Did the Movie played directly? a) If not, which Player did you use and was transcoding needed? Which path do you use to include your video files in your docker container, do they use the same path that was used by the Plex Preloader script? b) If yes. It works.
  23. Read #3 of the linked guide. Everything is explained there.
×
×
  • Create New...