I know there have been many threads on this topic before but the issue was never resolved.
I wanted to share some findings which prretty much confirm what might be happening
First of i have this script set up as a cronjob on the WD drive:
#!/bin/bash
test_host=`netstat -nr | grep "UG" | awk '{ print $2}' | xargs ping -q -w 1 -c 1 | grep "received" | awk '{ print $4 }'`
if ["$test_host" == "0"] || [-z "$test_host"] ;
then
echo "service networking restart" >> /shares/data/Drivers/scripts/no_ip_reboot_output.txt
/etc/init.d/networking restart
sleep 60
test_host=`netstat -nr | grep "UG" | awk '{ print $2}' | xargs ping -q -w 1 -c 1 | grep "received" | awk '{ print $4 }'`
if ["$test_host" == "0"] || [-z "$test_host"] ;
then
echo "Rebooting" >> /shares/data/Drivers/scripts/no_ip_reboot_output.txt
shutdown -r now
fi
fi
Today i encountered that infamous “network loss” issue where the drive looks to be up and running, solid blue led, normal network green leds on the back, yet the drive cannot be accessed in any manner and also cannot be pinged.
(I have static Ip assigenment FROM the router based on device MAC)
Once i found the drive in that state today, i left it like that until the next scheduled cronjob for my above mentioned script to see if it reboots its self. guess what IT DID NOT.
So there are ONLY two possibilites left now.
1- The OS on the WD drive crashed/kernel panicked such that it was not even able to run a cron job
OR
2- My script works on the fact that if the drive cannot ping its gateway (my router) thats when it triggers the network restart and then eventually a reboot. So with that said, possibly the drive could ping the router and hence it never restarted?
If that would be the case, then why i cannot ping drive from my computer when the drive is in this state!