From: Martin Wegner <mw@mroot.net>
Cc: linux-raid@vger.kernel.org
Subject: Re: Script for offsite storeage of RAID info needed for recovery
Date: Sat, 05 May 2012 02:38:49 +0200 [thread overview]
Message-ID: <4FA47699.6040208@mroot.net> (raw)
In-Reply-To: <1336141317.28212.125.camel@oxygen.netxsys.com>
-----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-----
prev parent reply other threads:[~2012-05-05 0:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA47699.6040208@mroot.net \
--to=mw@mroot.net \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.