sobota, dubna 16, 2011

Turn off hard disk power saving

I've had troubles to turn off the power saving mode of a hard drive. Nothing I tried worked. I have found descriptions of where to switch off the stand by mode or the sleep mode of hard drives or external USB devices, but these settings had no effect on the hard drive I had (Samsung Story HX-DE020EB).

I have found two programs which were supposed to keep the hard drive awake and spinning: NoSleepHD and xSleep. I tried both and none of them worked properly with my particular external hard drive. It still was getting asleep once in a while.

So I wrote myself a little program which creates as many temporary files as you want (each a few bytes long) in specified locations and overwrites them once in a specified time interval. This way it is ensured that the drives keep spinning.

The program runs only in Windows. You can download it here:
keepawake.zip for 64-bit Windows
keepawake32.zip for 32-bit Windows

User's Manual:

Extract the downloaded zip file. Then you should have a look at the configuration file keepawake.cfg.txt. By default it looks like this:

How often to overwrite all temporary files (in seconds):
40
Paths to the temporary files (one path per line):
C:\temp.tmp

By editing the configuration file you can set up the interval how often the program will overwrite each file in the list of temporary files. The default cycle is 40 seconds.

The last lines of the configuration file are the paths to the temporary files which will be created or overwritten once per cycle. You can add as many as you want here. One temp file per physical drive is enough. If you want to keep drives I: and J: awake, instead of C:\temp.tmp you can have there:

I:\temp.tmp
J:\some folder\I don't want to call this file temp.tmp

It is even possible to add network paths, e.g. \\Homecomputer\datadrive\temp.tmp

Then you just run keepawake.exe. The console window of cmd.exe will open and, in the given time interval, it will refresh a message about how long the drive has been kept alert. You'll have to keep this console window open or minimized for all the time you want to keep the program running.

This is how the console window looks on my computer:

screenshot of keepawake running

You will find the source code of the program in the source folder. It's written in Python 3.2. It's public domain. Do with it whatever you want.

Neuspávat disk

Měl jsem problém s externím diskem, který se po krátké době uspával aniž bych proti tomu mohl cokoliv dělat.

Na internetu jsem našel doporučení, kde se ve Windows v možnostech napájení dá vypnout uspávní disků nebo zařízení zapojených přes USB, ale u toho mého disku to nepomáhalo. Dočetl jsem se, že některé disky mají uspávání naprogramované přímo ve firmwaru.

Našel jsem odkazy na dva programy, které prý udržují disky roztočené. Jsou to NoSleepHD a xSleep. Zkusil jsem oba, ale zrovna u toho mého disku nezabíraly. Pořád se uspával.

Nakonec jsem si sedl a napsal prográmek, který v konfigurovatelném intervalu přepisuje několikabajtový dočasný soubor, jehož umístění si lze rovněž nakonfigurovat. Tím SE zamezí, aby se ten disk, na kterém je ten dočasný soubor, uspal.

Program funguje jen ve Windows. Zde si ho můžete stáhnout:
Neuspavat.zip pro 64bitové Windows
Neuspavat32.zip pro 32bitové Windows

Návod k použití:
Stažený soubor stačí rozbalit. Editací konfiguračního souboru neuspavat.kfg si můžete nastavit interval v jakém se na disk bude zapisovat dočasný soubor i cestu k němu (a tím i disk, který udržovat v pohotovosti). Pak už jen spustíte neuspavat.exe. Otevře se vám okno konzole cmd.exe ve kterém se v zadaném intervalu bude aktualizovat zpráva o době po kterou byl disk v pohotovosti. Pořadí řádků v konfiguračním souboru neměňte.

V adresáři source najdete zdrojové soubory napsané v Pythonu 3.2

středa, ledna 19, 2011

MiKTeX 2.9

Já se z toho poseru. Tři hodiny tady downloaduju a instaluju MiKTeX 2.9 a na 99.9% instalace mi oznámí, že se mu nepodařilo něco udělat. Celá ta multigigabajtová srajda na disku nefunguje, není doinstalovaná a jenom její smazání trvalo 15 minut. Nevím v čem byla chyba asi mám tady v práci zaneřáděnej disk, takže zápis i čtení jsou tak pomalý, že instalátor asi ztratil trpělivost a vykašlal se na to. Zkusím DickCleanup a defragmentaci a zejtra tu instalační mašinérii rozjedu znova.