* Script for offsite storeage of RAID info needed for recovery
@ 2012-05-04 14:21 Krzysztof Adamski
2012-05-05 0:38 ` Martin Wegner
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Adamski @ 2012-05-04 14:21 UTC (permalink / raw)
To: linux-raid
Reading about the heroic achievements of Neil to recover broken raids
for people it is obvious that before a RAID has problems good info needs
to be provided. Since usually that information is required after the
fact, I'm looking for a script that I could run periodically on my
computers that would collect all this info and send it someplace safe
off-site.
Is there a script that I could run from cron that would collect all the
needed info for a recovery of a broken raid and mail it off-site?
If there is nothing like that, then I can try writing it as long as I
could get the list of commands that would give me all the needed info.
Thanks,
K
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Script for offsite storeage of RAID info needed for recovery
2012-05-04 14:21 Script for offsite storeage of RAID info needed for recovery Krzysztof Adamski
@ 2012-05-05 0:38 ` Martin Wegner
0 siblings, 0 replies; 2+ messages in thread
From: Martin Wegner @ 2012-05-05 0:38 UTC (permalink / raw)
Cc: linux-raid
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hello, Krzysztof
I'm running the following little script as a cron job every night. It
gives you:
1. the contents of /proc/mdstat
2. mdadm --detail for each md device listed in /proc/mdstat
3. mdadm --examine for each member device listed in /proc/mdstat
- -----8<----------8<----------8<----------8<----------8<----------8<-----
#!/bin/sh
cat /proc/mdstat
for md in $( cat /proc/mdstat | grep '^md' | cut -d' ' -f1 | sort ); do
echo
mdadm --detail /dev/${md}
echo
done
for d in $( cat /proc/mdstat | "grep" -o 'sd.\?[0-9]' | sort ); do
echo
mdadm --examine /dev/${d}
echo
done
- -----8<----------8<----------8<----------8<----------8<----------8<-----
Of course, this could be extended by also listing the models and
vendors of the component devices, but I've not done this for now.
I hope that helps,
Martin
On 05/04/12 16:21, Krzysztof Adamski wrote:
> [...]
- --
Get my public GPG key from pgp.mit.edu or wwwkeys.pgp.net
Key ID: 0x177AFD7C
- --
Homepage: http://mwegner.net/
Powered by Gentoo Linux (http://gentoo.org/)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEAREKAAYFAk+kdpcACgkQxZfezBd6/XzyOwCfZ89Fr4XTE6+DNB0tygCJMQNP
BrMAoJGktj1dDq9MBgxmSY/MPolWTWOH
=bBvQ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-05 0:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-04 14:21 Script for offsite storeage of RAID info needed for recovery Krzysztof Adamski
2012-05-05 0:38 ` Martin Wegner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).