Comment 2 for bug 200391

Revision history for this message
Martin Pitt (pitti) wrote : Re: usplash and fsck

Hi Kees,

Kees Cook [2008-03-09 17:20 -0700]:
> Additionally, I have some changes to the fsck script I'd like to get you
> to look at. I've attached it to bug 200391. It contains several
> changes in the usplash behavior:
>
> 1:does not use "CLEAR" any more -- this is wrong when booting without
> "quiet", and seems like a problem for people trying to report issues
> in the fsck stage (the screen would get cleared after it finishes).

Makes sense.

> 2:only performs usplash clean-up if output was started (in the case that
> you don't like change #1, this keeps the text log from being cleared
> when all the filesystems are clean and you've booted without "quiet").

That too.

> 3:fixes needless spin while waiting for fsck to start up

Ah, thanks.

> 4:uses usplash progress bar instead of status line to report percentage.
> I personally think this is much more user-friendly, as they can see
> the progress much more clearly. Once the fsck finishes, the progress
> bar will return to the expected percentage when rcS.d continues.

That was in fact my first implementation, but after discussion with
mpt I changed it back to always keep the overall boot status in the
progress bar and report the fsck progress textually (IRC log below
FYI). Primary reason is that we cannot use a different color or other
indication that this is a 'sub'progressbar.

Thanks,

Martin

2008 Feb 12 11:30:19 <pitti> I currently hijack the progress bar to show the fsck progress
2008 Feb 12 11:30:25 <pitti> which means that it'll jump around a little
2008 Feb 12 11:30:39 <pitti> (i. e. used for init script progress, then fsck progress, then again init script
 progress
2008 Feb 12 11:30:52 <pitti> I'd like to use a different colour for fsck, but usplash currently doesn't allow
 that
2008 Feb 12 11:30:55 <TheMuso> Better than nothing.
2008 Feb 12 11:31:03 <pitti> it's probably good enough for a first upload
2008 Feb 12 11:31:08 <mpt> hrm
2008 Feb 12 11:31:15 <pitti> mpt: WDYT? should I use the progress bar or output some text
2008 Feb 12 11:31:19 <cjwatson> pitti: ooh, congratulations
2008 Feb 12 11:31:19 <pitti> (like percentage)
2008 Feb 12 11:31:24 <cjwatson> pitti: which fsck backends does it support?
2008 Feb 12 11:31:43 <pitti> cjwatson: only ext3 actually provides progress reading
2008 Feb 12 11:31:47 <mpt> pitti, how soon in the progress bar do/can you find out that you need to do fsck?
2008 Feb 12 11:31:56 <pitti> I'll check it in a bit how it looks with reiser and xfs
2008 Feb 12 11:32:25 <pitti> rcS.d/S30checkfs.sh
2008 Feb 12 11:32:36 <pitti> should be fairly early
2008 Feb 12 11:32:42 <pitti> I didn't run a complete boot yet
2008 Feb 12 11:32:47 <cjwatson> but only when fsck actually starts
2008 Feb 12 11:32:48 <mpt> pitti, I mean, do you know that you'll have to do a fsck before the progress bar begins?
2008 Feb 12 11:32:49 <pitti> I just start usplash and checkfs. manually
2008 Feb 12 11:33:02 <pitti> right, what cjwatson said
2008 Feb 12 11:33:39 <pitti> mpt: let me test this with a real boot and come back to describe how it looks li
ke in the entire boot sequence
2008 Feb 12 11:33:51 <mpt> ok
2008 Feb 12 11:40:52 <pitti> mpt: so, it actually looks a bit ugly
2008 Feb 12 11:40:58 <mpt> pitti, my usual suggestion is to retain one progress bar for overall progress of the task (in this case, starting up), and using text for subtasks
2008 Feb 12 11:41:19 <pitti> init script progress starts from 0 to 30%, then checkfs kicks in and does 0 to 100, then init script continues from 30 to 100
2008 Feb 12 11:41:30 <mpt> So it's ok if the progress bar gets stuck for a few minutes, as long as there's a line of text changing regularly underneath
2008 Feb 12 11:41:42 <pitti> mpt: ok, I I should rather output the percentage?
2008 Feb 12 11:41:46 <mpt> where "regularly" > 1/second
2008 Feb 12 11:42:12 <mpt> pitti, is there anything more fine-grained you can report than the percentage?
2008 Feb 12 11:42:26 <mpt> For a large disk, a single percentage could take many seconds
2008 Feb 12 11:42:28 <pitti> mpt: fsck has 5 stages, and reports a percentage for each of the stages
2008 Feb 12 11:42:34 <pitti> but they are fairly meaningless
2008 Feb 12 11:42:51 <mpt> Is there a MB measurement, for example?
2008 Feb 12 11:42:57 <mpt> or disk blocks, or something?
2008 Feb 12 11:42:58 <pitti> no
2008 Feb 12 11:43:05 <pitti> well, blocks maybe
2008 Feb 12 11:43:12 <pitti> it outputs some numbers 'cur' and 'max'
2008 Feb 12 11:43:24 <Hobbsee> Mithrandir: heh
2008 Feb 12 11:43:28 <mpt> pitti, do they represent a fraction?
2008 Feb 12 11:43:33 <mpt> i.e. progress = cur/max?
2008 Feb 12 11:43:37 <pitti> I can output the numbers (stage X/5, cur, max) directly instead of percentages
2008 Feb 12 11:43:40 <pitti> mpt: yes
2008 Feb 12 11:43:47 <pitti> mpt: that's the percentage withing a stage
2008 Feb 12 11:43:49 <mpt> and max > 100?
2008 Feb 12 11:43:58 <pitti> for a small disk, max < 100
2008 Feb 12 11:44:04 <mpt> hrm
2008 Feb 12 11:44:04 <pitti> for a large one I suppose it's much bigger
2008 Feb 12 11:44:23 <pitti> I have a 6 GB test partition, where it's 94
2008 Feb 12 11:44:37 <mpt> How long does it take overall?
2008 Feb 12 11:44:49 <mpt> actually, sorry, wrong question
2008 Feb 12 11:44:56 <mpt> How long does the slowest stage take?
2008 Feb 12 11:45:10 <mpt> for that 6 GB
2008 Feb 12 11:45:11 <pitti> oh, stage 1: 46 (70% of time), stage 2: 473 (20% of time), stages 3 to 5 are very quick
2008 Feb 12 11:45:22 <mpt> 473 seconds?
2008 Feb 12 11:45:28 <pitti> no, that's the 'max' number reported
2008 Feb 12 11:45:33 <mpt> oh
2008 Feb 12 11:45:39 <pitti> an absolute number of files or blocks to check, or so
2008 Feb 12 11:45:40 <mpt> a different number for each stage
2008 Feb 12 11:45:57 <pitti> I have a conversion function which accumulates stage, cur, and max to a single percentage
2008 Feb 12 11:46:05 <pitti> (adapted from fsck.ext3)
2008 Feb 12 11:46:13 <mpt> The reason I'm asking this, is that it's good for the text to update at least every couple of seconds
2008 Feb 12 11:46:17 <mpt> so that it never looks frozen
2008 Feb 12 11:46:41 <mpt> As a (very) last resort we could include the time elapsed, I'm just trying to work out whether that's necessary
2008 Feb 12 11:46:58 <pitti> mpt: what about including all?
2008 Feb 12 11:47:06 <Mithrandir> mpt: you don't have any meaningful output that changes every couple of seconds by default, at least.
2008 Feb 12 11:47:19 <pitti> Checking disc..... 23% (stage 1, 234/437)
2008 Feb 12 11:47:27 <Mithrandir> well, maybe on a 6G disk, but not on a 1TB disk or thereabouts.
2008 Feb 12 11:47:31 <mpt> Mithrandir, "by default" as in the existing text display?
2008 Feb 12 11:47:48 <Mithrandir> mpt: yes. You have a text throbber and a progress bar.
2008 Feb 12 11:47:57 <mpt> yes, I'm familiar with it
2008 Feb 12 11:48:06 <mpt> but not familiar with how bad it gets on huge disks
2008 Feb 12 11:48:15 <mpt> s/bad/sullen/
2008 Feb 12 11:48:17 <pitti> (I currently mimic that text mode progress bar behaviour in usplash)
2008 Feb 12 11:48:20 <Mithrandir> it just throbs slower.
2008 Feb 12 11:48:45 <pitti> I think the numbers (cur/max) will get higher, so I could output those
2008 Feb 12 11:48:53 <pitti> fsck seems to update progress several times a second
2008 Feb 12 11:49:13 <mpt> What makes it spin the throbber?
2008 Feb 12 11:49:25 <pitti> mpt: the text mode has a certain threshold for the percentage
2008 Feb 12 11:49:28 <mpt> I mean, what has it finished when it rotates one segment
2008 Feb 12 11:49:38 <pitti> e. g. if one "=" represents 2.3%, it updates the progress bar every 2.3%
2008 Feb 12 11:50:14 <pitti> oh, it has that rotating thingy, too
2008 Feb 12 11:50:27 <Mithrandir> pitti: "throbber". :-)
2008 Feb 12 11:50:53 <pitti> Mithrandir: I think I just learned a new word :)
2008 Feb 12 11:50:54 <mpt> So, if we can assume that (a) fsck will usually take more than a couple of minutes, and (b) for most disks max > 100, then I think it's better to show cur & max
2008 Feb 12 11:51:16 <pitti> mpt: maybe the percentage in addition, to give a feeling for an ETA?
2008 Feb 12 11:51:28 <mpt> throbber, I think comes from Netscape 1.1, where it actually throbbed
2008 Feb 12 11:51:46 <pitti> since stage 1 takes 70% and stages 2 to 5 together 30%, it would look less intimidating
2008 Feb 12 11:52:10 <mpt> pitti, you're right
2008 Feb 12 11:52:17 <pitti> mpt: WDYT about "23% (stage 1/5, block 234/437)"
2008 Feb 12 11:52:21 <mpt> Your suggestion above is perfect
2008 Feb 12 11:52:39 <mpt> except three dots, not five :-)

--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

My 5 today: #198753 (libxfce4mcs), #198129 (tzdata), #146230 (ps3-kboot),
#153152 (hplip), #177382 (postgresql-8.3)
    Do 5 a day - every day! https://wiki.ubuntu.com/5-A-Day