CHBMB Posted July 14, 2017 Share Posted July 14, 2017 On 12/07/2017 at 5:19 PM, Squid said: CHBMB suggested the same thing a while ago, and I basically blew him off. Firstly I'd like to ask you to rephrase that slightly and secondly I'd like to gloat that I told you it was a good idea. But I do understand that it is a lot of work and can completely understand not wanting to take it on in addition to everything else you do.... Quote Link to comment
Squid Posted July 14, 2017 Author Share Posted July 14, 2017 lol, Its just to me, it seems like a ton of work for very little benefit. Quote Link to comment
thomast_88 Posted July 15, 2017 Share Posted July 15, 2017 8 hours ago, Squid said: lol, Its just to me, it seems like a ton of work for very little benefit. Moving the scripts to a GitHub repo is a start. That will even release you from maintaining the first post = less work. Quote Link to comment
Squid Posted August 7, 2017 Author Share Posted August 7, 2017 (edited) Automatically save syslog onto flash drive Set the script to run at First Only Array Start in the background #!/bin/bash mkdir -p /boot/logs FILENAME="/boot/logs/syslog-$(date +%s)" tail -f /var/log/syslog > $FILENAME Edited August 7, 2017 by Squid Quote Link to comment
jrdnlc Posted August 12, 2017 Share Posted August 12, 2017 (edited) Delete Dangling Images I'm having issues with this script. When I run it, It gives me the following error "docker rmi" requires at least 1 argument(s). See 'docker rmi --help'. Usage: docker rmi [OPTIONS] IMAGE [IMAGE...] Edited August 12, 2017 by jrdnlc Quote Link to comment
Squid Posted August 12, 2017 Author Share Posted August 12, 2017 6 hours ago, jrdnlc said: Delete Dangling Images I'm having issues with this script. When I run it, It gives me the following error "docker rmi" requires at least 1 argument(s). See 'docker rmi --help'. Usage: docker rmi [OPTIONS] IMAGE [IMAGE...] Then there's no dangling images present Quote Link to comment
johnieutah Posted September 3, 2017 Share Posted September 3, 2017 This clear array script... I started it running in the foreground in my browser and it seems it will take ages... So what happens when I close my browser or it hangs or something?!? ... and how long should this take as it seems to be going slooooooooooooooooowly... @ 2.8MB/sec for 750GB drive. Thanks. Quote Link to comment
Squid Posted September 3, 2017 Author Share Posted September 3, 2017 3 hours ago, johnieutah said: This clear array script... I started it running in the foreground in my browser and it seems it will take ages... So what happens when I close my browser or it hangs or something?!? ... and how long should this take as it seems to be going slooooooooooooooooowly... @ 2.8MB/sec for 750GB drive. Thanks. General rule is that anything running in the foreground will stop once you close the pop up. A lot of factors though at play. Quote Link to comment
johnieutah Posted September 3, 2017 Share Posted September 3, 2017 So the browser did hang in the end and I ended up killing the server (it took 2 goes) as I didn't like the idea of this process going on for a week anyway. Now I started the server I get an unmountable disk error. Not a problem, I just need the easiest and quickest way to remove this device from the array... and the clear drive process was certainly not the quickest.. Ideas guys? Quote Link to comment
trurl Posted September 3, 2017 Share Posted September 3, 2017 30 minutes ago, johnieutah said: So the browser did hang in the end and I ended up killing the server (it took 2 goes) as I didn't like the idea of this process going on for a week anyway. Now I started the server I get an unmountable disk error. Not a problem, I just need the easiest and quickest way to remove this device from the array... and the clear drive process was certainly not the quickest.. Ideas guys? There isn't really a quick way. You either have to zero the disk while it is still part of the array so parity can be kept in sync, or you have to New Config without the disk and rebuild parity. Quote Link to comment
johnieutah Posted September 5, 2017 Share Posted September 5, 2017 Thanks for the reply. Will the second option work even though unraid says the drive can't be mounted? So the steps would be: Stop array Set drive to unassigned Turn off Remove drive Start server Rebuild parity Quote Link to comment
trurl Posted September 5, 2017 Share Posted September 5, 2017 7 hours ago, johnieutah said: Thanks for the reply. Will the second option work even though unraid says the drive can't be mounted? So the steps would be: Stop array Set drive to unassigned Turn off Remove drive Start server Rebuild parity No. If by the second option you mean: On 9/3/2017 at 0:41 PM, trurl said: you have to New Config without the disk and rebuild parity. That is done by going to Tools - New Config. There you will be able to keep/change any drive assignments. After New Config, the default is to rebuild parity. So you would NOT check the box saying parity is valid. Quote Link to comment
johnieutah Posted September 5, 2017 Share Posted September 5, 2017 (edited) 3 hours ago, trurl said: No. If by the second option you mean: That is done by going to Tools - New Config. There you will be able to keep/change any drive assignments. After New Config, the default is to rebuild parity. So you would NOT check the box saying parity is valid. Ok, so I can start a new config, keep the drive assignments that I want (make note of device ids), rebuild parity, let that finish, then I can remove the drive safely after a shutdown? Just want to be 100%, thanks. Edited September 5, 2017 by johnieutah Quote Link to comment
trurl Posted September 5, 2017 Share Posted September 5, 2017 When you go to New Config, you will have several options about what assignments to retain. I recommend choosing Retain All. Then you will have everything already assigned just as it is, and you can make changes from that as a starting point. Then after you have everything assigned like you want, start the array and let it build parity. Quote Link to comment
ogi Posted September 7, 2017 Share Posted September 7, 2017 I just ran this script, while completed without issue, when I have gone to stop the array, the array is taking a long time to sync filesystems... is this normal (I'm currently passing 20 minutes)? Quote Link to comment
ogi Posted September 7, 2017 Share Posted September 7, 2017 1 hour ago, ogi said: I just ran this script, while completed without issue, when I have gone to stop the array, the array is taking a long time to sync filesystems... is this normal (I'm currently passing 20 minutes)? After a little over an hour of sync-ing, I powered the machine off, let it come up, it's doing a parity check now, but the disk I was running this before is labeled as unmountable, so as soon as the parity check completes, I'll resume the shrink array procedure from step 9. https://wiki.lime-technology.com/Shrink_array Quote Link to comment
ogi Posted September 8, 2017 Share Posted September 8, 2017 I'm not sure if it's a seperate issue I'm having, but while removing a second disk, I'm having problems with 'syncing disks'. I attempted to restart a docker container (Plex Media Server) while the clear-disk script was running. The container won't stop, it appears to be stuck on [s6-finish] syncing disks ... I've been trying to kill the container with no luck. Current plan is to let the clear disk script finish on the current disk, then force a shut-down/restart (will likely have to manually umount all my disks). Anyway I don't think this issue is directly due to the script so much as the suggested setting md_write_method to reconstruct write (from auto or read/modify/write). Given that that setting is suggested, I'm going to try running through this script next time around w/ read/modify/write setting instead (full well knowing it will take longer), and see if I have sync filesystem or sync disks issues then. Quote Link to comment
itimpi Posted September 9, 2017 Share Posted September 9, 2017 It is quite normal to have issues stopping anything that requires a disk sync if you have a pre-clear running in parallel. The pre-clear keeps writing new data so that the sync never completes. Another symptom that is common in this scenario is being unable to stop the array for the same reason. The only solution is to either wait for the pre-clear to finish or to terminate it early. In a perfect world it would be possible to pause a pre-clear and later resume it, but I can understand that this would add a very large level of complexity to the plugin and hitting this issue on a running system is rare enough that it almost certainly does not justify the effort that would be required. Quote Link to comment
Liwiu Posted September 10, 2017 Share Posted September 10, 2017 Hi guys, I'm trying to make a backup of my VM's but I don' know for sure if it's working or not. I used the script backup VM and I get a error. How can I resolve his one? Quote Link to comment
Squid Posted September 10, 2017 Author Share Posted September 10, 2017 Looks like it worked, but there was no nvram to be saved. Quote Link to comment
johnieutah Posted September 11, 2017 Share Posted September 11, 2017 On 9/5/2017 at 7:55 PM, trurl said: When you go to New Config, you will have several options about what assignments to retain. I recommend choosing Retain All. Then you will have everything already assigned just as it is, and you can make changes from that as a starting point. Then after you have everything assigned like you want, start the array and let it build parity. Thanks for the advice. I ended up going down this route, and the parity rebuild took 10hours or so. Ok, the array is not parity protected, but the other (newer) method seemed like it would go on for at least a week... An easy decision to make IMO. Quote Link to comment
wgstarks Posted September 28, 2017 Share Posted September 28, 2017 (edited) On 10/29/2016 at 0:56 PM, Squid said: Run A Custom Script At Parity Check / Rebuild Start And Stop Use it to run a custom script to (as an example), shut down various docker applications, etc. Adjust the variables within the script file. Note that you either need to run this in the background or at array start. Running this in the foreground will not work. #!/usr/bin/php <?PHP # A simple script to allow you to run a custom script when a parity check starts or stops # Adjust the following variables to suit: $checkInterval = 300; # Number of seconds in between checks $startScript = "full path to the script"; # The full path to the script to run when a parity check starts $stopScript = "full path to the stop script"; # The full path to the script to run when a parity check stops # Don't touch anything below while (true) { $vars = parse_ini_file("/var/local/emhttp/var.ini"); if ( $vars['mdState'] == "STOPPED" ) { break; } if ( ($vars['mdResyncPos'] != 0) && $vars ) { echo "Parity Check / Sync / Rebuild in progress. Executing the start script ($startScript)"; exec($startScript,$output); foreach ($output as $line) { echo $line."\n"; } while (true) { $vars = parse_ini_file("var/local/emhttp/var.ini"); if ( ($vars['mdResyncPos'] == 0) && $vars ) { echo "Parity Check / Sync / Rebuild finished. Executing the stop script ($stopScript)"; exec($stopScript,$output); foreach ($output as $line) { echo $line."\n"; } break; } else { sleep($checkInterval); } } } else { sleep($checkInterval); } } ?> custom_script_parity_check_start_stop.zip I would like to use this to pause several torrent dockers during parity checks using "docker pause <dockername>". Is there anyway to have the commands run in a set order? Edited September 28, 2017 by wgstarks Quote Link to comment
Squid Posted September 29, 2017 Author Share Posted September 29, 2017 3 hours ago, wgstarks said: I would like to use this to pause several torrent dockers during parity checks using "docker pause <dockername>". Is there anyway to have the commands run in a set order? Not following you. The script the you specify is executed in order. Quote Link to comment
wgstarks Posted September 29, 2017 Share Posted September 29, 2017 The commands would be docker pause binhex-sonarr followed by docker pause binhex-radarr followed by docker pause binhex-delugevpn and then the reverse on parity completion. I guess I need to figure out how to script these commands though. Want to do something like CA Docker auto start except at parity start and finish. Quote Link to comment
Squid Posted September 29, 2017 Author Share Posted September 29, 2017 8 hours ago, wgstarks said: The commands would be docker pause binhex-sonarr followed by docker pause binhex-radarr followed by docker pause binhex-delugevpn and then the reverse on parity completion. I guess I need to figure out how to script these commands though. Want to do something like CA Docker auto start except at parity start and finish. #!/bin/bash docker pause binhex-sonarr docker pause binhex-radarr docker pause binhex-delugevpn Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.