Answer the question
In order to leave comments, you need to log in
How to prevent Linux from working when the hard drive fails?
Linux starts up and works. Then, in the process of work, the disk stops writing the log to the database too, but Linux continues to work. And I don't want it to work in this case. I want it to freeze, turn off or reboot. How to make this Linux work correctly?
Answer the question
In order to leave comments, you need to log in
add to fstaberrors=panic
errors=panic Panic and halt the machine if an error occurs.
(These mount options override the errors behavior
specified in the superblock, which can be configured
using tune2fs)
JosikDrained : Well, you are a programmer!
Write something like this, replacing the path to the file with your own:
#!/bin/sh
TESTPATH=/путь/к/любому/каталогу/на/диске/где/будет/создан/файл/имя_файла
if [ `touch $TESTPATH` ]
then
rm $TESTPATH
else
reboot
fi
chmod +x
that it can be executed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question