Re: Scripts to help RCA quota accounting issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, Jun 22, 2017 at 4:56 PM, Sanoj Unnikrishnan <sunnikri@xxxxxxxxxx> wrote:
I have written some scripts that may help RCA quota accounting related issue in future.
Please use them when necessary.

1) Below script will compare accounting done by 'du' with that done by quota and compare them.
Requires input : mountpoint and volname. 
ouput: /tmp/gluster_files.tar
cd <mountpoint>
du -h | head -n -1 | tr -d '.' |awk  '{ for (i = 2; i <= NF; i++) { printf("%s ", $i);}  print "" }' > /tmp/gluster_1
cat /tmp/gluster_1 | sed 's/ $//' | sed 's/ /\\ /g' | sed 's/(/\\(/g' | sed 's/)/\\)/g' |xargs gluster v quota <volname> list > /tmp/gluster_2
du -h | head -n -1 |awk  '{ for (i = 2; i <= NF; i++) { printf("%s %s", $i, $1);}  print "" }' | tr -d '.' >  /tmp/gluster_3
cat /tmp/gluster_2 /tmp/gluster_3 | sort > /tmp/gluster_4
find . -type d > /tmp/gluster_5
tar -cvf /tmp/gluster_files.tar /tmp/gluster_*

Can you send this as patch ? Keep the script in 'extras/quota/good-script-name.sh'
 
2)  To recusively get the quota xattr on a FS tree use:
https://gist.github.com/sanoj-unnikrishnan/740b177cbe9c3277123cf08d875a6bf8


Cool, even this can get into project if you wish. A blog post on how using this helped maintaining Quota feature would help other admins IMO.

Regards,
Amar
 
Regards,
Sanoj



_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel



--
Amar Tumballi (amarts)
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel

[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux