7

Manjaro Linux on a Western Digital USB hardrive with sleep disorder ;)

 3 years ago
source link: https://msiyer.com/manjaro-linux-on-a-western-digital-usb-hardrive-with-sleep-disorder/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Hardware

Manjaro Linux on a Western Digital USB hardrive with sleep disorder ;)

msiyer

16 Apr 2014 • 1 min read

This is a problem that had me baffled for a long time. I had, very long back, during the very initial days of Manjaro Linux, installed it on my Western Digital(WD) My Passport HD. WD My Passport is a 160GB yellow colored cute little thing. Everything worked great. Manjaro is undoubtedly one of the best distros out there. After a few minutes of inactivity, the hard drive would go to sleep and the XFCE desktop environment would stop obeying my commands as if it had suddenly been gripped by dementia. Icons would vanish. The few that would remain would throw weird error messages. Rebooting was the only option. But I had no trust in such a system. I tried Fedora, openSUSE and some other distros too. Heck, I even tried FreeBSD. The results were no different.

I searched all the forums I could but did not receive an answer that could satisfy me. I downloaded the gnome-disk-utility and looked at the drive settings. I tried playing with all settings without any success.

Then I experienced an epiphany. I thought why would a drive go to sleep if there is constant activity? So an infinite loop with a periodic disk write activity would suffice to keep the drive awake for as long as I please!

Here is the script:

[code language=”bash”]

!/bin/bash

while true
do
echo -e "\e[31m—prevent hdd from sleeping script running…\e[0m"
echo "do not let him sleep" >> /home/msiyer/Documents/KeepTheBloodyHDDAwake.log
echo -e "—wrote into the \e[31m/home/msiyer/Documents/KeepTheBloodyHDDAwake.log\e[0m file"
echo "—now sleeping for 30 seconds…"
sleep 30
done
[/code]


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK