These links are related to the imaging process itself
USAGE: $0 source_dir target_dir free_space email Backup system root "/" to backup drive source_dir = source directory to backup target_dir = backup directory on backup drive free_space = free space in megabytes we reserve on backup drive email = fully qualified email id of user to send alerts to Example: ./backup / /backup /root 10000 userid@cs.uwaterloo.ca This will backup / into /backup/root checking there is 10G free If there are any errors send email to userid@uwaterloo.ca
if /scripts/testfree /mnt/backup -f10000 then echo I am ok! fi
Updated: 16 Nov 2012 Mike Gore
SMART monitoring scripts
# CONFIGURATION SECTION - define your host here # ASIMOV export DRIVES=`echo /dev/sd{a..g}` smart() { run smartctl -a -d ata $1; } # WHOOMP # export DRIVES=`echo /dev/sg{2..17}` # smart() { run smartctl -a -d scsi $1; } # M160 # export DRIVES="0 1 `seq 3 64`" # No drive on location 2 # smart() { run smartctl -a -d megaraid,$1 /dev/sda; }
root@whoomp:~/utils# ./drive-inventory ============================================ Drive: /dev/sg2 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS38DAF SMART Health Status: OK ============================================ Drive: /dev/sg3 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39FLV SMART Health Status: HARDWARE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE [asc=5d, ascq=10] ============================================ Drive: /dev/sg4 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39CFJ SMART Health Status: OK ============================================ Drive: /dev/sg5 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS38GDL SMART Health Status: OK ============================================ Drive: /dev/sg6 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39FPJ SMART Health Status: OK ============================================ Drive: /dev/sg7: megaraid perl script to check drive health Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS2ZPDC SMART Health Status: OK ============================================ Drive: /dev/sg8 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS38DAL SMART Health Status: OK ============================================ Drive: /dev/sg9 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS375HT SMART Health Status: OK ============================================ Drive: /dev/sg10 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS395BK SMART Health Status: OK ============================================ Drive: /dev/sg11 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS38G9H SMART Health Status: OK ============================================ Drive: /dev/sg12 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39CJ6 SMART Health Status: OK ============================================ Drive: /dev/sg13 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39CS1 SMART Health Status: OK ============================================ Drive: /dev/sg14 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39849 SMART Health Status: OK ============================================ Drive: /dev/sg15 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS38ECV SMART Health Status: OK ============================================ Drive: /dev/sg16 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39D22 SMART Health Status: OK ============================================ Drive: /dev/sg17 Device: ST31500341AS Version: CX1H Device type: disk Serial number: 9VS39DT9 SMART Health Status: OK ============================================ ============================================ ************** ERROR REPORT ************** ============================================ Drive: /dev/sg3 smartctl -a -d scsi /dev/sg3 smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ Device: ST31500341AS Version: CX1H Serial number: 9VS39FLV Device type: disk Transport protocol: SAS Local Time is: Fri Nov 16 15:53:37 2012 EST Device supports SMART and is Enabled Temperature Warning Disabled or Not Supported SMART Health Status: HARDWARE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE [asc=5d, ascq=10] Error Counter logging not supported Device does not support Self Test logging ============================================
mega raid reporting tools LSI disk controller
root@m160:~/utils/disk-utils# perl /usr/local/bin/megaraid-health OK - VirtualDrives=3, Degraded=0, Offline=0, PhysicalDevices=65, Disks=60, CriticalDisks=0, FailedDisks=0, MemoryCorrectableErrors=0, MemoryUncorrectableErrors=0
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
DRIVES | r1 | manage | 2.0 K | 2012-11-16 - 16:30 | MikeGore | DRIVE file |
![]() |
Makefile | r1 | manage | 0.3 K | 2012-03-21 - 11:56 | MikeGore | |
![]() |
README.txt | r1 | manage | 2.8 K | 2012-03-21 - 12:11 | MikeGore | |
![]() |
backup | r1 | manage | 2.3 K | 2012-03-21 - 11:32 | MikeGore | |
![]() |
crontab | r1 | manage | 0.4 K | 2012-03-21 - 12:00 | MikeGore | |
![]() |
drive-health | r1 | manage | 0.2 K | 2012-11-16 - 16:30 | MikeGore | drives-health script |
![]() |
drive-inventory | r1 | manage | 0.2 K | 2012-11-16 - 16:30 | MikeGore | drives-inventory script |
![]() |
fix_scheduler | r1 | manage | 2.0 K | 2012-03-21 - 11:27 | MikeGore | |
![]() |
grub-fix | r1 | manage | 0.9 K | 2012-03-21 - 11:28 | MikeGore | |
![]() |
manual | r1 | manage | 0.2 K | 2012-03-21 - 11:33 | MikeGore | |
![]() |
megaraid-health | r1 | manage | 2.7 K | 2012-11-16 - 16:31 | MikeGore | megaraid perl script to check drive health |
![]() |
mnt_asimov | r1 | manage | 3.0 K | 2012-03-21 - 10:25 | MikeGore | |
![]() |
mnt_core | r1 | manage | 0.4 K | 2012-03-21 - 11:26 | MikeGore | |
![]() |
mnt_edocs | r1 | manage | 2.5 K | 2012-03-21 - 11:32 | MikeGore | |
![]() |
mntpart | r1 | manage | 0.8 K | 2012-03-21 - 11:26 | MikeGore | |
![]() |
mntproc | r1 | manage | 0.2 K | 2012-03-21 - 11:27 | MikeGore | |
![]() |
testfree.c | r1 | manage | 3.1 K | 2012-03-21 - 11:59 | MikeGore |