[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to get a log of fsck on boot partition when using systemd-sysv



On 05/11/2014 03:35 AM, Sven Joachim wrote:
On 2014-05-10 23:49 +0200, Jape Person wrote:

In various logs on these systems I see an indication that "touch
/forcefsck" doesn't work with systemd running the show, and that
adding

fsck.mode=force

to the linux boot line in Grub is now the proper way to force fsck to
run at boot time.

It is true that fsck.mode=force is the recommended way, but the methods
used by the checkfs.sh initscript are still supported despite the
warning systemd-fsck prints when you use them.


Thanks for this information, Sven. I was assuming that the warning message scrolling by on the screen meant that the file system check was not actually being run. (More on this later.)

It's nice that it works, because that means I can still initiate the fsck on remote systems. I'm not sure what I'm going to do if this bit of backward compatibility gets eliminated before some other means besides editing the Linux boot line to force the file system check is provided. I suppose I could just update grub and have the check run every time the systems are rebooted. It's not like it takes that long for fsck to run.

However, though I see that fsck is running when I boot the system
after altering the boot process, there is still no output from the
operation written to the checkroot file. I presume this is part of the
rhubarb I've noticed on various lists concerning the logging of the
boot process when using systemd.

Those messages end up in the journal.  The initscript captures them with
logsave(8) which is a kludge to work around the problem that syslog is
not yet available when it runs.


Okay, well a kludge is certainly better (for me) than nothing!

;-)

This is hardly a huge problem for me, but I'd like to keep practicing
this slightly OCD behavior if I can on a couple of the more critical
machines.

Would anyone have thoughts on how I can get a record of the file
system check on the boot drive when using systemd?

Something like "journalctl -b | grep systemd-fsck".  I haven't figured
out how to get "journalctl -u" to work here.


Thank you for leading me to the water, Sven. Your example shows me that I really need to get into using the standard textual tools that are so valuable to this operating system.

I'm a tinkerer/hobbyist with GNU/Linux. I use it a lot, but I don't really work *on* it a lot.

What's funny is that I had examined the journal after using "touch /forcefsck" by using cat to pipe it to a text file and just searching with the find function of a text editor. I then stupidly quit looking as soon as I found the warning message, assuming that the fsck hadn't actually been run. Because I wasn't using a specific tool like grep (which would have shown me only what I needed to see) to find what I was looking for, I just quit.

Then when I tried to run the check by editing the Linux boot line I (rather dumbly, I admit) just checked /var/log/fsck/checkroot again for the results instead of going back to the journal.

All around not one of my brighter days.

If I had been a little less tired and a little more assiduous with the text editor -- or if I'd used the proper tool for searching the journal in the first place -- I'd have found what I was looking for.

You are an awfully useful person to have around because you help so much with understanding the process. Many thanks.

Cheers,
        Sven

Best regards,
Jape


Reply to: