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

Re: How can I force a full fsck on a remote system at next reboot?





On 03/12/2015 05:48 PM, Michael Biebl wrote:

touch /forcefsck is deprecated under systemd, but still supported.

What sysvinit's shutdown -F does, is simply create that flag file.
That parameter was removed from systemd's shutdown command, as its use
is discouraged, but as said, still supported.

Run "touch /forcefsck" under systemd and it will happily check the file
systems on next boot.


As for alternate ideas: I could think, that having update-grub generate
an alternate grub entry, which adds fsck.mode=force to the kernel
command line and which can be selected during boot, might be one idea.


For remote systems, where you don't have a sideband channel like iLO,
you could use "grub-set-default", to choose the boot entry for the next
boot. See man 8 grub-set-default.


Hi, Michael.

Well, I almost got it.

Adding a new menu entry to run fsck was easy enough. I modified the /etc/grub.d/40_custom script and ran update-grub, and the new entry thus created works when chosen from the grub menu.

However, I can't get grub-set-default to redesignate that new menu entry as the default.

What I did to try to get it to work:

1. changed the "GRUB_DEFAULT=0" entry in /etc/default/grub to "GRUB_DEFAULT=1" (Also tried "GRUB_DEFAULT=saved", just in case the manual was being explicit about the value.) 2. ran grub-set-default (I tested the command using both the menu line number and the full menu line name in quotes.)

I ran update-grub after each set of changes. The default in the grub menu (indicated by the asterisk) kept showing up as the "advanced" submenu instead of the menu line I wanted to choose.

The info and man pages for grub-set-default are the same. So far my efforts to locate a more in-depth explanation of the utility via search engines hasn't found anything that looks particularly helpful.

I'm sure I'm being dense.

Suggestions (other than put down the keyboard and step away from the computer)?

Best,
JP


Reply to: