Admins eHow SysAdmin Tips & Tricks

October 24, 2012

The proper way to benchmark disk write performance in Linux

Filed under: CentOS,Debian,linux — Tags: , , , , — admin @ 7:46 am
dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync

The result is something like this :
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 1.43334 s, 375 MB/s

October 14, 2012

How to enable AHCI support for Windows on an iMac, MacBook or etc

Filed under: Apple — Tags: , , , , , , — admin @ 9:18 am

Apple does all the dirty tricks to show the iSheeps that Apple is a superior brand and provides superior performance compared to competition, the last one I found is that it disables AHCI support for Windows on its hardware. By disabling AHCI (which you have already paid for it and Apple hardware has this feature) it forces Windows to use ATA controller disk drivers which is considerably slower than AHCI and has less features. for example you wont have TRIM support on your SSD disk on your Windows.
By doing so, Apple gives you this feeling that Windows is slower than Mac OSX on the same hardware.
Hopefully there is a workaround for this fraud of Apple. You will need to modify the Master Boot Record of your Windows drive.
This workaround only works for Macs with Intel disk controllers. If you have Nvidia chipset, it will not work for you. You may confirm it in device manager of Windows.
First step is to make sure windows tries to load AHCI drivers after AHCI is enabled in boot loader. if you miss this step you will get a BSOD on booting windows and you will need to restore old MBR for windows too boot up.
Open your Windows registry editor and make sure “Start” Value in the following keys are set to 0.

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\IastorV
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Iastor

Also we need the modified MBR which you can download from here : patchedcode.bin
Put the patchedcode.bin on a USB stick which we can use later.
OK, We are done in Windows. Now we need to boot using a Linux Live CD or MacOSX Install Disk. both will work.
Put the bootable CD or USB stick into your computer and reboot.
When you hear the boot sound (the white screen appears) hold down the option (alt) key. you should get the option to boot from CD or USB stick.
Boot from CD or USB stick and Open a Terminal Window.
First lets get a backup from current MBR so in case of any problems we can roll back to it.
Also please note I am assuming your windows disk is /dev/disk0. if yours is different you may need to change it.
Put in your USB stick, change directory to it and run the following command :

dd if=/dev/disk0 of=backup.bin bs=512 count=1

it will make a backup from your MBR to backup.bin
now it is time to write the new MBR to disk :

diskutil umountdisk /dev/disk0
dd if=patchedcode.bin of=/dev/disk0 bs=440 count=1

All done ! now reboot into windows :

shutdown -r now

In Windows you should see windows installs the new AHCI drivers. also you may check that by looking into device manager.
Also I recommend you to download and install “Intel Matrix Storage Manager” to update your AHCI drivers to intel’s ones.
If anything goes wrong, you can revert back to old MBR by following commands in Terminal :

diskutil umountdisk /dev/disk0
dd if=backup.bin of=/dev/disk0 bs=440 count=1

October 12, 2012

How to install transmission 2.71 on Debian 6.0 Squeeze

Filed under: General — admin @ 6:41 am

Installing transmission 2.71 on Debian 6 is a little tricky and is not as straight forward as installing by apt-get.
Here is how you can do it.

First you need to manually install libevent 2.0 :

apt-get install make gcc
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz 
tar zxvf libevent-2.0.20-stable.tar.gz 
cd libevent-2.0.20-stable
./configure
make
make install

then some prerequisite packages for later installation :

apt-get install libssl-dev pkg-config libcurl4-openssl-dev intltool tar bzip2

now it is time to download and configure transmission :

wget http://download.transmissionbt.com/files/transmission-2.71.tar.bz2
tar jxvf transmission-2.71.tar.bz2
cd transmission-2.71
./configure --enable-lightweight --enable-daemon

now if you try to compile (make) the package you will get the following error :

tr-utp.c:65: error: conflicting types for ‘UTP_Write’
../third-party/libutp/utp.h:116: note: previous declaration of ‘UTP_Write’ was here
make[1]: *** [tr-utp.o] Error 1
make[1]: Leaving directory `/root/transmission-2.71/libtransmission’
make: *** [all-recursive] Error 1

in order to fix this error open this file in transmission directory :

nano ./third-party/libutp/utypes.h

and comment following lines :

// #ifndef __cplusplus
// typedef uint8 bool;
// #endif

and add following line just after above lines :

 
#ifndef __cplusplus
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#else
typedef uint8 bool;
#endif
#endif

save file and exit. return to transmission root directory and make and install.

make
make install

Powered by WordPress