Bug 235931

Summary: gfs2_edit command to set NOALLOC flag
Product: Red Hat Enterprise Linux 5 Reporter: Nate Straz <nstraz>
Component: gfs2-utilsAssignee: Robert Peterson <rpeterso>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: bmarzins, swhiteho
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-12 20:46:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 234168    
Bug Blocks:    
Attachments:
Description Flags
Patch to add this function none

Description Nate Straz 2007-04-10 20:56:52 UTC
+++ 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.

Comment 1 Robert Peterson 2007-09-17 19:20:16 UTC
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?


Comment 2 Nate Straz 2007-09-17 19:28:47 UTC
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?

Comment 3 Robert Peterson 2007-09-17 19:38:42 UTC
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.


Comment 4 Robert Peterson 2007-10-12 21:03:11 UTC
Created attachment 226091 [details]
Patch to add this function

Comment 5 Robert Peterson 2007-10-12 21:36:58 UTC
It was easier to do this in gfs2_edit rather than gfs2_tool.
Changing summary accordingly.


Comment 6 Robert Peterson 2007-12-12 20:46:11 UTC
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 ***