Hello,
I'm deploying a bunch of custom x86 headless systems that boot from SD card.
Its not uncommon that an SD card get corrupted and at boot I get:
UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
and the system starts int the initial ram FS.
From here I can manually recover the boot... but only by connecting a monitor and a keyboard, since the system is stuck without network configuration.
Is there a way to setup FSCK to recover the errors AUTOMATICALLY... or maybe boot from another source or execute any kind of script.... ? I don't mind much about the content of the drive because I can clone it back, but it's very very bad if the system stops the boot waiting for user input...
Thanks a lot!
Marco
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] Force FSCK automatically at boot
-
- Posts: 3
- Joined: 2017-06-23 16:44
[SOLVED] Force FSCK automatically at boot
Last edited by marcoventurini on 2017-07-01 12:56, edited 1 time in total.
Re: Force FSCK automatically at boot
Yes.marcoventurini wrote:Is there a way to setup FSCK to recover the errors AUTOMATICALLY
If you want additional detail, copy-and-paste your thread title directly into your favorite search engine.
-
- Posts: 3
- Joined: 2017-06-23 16:44
Re: Force FSCK automatically at boot
Can you please enlighten me? It may be a more useful way to spend your time.
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Force FSCK automatically at boot
Like this:
Force FSCK automatically at boot
There are several good results, you can take your pick, or try this one:
https://unix.stackexchange.com/question ... ilesystems
Also : has instructions.
Force FSCK automatically at boot
There are several good results, you can take your pick, or try this one:
https://unix.stackexchange.com/question ... ilesystems
Also :
Code: Select all
man fsck
From fsck manual:
FSCK(8) System Manager's Manual FSCK(8)
NAME
fsck - file system consistency check and interactive repair
------snip--------
-y Cause fsck to assume "yes" as the answer to all operator
questions.
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
-
- Posts: 3
- Joined: 2017-06-23 16:44
Re: Force FSCK automatically at boot
Thanks a lot,
More or less all the results that I found (and this is why I posted my question) recommend this :
1) Syslinux (my bootloader in the UEFI parition) boots the Kernel.
2) The Kernel starts with the initial ramdisk that is on the UEFI partition as well.
3) The initial ramdisk mounts (or refuses to mount in case of errors) the root file system and the FSCK utility must run form the initramfs.
How can a setting stored inside the root file system affect the initramfs behavior? Is the rootfs is not mounted "/etc/default/rcS" has no effect... am I right?
I verified that changing "/etc/default/rcS" does not work, at the end i found that those two Kernel command line parameters will do the job (and that makes sense, since they are passed to the initramfs too)
I'm a bit puzzled by the "/etc/default/rcS" thing... is that clear to you?
Thanks a lot,
Marco
More or less all the results that I found (and this is why I posted my question) recommend this :
But i don't understand how is it supposed to work... let me clarify:To prevent manual fsck runs, ask fsck to try to automatically fix errors with the -y option by uncommenting and changing no to yes in the following /etc/default/rcS entry, after the edit it should look like:
# automatically repair filesystems with inconsistencies during boot
FSCKFIX=yes
1) Syslinux (my bootloader in the UEFI parition) boots the Kernel.
2) The Kernel starts with the initial ramdisk that is on the UEFI partition as well.
3) The initial ramdisk mounts (or refuses to mount in case of errors) the root file system and the FSCK utility must run form the initramfs.
How can a setting stored inside the root file system affect the initramfs behavior? Is the rootfs is not mounted "/etc/default/rcS" has no effect... am I right?
I verified that changing "/etc/default/rcS" does not work, at the end i found that those two Kernel command line parameters will do the job (and that makes sense, since they are passed to the initramfs too)
https://www.freedesktop.org/software/sy ... rvice.htmlfsck.mode=
One of “auto”, “force”, “skip”. Controls the mode of operation. The default is “auto”, and ensures that file system checks are done when the file system checker deems them necessary. “force” unconditionally results in full file system checks. “skip” skips any file system checks.
fsck.repair=
One of “preen”, “yes”, “no”. Controls the mode of operation. The default is ” preen”, and will automatically repair problems that can be safely fixed. “yes ” will answer yes to all questions by fsck and “no” will answer no to all questions.
I'm a bit puzzled by the "/etc/default/rcS" thing... is that clear to you?
Thanks a lot,
Marco