
What is fsck up to now? - Arnt
https://toroid.org/what-is-fsck-up-to-now
======
saagarjha
One of my favorite BSD features is SIGINFO, which is intended for applications
to give some sort of information about what they’re currently doing. If you’re
on macOS, I know some of the copying commands (such as dd) implement it, and a
^T in your terminal will tell you how far along it is.

~~~
masklinn
SIGINFO is awesome, I've no idea why the linux world refuses to copy its
semantics.

~~~
kylek
I was thinking it was SIGINFO, but this reminded me of the SIGUSR1 trick to
get the current status of a running dd process-

    
    
      $ dd if=/dev/zero of=/dev/null& pid=$!
      $ kill -USR1 $pid; sleep 1; kill $pid
      
      18335302+0 records in 18335302+0 records out 9387674624 bytes (9.4 GB) copied,  34.6279  seconds, 271 MB/s

~~~
dntbnmpls
That's interesting. I always wonder how people monitored the progress of dd
before it added the status option.

Now you can use the status option to get a realtime update of the progress.

dd if=/dev/urandom of=/dev/null status=progress

------
monitron
This is cool. But it seems to me that this person's setup could benefit from a
way for the computers to be notified that battery power would run out soon so
that they could shut down cleanly. I have that going at home through a USB
connection to a UPS...it would be harder to set it up with a central battery
but they seem to be up to fun challenges :)

~~~
amenonsen
(I'm this person.) It so happens that the solar inverter I'm using right now
doesn't provide a data connection that I could use to shut down the computers
cleanly.

But I should also clarify that my long-running fsck isn't always the result of
an unclean shutdown. There's something about my combination of
iSCSI+crypttab+NFS that causes fsck to be run too often—even if I shut down
the machine cleanly while the NAS is running, it usually decides to fsck when
it comes back up.

Something to investigate next winter, perhaps.

~~~
monitron
Hi :) Thanks for the awesome write-up. I understand...I have a few devices in
my house that resist all attempts at integration. I have considered doing
something totally ridiculous like setting up a Raspberry Pi with a camera and
machine vision software to watch the LED displays on these devices to glean
status information. Silly, but...

Interesting about fsck running for unclear reasons. "What is it up to now?" is
a valid question at multiple levels!

~~~
amenonsen
> Thanks for the awesome write-up.

Glad you enjoyed it. :-)

> I have considered doing something totally ridiculous like setting up a
> Raspberry Pi with a camera and machine vision software to watch the LED
> displays on these devices to glean status information. Silly, but...

Ha! I actually have a PoE camera pointed at the display of my UPS. Here's what
it looks like right now: [https://toroid.org/misc/ups-
display.jpg](https://toroid.org/misc/ups-display.jpg)

Notice that horizontal blank row of dead pixels halfway down the right side of
the display? The one that makes "54.6" look like "51.6"? That gap defeated my
naïve five-minute attempt to use image recognition to extract the battery
voltage.

~~~
all2
I would be tempted to tie the LED lines to digital ins on an Arduino. I'm
betting some finagling with the display data lines could get you the
information from the display, as well.

Depending on how the cabling to that display works, you might be able to do
all of that without having to disable the display.

------
JdeBP
Enjoy some more manual pages in the same vein:

* [http://jdebp.uk./Softwares/nosh/guide/commands/monitored-fsc...](http://jdebp.uk./Softwares/nosh/guide/commands/monitored-fsck.xml)

* [http://jdebp.uk./Softwares/nosh/guide/commands/monitor-fsck-...](http://jdebp.uk./Softwares/nosh/guide/commands/monitor-fsck-progress.xml)

And a service:

    
    
        % system-control print-service-scripts monitor-fsck-progress
        start:#!/bin/nosh
        start:true
        stop:#!/bin/nosh
        stop:true
        run:#!/bin/nosh
        run:#local socket used for monitor-fsck-progress
        run:local-stream-socket-listen --systemd-compatibility --backlog 2 --mode 0644 /run/fsck.progress
        run:setsid
        run:setlogin -- daemon
        run:vc-get-tty console
        run:fdmove -c 4 2
        run:open-controlling-tty
        run:fdmove 2 4
        run:setuidgid -- daemon
        run:./service
        service:#!/bin/nosh
        service:#fsck combined progress information displayed on /dev/console
        service:monitor-fsck-progress
        restart:#!/bin/sh
        restart:exec false      # ignore script arguments
        %

------
phaemon
Don't usually care about titles but surely, "What, the fsck, have you done?"

~~~
dhosek
I've always figured that fsck is called that because they couldn't come up
with an acronym with u.

~~~
saagarjha
Filesystem Uniformity ChecK isn't a huge reach…

~~~
amenonsen
[https://groups.google.com/forum/#!msg/alt.sysadmin.recovery/...](https://groups.google.com/forum/#!msg/alt.sysadmin.recovery/tsGbbkvHo2c/6T-Pj9d3A6wJ)

------
knorker
Ugh, the more I see of systemd the worse it looks. What a mess of a "design"
we see a glimpse of here.

------
hello_tyler
Did he ever get to fsck ? Or did it just hang the entire time ?

------
ck2

         killall -USR1 e2fsck
    

or start it with -C

~~~
JdeBP
systemd-fsck, as the article outright told you, already starts it with -C .

