+++ This bug was initially created as a clone of Bug #234168 +++
We will eventually need to add an interface which allows setting of the flags,
but for now, just making sure that the NOALLOC flag is obeyed correctly is the
priority so that its there for future use.
This should be straightforward to do in gfs2_edit, but the question is:
what's the most useful way for this to work for you? Suppose you have
a 50GB file system that contains 200 RGs. Do you want to specify a
size range? For example, something like:
gfs2_edit -rgflag NOALLOC 0G 49G /dev/vg/lv
This example would set the NOALLOC flag on for all RGs within the
range 0G to 49G. The two RGs for 49G and 50G wouldn't have the flag.
Is that what you had in mind? Or do you want to specify a specific
block range? Or RG number? RG range? RG percent?
Since it's an RG flag, I would expect to specify RG numbers or a range. That
said, is it easy to get the number of RGs?
To get the number of rg index entries (and thus RGs) you can do
something like this:
gfs2_edit -p rindex /dev/roth_vg/roth1 | grep "RG index entries found: " | cut
-d ' ' -f 5
Specifying an rg number, range of numbers or series of numbers would be
easier than trying to calculate what range those RGs cover.
Created attachment 226091 [details]
Patch to add this function
It was easier to do this in gfs2_edit rather than gfs2_tool.
Changing summary accordingly.
This should be available in the RHEL5.2 version of gfs2_edit from
gfs2-utils. It was done for RHEL5 as part of bug #369771. Since
most of the QE tests are needed for RHEL anyway (not Fedora) I'm
changing the product to RHEL5 and closing this bug as a duplicate
of 369771. BTW, the fix also appears in the HEAD and RHEL5 branches
of CVS. Here are some example commands:
gfs2_edit -p rgs /dev/sdb1
Print all the rgs for the device
gfs2_edit -p rg 17 /dev/sdb1
Print the contents of the eighteenth Resource Group on /dev/sdb1.
gfs2_edit rgflags 3 /dev/sdb1
Print the rg_flags value for the fourth Resource Group on /dev/sdb1.
gfs2_edit rgflags 3 8 /dev/sdb1
Set the GFS2_RGF_NOALLOC flag on for the fourth Resource Group.
*** This bug has been marked as a duplicate of 369771 ***