Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: Hard Drive Monitor

  1. #1
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427

    Hard Drive Monitor

    Here is a script that detects errors on your Tivo hard drive(s) by:
    1. Scanning your kernel log looking for errors indicative of hard drive failure.
    2. Running smartctl and checking for S.M.A.R.T. status of "failed".
    3. Running extended offline drive checks using smartctl.
    4. Comparing the temperature of your hard drive(s) to a user-defined threshold.
    5. Comparing the number of reallocated sectors to manufacturer thresholds.
    If an error is found or a value exceeds a threshold, it writes it to a log, and sends it to your Tivo UI as a message.

    Usage:
    Run it as a shell script from bash without arguments. If the script detects a cron installation, it will automatically append your crontab to run drivemonitor.sh every night.

    Note:
    Features 3,4, and 5 above require a newer version of smartctl than the one that ships with stock Tivos. Jamie was good enough to compile one and attach it to Post #5 below. I suggest replacing your existing smartctl in /bin with this one.

    Tested on 6.2 Dtivo, but should work on all platforms.

    Attached Files Attached Files
    Last edited by rbautch; 05-20-2008 at 09:34 PM.

  2. #2
    Join Date
    May 2004
    Location
    New England
    Posts
    372
    cool tool. I'm running 6.2a on a DSR7000, single seagate 300GB drive, here's the output - - look like what you'd expect?
    Code:
    root@lvrmtivo:/var> drivemonitor.sh
    No hard drive errors were found in your kernel log.
    Device open failed: No such device or address
    Your primary drive hda S.M.A.R.T. satus is: PASSED
    Your secondary drive hdb S.M.A.R.T. satus is: FAILED
    Your secondary drive hdb S.M.A.R.T. satus is: FAILED
    root@lvrmtivo:/var>
    Two DSR7000s both at 6.4a/101 from slices; both originally sleepered version 3, then 4.01b, 6.2, 6.2a.
    TWP 2.1, Superpatched, 300GB Seagate in one, 750GB in the other, USB 2 w/ Jamie's backport drivers
    One HR10-250 at 6.4a, networked, Superpatched, stock 250GB drive
    One HR23
    Patiently waiting for a new DirecTV/Tivo
    One AM21 hooked to the HR23

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Not quite. It erroneously thinks you have a secondary drive (hdb). What version of smartctl do you have? (usually in /bin)

  4. #4
    Join Date
    May 2004
    Location
    New England
    Posts
    372
    Quote Originally Posted by rbautch View Post
    Not quite. It erroneously thinks you have a secondary drive (hdb). What version of smartctl do you have? (usually in /bin)
    version 1.2
    Two DSR7000s both at 6.4a/101 from slices; both originally sleepered version 3, then 4.01b, 6.2, 6.2a.
    TWP 2.1, Superpatched, 300GB Seagate in one, 750GB in the other, USB 2 w/ Jamie's backport drivers
    One HR10-250 at 6.4a, networked, Superpatched, stock 250GB drive
    One HR23
    Patiently waiting for a new DirecTV/Tivo
    One AM21 hooked to the HR23

  5. #5
    Join Date
    Aug 2004
    Posts
    4,078
    That's pretty ancient. I've been using 5.32 for quite a while -- looks like I built it back in 2005.

    smartctl -H /dev/hdX is useful with this version, as well as smartctl -t short /dev/hdX. smartctl -a /dev/hdX displays a ton of info that you might find useful, typically including the temperature of the drive, the number of remapped sectors, etc.
    Attached Files Attached Files

  6. #6
    Join Date
    May 2004
    Location
    New England
    Posts
    372
    Quote Originally Posted by Jamie View Post
    That's pretty ancient. I've been using 5.32 for quite a while -- looks like I built it back in 2005.

    smartctl -H /dev/hdX is useful with this version, as well as smartctl -t short /dev/hdX. smartctl -a /dev/hdX displays a ton of info that you might find useful, typically including the temperature of the drive, the number of remapped sectors, etc.
    thanks, now I'm up to date with a version from this century
    Code:
    root@lvrmtivo:/var> drivemonitor.sh
    No hard drive errors were found in your kernel log.
    Your primary drive hda S.M.A.R.T. satus is: PASSED
    No secondary drive was detected.
    root@lvrmtivo:/var>
    Two DSR7000s both at 6.4a/101 from slices; both originally sleepered version 3, then 4.01b, 6.2, 6.2a.
    TWP 2.1, Superpatched, 300GB Seagate in one, 750GB in the other, USB 2 w/ Jamie's backport drivers
    One HR10-250 at 6.4a, networked, Superpatched, stock 250GB drive
    One HR23
    Patiently waiting for a new DirecTV/Tivo
    One AM21 hooked to the HR23

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Thanks for the updated smartctl, Jamie. I'll plan to make some updates to the script to take advantage of those features. I just updated the script to be backwards compatible with older versions of smartctl too.
    Last edited by rbautch; 04-13-2008 at 12:04 PM.

  8. #8
    Join Date
    Dec 2003
    Location
    Indianapolis
    Posts
    297
    Quote Originally Posted by rbautch View Post
    Thanks for the updated smartctl, Jamie. I'll plan to make some updates to the script to take advantage of those features. I just updated the script to be backwards compatible with older versions of smartctl too.
    Just checked, Alphawolfs All-In-One file has 5.32 version of smartctl included.
    (2) UltimateTV - upgraded w/160GB
    (1) HR10-250 2TB 6.4a
    (1) HR10-250 620GB 6.4a
    (1) HR10-250 300GB 6.4a
    (3) HR21 (2) with AM21 & internal 2TB Seagate
    RandC

  9. #9
    Join Date
    May 2007
    Posts
    420
    Cool...

    FamRoom-bash# ./drivemonitor.sh
    No hard drive errors were found in your kernel log.
    Your primary drive hda S.M.A.R.T. satus is: PASSED
    No secondary drive was detected.

    How do I make an CRON entry to run this say once a week just before the logs get wiped. I put the file in /enhancements

  10. #10
    Join Date
    Dec 2003
    Location
    Indianapolis
    Posts
    297
    Quote Originally Posted by Soapm View Post
    How do I make an CRON entry to run this say once a week just before the logs get wiped. I put the file in /enhancements
    Set the day of the week and execution time for drivemonitor before you clear your logs

    # cron settings
    # * * * * * command to be executed
    # - - - - -
    # | | | | |
    # | | | | +----- day of week (1 - 7) (monday = 1)
    # | | | +------- month (1 - 12)
    # | | +--------- day of month (1 - 31)
    # | +----------- hour (0 - 23)
    # +------------- min (0 - 59)
    # time is based on utc no time zone offset calculated

    * * * * * ./drivemonitor.sh; echo "Ran DriveMonitor on `date`" >> /var/log/crontab.log
    (2) UltimateTV - upgraded w/160GB
    (1) HR10-250 2TB 6.4a
    (1) HR10-250 620GB 6.4a
    (1) HR10-250 300GB 6.4a
    (3) HR21 (2) with AM21 & internal 2TB Seagate
    RandC

  11. #11
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    FYI, the info module of TivoWebPlus uses "smartctl -c" to check SMART status, which is compatible only with older versions of smartctl. Editing TivoWebPlus/info.itcl to change the argument from -c to -H fixes this. Not a huge deal, but I'll make the TWP developers aware of it.

  12. #12
    Join Date
    Aug 2004
    Posts
    4,078
    Quote Originally Posted by RandC View Post
    Just checked, Alphawolfs All-In-One file has 5.32 version of smartctl included.
    Yes, I think I sent it to him for inclusion (link).

    The issue may be that /bin is on the path before the hacks bin directory, for some people, so they get the old version tivo ships if they don't specify the full path.

  13. #13
    Join Date
    May 2007
    Posts
    420
    Wow, something in the 9.3 update messed up my Joe command. This is what I get when I type root for my CRON config. I looked in /tivo-bin and there is no /etc there so the error appears to be correct. Thoughts how to fix this?

    FamRoom-bash# root
    Couldn't open '/tivo-bin/etc/joerc'

  14. #14
    Join Date
    Jul 2005
    Posts
    555
    Quote Originally Posted by Soapm View Post
    Wow, something in the 9.3 update messed up my Joe command. This is what I get when I type root for my CRON config. I looked in /tivo-bin and there is no /etc there so the error appears to be correct. Thoughts how to fix this?

    FamRoom-bash# root
    Couldn't open '/tivo-bin/etc/joerc'
    joe looks for joerc in two places. First it looks for "/.joerc", then it looks for "/tivo-bin/etc/joerc/".

    If you used an automated script to install your hacks then most likely it's using "/.joerc", which you simply need to copy over from your previous install.
    .-=Omikron=-.

    TiVo Series4 Premiere Development HERE

    Do you have a PROM related question? Check HERE and HERE before sending me a PM. Any questions that have already been answered will be deleted if sent via PM.

  15. #15
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Quote Originally Posted by Soapm View Post
    Wow, something in the 9.3 update messed up my Joe command. This is what I get when I type root for my CRON config. I looked in /tivo-bin and there is no /etc there so the error appears to be correct. Thoughts how to fix this?

    FamRoom-bash# root
    Couldn't open '/tivo-bin/etc/joerc'
    This is not a support thread! Please respect the clearly posted moderator wishes:
    Dedicated to a clean and concise listing of the most current versions of all the hacks out there. NO SUPPORT REQUESTS OR DISCUSSION AND NO DTV HACKING TALK ALLOWED!! - Non-File posts will be summarily deleted without notice
    If you have any questions on cron, post in the newbie forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •