Bug 450764 - RFE: GFS2: mkfs.gfs2 should have an optional fs size parm
Summary: RFE: GFS2: mkfs.gfs2 should have an optional fs size parm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils
Version: 5.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-10 20:49 UTC by Robert Peterson
Modified: 2010-01-12 03:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-20 20:52:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (3.73 KB, patch)
2008-06-11 17:27 UTC, Robert Peterson
no flags Details | Diff
Addendum patch (2.15 KB, patch)
2008-08-08 20:40 UTC, Robert Peterson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0087 0 normal SHIPPED_LIVE gfs2-utils bug-fix update 2009-01-20 16:04:24 UTC

Description Robert Peterson 2008-06-10 20:49:17 UTC
Description of problem:
Many of the file system mkfs commands, such as mkfs for ext3 and xfs
have an optional parameter where the user may specify the file system
size.  Right now, mkfs.gfs2 doesn't have that; it just takes the
entire device.  This would facilitate GFS2 debugging and recreating
customer problems.

Version-Release number of selected component (if applicable):
RHEL5.2

How reproducible:
Always

Steps to Reproduce:
1. lvcreate --name exxon_lv -l 100G /dev/exxon_vg
2. mkfs.gfs2 -p lock_nolock /dev/exxon_vg/exxon_lv
3.
  
Actual results:
All available space of /dev/exxon_vg/exxon_lv are taken up by the
file system.

Expected results:
It would be nice if we had an optional parameter, such as mkfs.ext3's
"[blocks-count]" or xfs's "-d size=80G" so we don't need to use the
entire device, especially for debugging purposes.

Additional info:

Comment 1 Robert Peterson 2008-06-11 17:27:19 UTC
Created attachment 308968 [details]
Proposed patch

This is the RHEL5 version of the patch.  The upstream (master) patch
should not be too different, and I'll send that upstream when I find
the time.

This patch became a higher priority because I could not recreate the
required file system conditions with MD raid any other way for
bug #448866, which is what I've been focusing on lately.  Also, I
found some formatting inconsistencies with the mkfs.gfs2 man page
that I fixed, as long as I was editing the file.

It turns out that most of the major file systems have alternate block
count options in their respective mkfs commands.  I sampled several and
looked at how the block count was specified on the command line:

mkfs.ext3 [ blocks-count ]
mkfs.xfs -d size=X (e.g. 80G)
mkfs.ntfs [ number-of-sectors ]
mkfs.vfat [ block-count ]
mkfs.cramfs (no option available)
mkfs.reiserfs [block-count]

So I went with the majority and made an optional last parameter to
specify the block count.

Comment 2 Robert Peterson 2008-06-11 20:21:03 UTC
This patch was tested on system exxon-01 and pushed to the master and
STABLE2 branches in the upstream git tree.  Requesting ACK flags for
inclusion into 5.3.


Comment 3 RHEL Program Management 2008-06-11 20:35:52 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Robert Peterson 2008-06-18 20:59:17 UTC
After fixing a minor white space issue, I pushed this to the RHEL5
branch of the cluster git tree.

Someone pointed out to me that resize2fs also has an optional file
system size parameter, so we may want to do gfs2_grow as well at some
point.  I consider that a separate issue, and it should have its own bz
record.  For now, I'm marking this as modified.


Comment 5 Eric Sandeen 2008-07-13 04:29:08 UTC
+               if (sdp->orig_fssize > sdp->device.length)
+                       die("specified block count is smaller than the"
+                           "actual device.\n");

Isn't that text backwards?  (s/b larger?)
 
Thanks,
-Eric

Comment 6 Eric Sandeen 2008-07-13 04:34:58 UTC
Oh and just a minor nit:

[root@east-10 ~]# mkfs.gfs2 -p lock_nolock /dev/sdb 268435456

...

Device Size                1024.00 GB (268435456 blocks)
Filesystem Size:           1024.00 GB (268435454 blocks)

the device size is actually 1.4T ... *shrug*  :)

Comment 7 Robert Peterson 2008-08-08 20:40:45 UTC
Created attachment 313847 [details]
Addendum patch

This patch fixes the problems Eric Sandeen pointed out.

Comment 8 Robert Peterson 2008-08-08 20:58:18 UTC
The addendum patch was committed to master, STABLE2 and RHEL5 branches
of git.

Comment 10 Nate Straz 2008-12-15 20:33:25 UTC
Verified w/ gfs2-utils-0.1.53-1.el5

Comment 12 errata-xmlrpc 2009-01-20 20:52:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0087.html


Note You need to log in before you can comment on or make changes to this bug.