Hi John,
As you noticed, the removal of -n option and $fs moved to the end went in
for xfsdump-2.2.30 and I noticed it was recommended by Ethan Benson in
March 2004
where he mentioned it worked for him :)
Looking at Q_XGETQUOTA, xfs_qm_scall_getquota, xfs_qm_export_dquot, it
appears
that the limits are exported by xfs in BBs or 512 byte blocks. So if
setquota wants them in
1024 byte blocks it would need to divide by 2 AFAICS.
The mount name istead of a device name seems to work without complaints
for setquota when
I just tried it (maybe that's not true on all versions??)
Nathan looks after this code so I'll let him respond further to this one :-)
Thanks,
--Tim
John Stern wrote:
We discovered with some dismay that xfsrq was broken the other day
when testing it. This included testing an SGI Altix running RedHat.
I noticed an attempt to fix (the obvious) fault in the setquota call.
This fix get rid of the spurious -n option (???) and puts the arguments
in the correct order. The problem is that setquota expects the device
not the filesystem mount point name.. and the block size doesn't need to
be divided by two since linux uses 1024 byte blocks.
i.e. /dev/hda1 not /boot or whatever.
The patch applies to the version of xfsrq supplied with
xfsdump-2.0.3-0, xfsdump-2.2.25-1, and probably several others.
------------------------------------------------------------------------
--- xfsrq.orig Thu Nov 21 20:12:48 2002
+++ xfsrq Tue Oct 18 16:46:47 2005
@@ -64,9 +64,8 @@
while read fs id bsoft bhard isoft ihard; do
[ $VERBOSE ] && echo setting quota for id=$id dev=$fs
# blk conversion (512 -> 1024)
- bsoft=`expr $bsoft / 2`
- bhard=`expr $bhard / 2`
- setquota $OPTS -n $id $fs $bsoft $bhard $isoft $ihard
+ mnt=`grep "^$fs" /proc/mounts| awk '{print $2}'`
+ setquota $OPTS $id $bsoft $bhard $isoft $ihard $mnt
done
;;
*) echo $USAGE 1>&2
|