RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1196321 - [RFE] Add a progress indicator to mkfs.gfs2
Summary: [RFE] Add a progress indicator to mkfs.gfs2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gfs2-utils
Version: 7.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Paul Evans
QA Contact: cluster-qe@redhat.com
Milan Navratil
URL:
Whiteboard:
Depends On: 1271674
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-25 17:05 UTC by Andrew Price
Modified: 2016-11-04 06:29 UTC (History)
8 users (show)

Fixed In Version: gfs2-utils-3.1.9-1.el7
Doc Type: Release Note
Doc Text:
A progress indicator has been added to `mkfs.gfs2` The `mkfs.gfs2` tool now reports its progress when building journals and resource groups. As `mkfs.gfs2` can take some time to complete with large or slow devices, it was not previously clear if mkfs.gfs2 was working correctly until a report was printed. A progress bar has been added to `mkfs.gfs2` indicate progress.
Clone Of:
Environment:
Last Closed: 2016-11-04 06:29:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch - Add progress bar to mkfs.gfs2 (7.78 KB, patch)
2015-10-19 13:21 UTC, Paul Evans
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2438 0 normal SHIPPED_LIVE gfs2-utils bug fix and enhancement update 2016-11-03 14:01:57 UTC

Description Andrew Price 2015-02-25 17:05:03 UTC
mkfs.gfs2 can take some time to complete with large/slow devices and doesn't give any sign of life until it finishes and prints a report. Some kind of progress indicator should be added to make the time go by more smoothly. A simple "<N>% completed" message should be sufficient.

Comment 2 Robert Peterson 2015-07-09 19:37:33 UTC
The vast majority of the time it takes to do mkfs.gfs2 is spent
writing the journals. In theory, we should be able to use function
warm_fuzzy_stuff() from fsck/util.c or adapt function
big_file_comfort from the same fsck/util.c.

Comment 3 Andrew Price 2015-07-09 20:32:27 UTC
(In reply to Robert Peterson from comment #2)
> The vast majority of the time it takes to do mkfs.gfs2 is spent
> writing the journals.

I don't think that's true since https://git.fedorahosted.org/cgit/gfs2-utils.git/commit?id=7c0e7b3a58 - I believe the bottleneck for smaller devices is the quota change file creation now, although a performance improvement in that area is on the cards.

However, this bz was created with very large devices in mind and the mkfs performance characteristics for those are different, as resource group creation time scales up with device size but i/o related to journal/quota change creation doesn't.

Also, I filed this bz after testing on a large thinp volume which does discards very slowly. So, I think we should split the (uninterruptible) discard operation into chunks at some point - as part of this bz or later - and additionally update the new progress indicator between chunks.

Comment 5 Paul Evans 2015-10-19 13:21:28 UTC
Created attachment 1084404 [details]
Patch - Add progress bar to mkfs.gfs2

Here is a Patch posted upstream to the Master branch. It adds a simple progress bar to mkfs.gfs2 which is utilised when building both the journals and resource groups.

Comment 6 Nate Straz 2016-02-22 15:37:08 UTC
Is the progress bar only shown when stdout is a tty?  I don't really want to see test logs filling up with tons of progress bar output.

Comment 7 Andrew Price 2016-02-22 16:20:45 UTC
(In reply to Nate Straz from comment #6)
> Is the progress bar only shown when stdout is a tty?

It's not a progress "bar" as such, but it doesn't print the intermediate "[2/4]" updates when stdout isn't a tty, only the "Done" at the end of the section:

16:11:50 andy@plato mkfs 0$ ./mkfs.gfs2 -Oplock_nolock -j4 -b512 sparsefile &>mkfs.log 
16:13:19 andy@plato mkfs 0$ cat mkfs.log 
It appears to contain an existing filesystem (gfs2)
This will destroy any data on sparsefile
Adding journals: Done
Building resource groups: Done
Creating quota file: Done
Writing superblock and syncing: Done
Device:                    sparsefile
Block size:                512
Device size:               1024.00 GB (2147483648 blocks)
Filesystem size:           1024.00 GB (2147483645 blocks)
Journals:                  4
Resource groups:           4098
Locking protocol:          "lock_nolock"
Lock table:                ""
UUID:                      5712c0f0-d133-ebc3-df1c-80e1f2d8e2db

Comment 8 Mike McCune 2016-03-28 23:16:15 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 12 Justin Payne 2016-07-26 15:54:27 UTC
Verified in gfs2-utils-3.1.9-3.el7:

[root@south-16 ~]# rpm -q gfs2-utils
gfs2-utils-3.1.9-3.el7.x86_64
[root@south-16 ~]# mkfs.gfs2 -p lock_nolock -t test:progress /dev/sdb1
This will destroy any data on /dev/sdb1
Are you sure you want to proceed? [y/n]y
Discarding device contents (may take a while on large devices): Done
Adding journals: Done 
Building resource groups: Done       
Creating quota file: Done
Writing superblock and syncing: Done
Device:                    /dev/sdb1
Block size:                4096
Device size:               1791.57 GB (469649399 blocks)
Filesystem size:           1791.57 GB (469649398 blocks)
Journals:                  1
Resource groups:           7167
Locking protocol:          "lock_nolock"
Lock table:                "test:progress"
UUID:                      bf7494b6-0e8c-b837-6b84-53b41030b188

Comment 13 Paul Evans 2016-08-02 16:34:22 UTC
Added some information to the doc text field regarding the feature of the enhancement as requested by Milan Navratil.

"mkfs.gfs2 reports its progress to tell that it is still alive in the event of a long mkfs"

Comment 15 errata-xmlrpc 2016-11-04 06:29:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2438.html


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