[arch-general] Forced to run fsck manually on unattended system
Hi, I run a series of remote boxes running Arch. These boxes are unnattended and are very difficult to access. Due to the nature of their power supply they are often powered down without any warning. A UPS is not an option. I have noticed that over time the boxes are showing file system errors and getting stuck during the boot phase requiring manual intervention (Either press Control-D to continue - resulting in failure or log in to the start up shell using the root password and run fsck manually). I simply answer yes to every prompt from fsck and the errors are resolved, the box reboots and runs fine. I need to be able to force an 'fsck -y' type command at every boot as visiting these boxes manually isn't an option. I have already moved the partitions to ext2 as this seemed to show a mild improvement and also set 0 1 flags in /etc/fstab but still I'm seeing the freezing on boot. First of all should I be re-partitioning my drives to something which can handle these kinds of sudden power outages or removing the swap space or something? Secondly can I have arch run a completely unprompted startup whereby fsck will do its best to repair the system without requiring intervention - for me a blank disk is no worse than a frozen system. Thanks in advance, Edward Smith -- View this message in context: http://archlinux.2023198.n4.nabble.com/Forced-to-run-fsck-manually-on-unatte... Sent from the arch general mailing list archive at Nabble.com.
Hi, On 6 March 2013 02:31, edd_smith <edwardmbsmith@gmail.com> wrote:
I have noticed that over time the boxes are showing file system errors and getting stuck during the boot phase requiring manual intervention (Either press Control-D to continue - resulting in failure or log in to the start up shell using the root password and run fsck manually). I simply answer yes to every prompt from fsck and the errors are resolved, the box reboots and runs fine.
It may *appear* fine, and technically it may be correct, but your data is more than likely not in the state that you're expecting.
I need to be able to force an 'fsck -y' type command at every boot as visiting these boxes manually isn't an option. I have already moved the partitions to ext2 as this seemed to show a mild improvement and also set 0 1 flags in /etc/fstab but still I'm seeing the freezing on boot.
You can do this by creating /forcefsck on each boot. A systemd service like this should do (untested): [Unit] Description=Create /forcefsck to force fsck on next reboot [Service] Type=oneshot ExecStart=touch /forcefsck
First of all should I be re-partitioning my drives to something which can handle these kinds of sudden power outages or removing the swap space or something?
If you want to avoid data loss at the cost of performance, don't do any disk write caching. If I recall correctly, you can do this with `hdparm -W 0'. Best, Chris
On Wed, Mar 6, 2013 at 1:28 AM, Chris Down <chris@chrisdown.name> wrote:
If you want to avoid data loss at the cost of performance, don't do any disk write caching. If I recall correctly, you can do this with `hdparm -W 0'.
And using a journaled file system, such as ext3 or ext4, should improve the situation. If you feel more comfortable with old, proved filesystems, ext3 has been ready for production systems for quite some time. Best regards. -- Rodrigo
I have found a way around my problem of freezing on startup. The startup script is called from /etc/rc.d/functions You simply find the section where the fsck command is called and edit the flags to remove -a and add -y. I understand that my data may end up getting a little frazzled, but hopefully turning off disk caching with hdparm (this is a low performance system anyway) should sort things out. For what it's worth I'm using SSDs and I've found that a journalled file system (ext3/4) struggled a bit more with sudden power outages, but this is all emperical. Many thanks for all your suggestions. -- View this message in context: http://archlinux.2023198.n4.nabble.com/Forced-to-run-fsck-manually-on-unatte... Sent from the arch general mailing list archive at Nabble.com.
On Thu, Mar 7, 2013 at 6:06 AM, edd_smith <edwardmbsmith@gmail.com> wrote:
For what it's worth I'm using SSDs and I've found that a journalled file system (ext3/4) struggled a bit more with sudden power outages, but this is all emperical.
A filesystem without journalling just doesn't know anything went wrong, and silently loses data.
participants (4)
-
Chris Down
-
Daniel Micay
-
edd_smith
-
Rodrigo Rivas