Repairing quotas after you delete them all

As I mentioned in my earlier post, I managed to delete the quotas on one of my Isilon clusters by accident. Still haven’t figured out exactly how it happened, but it happened.

By a happy coincidence, we do dumps of our quota lists on a daily basis (I recommend you do too). The command you could use for this is:

isilon-1# isi quota quotas list --format csv

From there, I cut it down to an output that looks like:

type,path,hard-threshold

and tossed that into a file called quotadata.txt.

Then I used this script:

#!/bin/bash
OIFS=$IFS
IFS=','
INPUT=./quotadata.txt
[ ! -f $INPUT ] &while read TYPE QPATH SIZE
do
type=$TYPE
qpath=$QPATH
size=$SIZE
if [ -z $size ]; then
isi quota quotas create $qpath $type
else
isi quota quotas create $qpath $type --hard-threshold $size --container=yes
fi
done <$INPUT
IFS=$OIFS
isi quota quotas list

It threw a bunch of errors about stdin not being a tty, but those are safely ignored (and you could probably fix them through some kind of flag on the isi quota quotas commands.

In any case, that put all my quotas back. At that point, it was a (relatively) simple matter of running the quotascan job. 

As usual with my Isilon posts, this is in regards to OneFS 7.1.0. 

Advertisements

About kcarlile
Twitter: @overclockdlemon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: