Useful Snippets

Useful Snippets


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

August 2020
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories


Increasing write timeout on a hard drive / block device

Stanislav KhromovStanislav Khromov

I was having issues with my CentOS system a Hetzner VQ Server. It turned out the virtualization caused some device (hard drive) writes to timeout, which put the file system into read-only mode. Consecutively the machine would crash and upon reboot no services would start as they couldn’t write to their log files.

Here is how to fix it:

echo 180 > /sys/block/sda/device/timeout

Remember to change sda to your device. If you have multiple devices (sda, sdb etc) the command needs to be run separately for each of them.

Note
The command will only last until reboot. To set it at startup, read this article.

Source 1
Source 2

Web Developer at Aftonbladet (Schibsted Media Group)
Any opinions on this blog are my own and do not reflect the views of my employer.
LinkedIn
Twitter
WordPress.org Profile
Visit my other blog

Comments 0
There are currently no comments.