[OpenAFS] How should we handle bogus volumes?
Brian Gallew
geek@cmu.edu
Thu, 3 Aug 2006 08:35:50 +0300 (AST)
------=_20060803083550_44564
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
> A few of our customer cells are reporting these:
>
> bogus.537063011 537063011 RW 28771 K Off-line
I just cleaned up 746 such bogus volumes on one of my servers. To make it easier, I scripted it up. Attached is the script in question. Be warned, this script will cause lost data, hair loss, and unibrow. It worked for *me*, though.
IMPORTANT POINT: since no one ever reads the source, be aware that if any of the bogus volumes reference real volumes whose RW component is on the server in question, that ENTIRE VOLUME will vanish forever.
Esther, Jeff, and others have all mentioned the importance of actually looking at the bogus volumes to see what they are before doing anything irrevocable. In my case, the server in question has nothing but RO sites, so no actual harm could be done.
------=_20060803083550_44564
Content-Type: application/octet-stream; name="bogus_volume_cleanup"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bogus_volume_cleanup"
IyEgL2Jpbi9iYXNoCgojIFRoaXMgcHJvZ3JhbSBpcyBkZXNpZ25lZCB0byBwdXJnZSBib2d1cy5O
Tk5OTk4gdm9sdW1lcyBmcm9tIGFuIEFGUyBzZXJ2ZXIuCiMgSXQgZG9lcyB0aGlzIGJ5IHJlbW92
aW5nIGFueSBhbmQgYWxsIHJlZmVyZW5jZXMgdG8gdGhpcyB2b2x1bWUgZnJvbSB0aGUKIyBzZXJ2
ZXIsIHNhbHZhZ2luZywgYW5kIHRoZW4gcmVzdG9yaW5nIHRoZSByZWZlcmVuY2VzLiAgQXMgc3Vj
aCwgaXQgbWFrZXMKIyBzb21lIGFzc3VtcHRpb25zIHRoYXQgeW91IHNob3VsZCBiZSBhd2FyZSBv
ZjoKIyAxLiAgTm9uZSBvZiB0aGUgdm9sdW1lcyBpbiBxdWVzdGlvbiBoYXZlIHRoZWlyIFJXIHNp
dGUgb24gdGhpcyBzZXJ2ZXIKIyAyLiAgQWxsIG9mIHRoZSBib2d1cy5OTk5OTiB2b2x1bWVzIG9u
IHRo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