Monday, January 30, 2006

Linux - Tune your IDE Hard Disk

hdparm is a tool for altering various parameters associated with IDE drives. This involves things like the block prefetch, the DMA/PIO modes, and a number of other things.

hdparm --help

shows a list of all available options. To get more information about your hard disk, run

hdparm -i /dev/hda

This will look like:

/dev/hda:

Model=ST94019A, FwRev=5.11, SerialNo=3KW5V2FK
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78140160
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=yes: unknown setting WriteCache=enabled
Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2:

* signifies the current active mode

To see how fast your hard disk currently is execute

hdparm -tT /dev/hda

Output:

/dev/hda:
Timing buffer-cache reads: 1496 MB in 2.00 seconds = 748.00 MB/sec
Timing buffered disk reads: 62 MB in 3.23 seconds = 19.20 MB/sec
[root@mybox jabber]#

Now you can run

hdparm -c1 -d1 -X 66 /dev/hda ---- (I choose 90, instead of 60)

to tune your hard disk. The X flag stands for the transfer mode (PIO: 8; DMA: 32; U-DMA: 64) + the number of the mode (2 for udma2: 64 + 2 = 66).

Now run

hdparm -tT /dev/hda

again, and if you're lucky, your hard disk should have become "faster".

Now My output is :

[root@mybox jabber]# hdparm -tT /dev/hda

/dev/hda:
Timing buffer-cache reads: 1516 MB in 2.00 seconds = 758.00 MB/sec
Timing buffered disk reads: 76 MB in 3.00 seconds = 25.33 MB/sec
[root@mybox jabber]#

You can see difference in performance now.


TO verify that DMA in enabled for your Harddisk :

[root@localhost ~]# hdparm -d /dev/hda

/dev/hda:
using_dma = 1 (on)


If DMA is not enabled, enable it by issuing the following command:
hdparm –d 1 /dev/hda

To verify 32 bit Transfers are enabled :
[root@localhost ~]# hdparm -c /dev/hda

/dev/hda:
IO_support = 0 (default 16-bit)

To Enable 32 bit Transfers :

[root@localhost ~]# hdparm -c 1 /dev/hda

/dev/hda:
setting 32-bit IO_support flag to 1
IO_support = 1 (32-bit)

Disk Read Test :

[root@localhost ~]# hdparm -T -t /dev/hda

/dev/hda:
Timing cached reads: 1816 MB in 2.00 seconds = 906.78 MB/sec
Timing buffered disk reads: 42 MB in 3.14 seconds = 13.38 MB/sec
[root@localhost ~]#


Note : 1 - To Enable , 0 - To Disable

Mailman - Faq

Learn more about Mailman Features and Installation

Where can I view all the Public Mailing List

available with Mailman ?
- http://mybox.sriram.com/mailman/listinfo

How can one Subscribe, Unsubscribe or login to Subscribers list ?
- http://mybox.sriram.com/mailman/listinfo/list-name

list-name=name of the list to which you want to subscribe

Once you Subscribe you will get a mail to the mail Id you have
mentioned in the Subscription details :

You will have to click the link in mail and Subscribe.


How does a Admin Create and Manage the Mailing list

General Admin Login:
- http://mybox.sriram.com/mailman/admin

Create a new List:
Web Based - http://mybox.sriram.com/mailman/create


Console -
#cd /usr/lib/mailman/bin
[root@mybox bin]# ./newlist mailman

enter the email of the person running the list: sriram@sriram.com
Initial mailman password:
Hit enter to notify mailman owner...


Manage a Particular list with admin login :
-http://mybox.sriram.com/mailman/admin/list-name

Points to note :

Make Sure your Mail Server settings are proper
that it is able to send and receive mails to internal
users you might want to subscribe.

Configuration file for setting up mail server with Mailman
#cat /usr/lib/mailman/Mailman/mm_cfg.py
Setting Up Mailman Administration Password
#cd /usr/lib/mailman/bin
[root@mybox bin]# ./mmsitepass
New site password:
Again to confirm password:
Password changed.















Installing Mailman

In the Previous Post I have explained Mailman.

Here I will go about Installing Mailman ---

Installing Mailman through source is pain in the neck.

Like you need to configure group, user , setuid etc ....

If you have no other work then you try that way.

I have installed this through RPM :

The Steps I followed were :

[root@mybox mailman]# urpmi mailman
To satisfy dependencies, the following packages are going to be installed (32 MB):
libpython2.3-2.3-3.1.92mdk.i586
mailman-2.1.2-9.4.92mdk.i586
python-2.3-3.1.92mdk.i586
python-base-2.3-3.1.92mdk.i586
Is this OK? (Y/n) Y
medium "contrib" uses an invalid list file:
mirror is probably not up-to-date, trying to use alternate method

ftp://ftp.is.co.za/mirror/mandrivalinux/old/updates/9.2/RPMS/
./libpython2.3-2.3-3.1.92mdk.i586.rpm
ftp://ftp.is.co.za/mirror/mandrivalinux/old/updates/9.2/RPMS/
./python-base-2.3-3.1.92mdk.i586.rpm
ftp://ftp.is.co.za/mirror/mandrivalinux/old/updates/9.2/RPMS/
./python-2.3-3.1.92mdk.i586.rpm
ftp://ftp.is.co.za/mirror/mandrivalinux/old/updates/9.2/RPMS/
./mailman-2.1.2-9.4.92mdk.i586.rpm
installing /var/cache/urpmi/rpms/python-2.3-3.1.92mdk.i586.rpm /var/cache/urpmi/rpms/python-base-2.3-3.1.92mdk.i586.rpm /var/cache/urpmi/rpms/libpython2.3-2.3-3.1.92mdk.i586.rpm /var/cache/urpmi/rpms/mailman-2.1.2-9.4.92mdk.i586.rpm
Preparing... ##################################################
1:libpython2.3 ##################################################
2:python-base ##################################################
3:python ##################################################
4:mailman ##################################################
Post-install compilation...
Reloading httpd2: [ OK ]

*****
* You must now "cd /usr/lib/mailman/; ./bin/mmsitepass" as root to set the
* site password to be used for administrating all Mailman data as necessary.
*****

*****
* You must also "cd /usr/lib/mailman/; su -c "./bin/newlist mailman" mail" as root to
* setup the base mailman maillist - answer the questions appropriately.
*****

*****
* You should then issue the command "service mailman start" as root to start the server.
*****

Setting Up Mailman Administration Password
#cd /usr/lib/mailman/bin
[root@mybox bin]# ./mmsitepass
New site password:
Again to confirm password:
Password changed.

Creating a New List
[root@mybox bin]# ./newlist mailman
Enter the email of the person running the list: sriram@sriram.com
Initial mailman password:
Hit enter to notify mailman owner...

Since I am using Postfix I added the aliases in /etc/postfix/aliases

mailman: "|/usr/lib/mailman/mail/mailman post mailman"
mailman-admin: "|/usr/lib/mailman/mail/mailman admin mailman"
mailman-bounces: "|/usr/lib/mailman/mail/mailman bounces mailman"
mailman-confirm: "|/usr/lib/mailman/mail/mailman confirm mailman"
mailman-join: "|/usr/lib/mailman/mail/mailman join mailman"
mailman-leave: "|/usr/lib/mailman/mail/mailman leave mailman"
mailman-owner: "|/usr/lib/mailman/mail/mailman owner mailman"
mailman-request: "|/usr/lib/mailman/mail/mailman request mailman"
mailman-subscribe: "|/usr/lib/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe mailman"

Web Configuration - Add this to your httpd.conf file

ScriptAlias /mailman/ /usr/lib/mailman/cgi-bin/

AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all


Alias /pipermail/ /usr/lib/mailman/Mailman/Archiver/

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Restart Web Server

[root@mybox conf]# /etc/rc.d/init.d/httpd restart
Shutting down httpd2: [ OK ]
Starting httpd2: [ OK ]
[root@mybox conf]#

[root@mybox conf]# cd /usr/lib/mailman/cron
[root@mybox cron]# crontab -u mailman crontab.in


This Lines were already Mentioned in my file I did not
make any changes

Configuration File for Mailman

#cat /usr/lib/mailman/Mailman/mm_cfg.py

# Put YOUR site-specific settings below this line.
DEFAULT_EMAIL_HOST = 'mybox.sriram.com'
DEFAULT_URL_HOST = 'mybox.sriram.com'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
MTA = 'Postfix'

Now start Mailman Services
/etc/rc.d/init.d/mailman start

Uses a daemon, qrunner, which must be started: (as root)

Url For Administration
http://localhost/mailman/admin/

Url for the list that you created (eg I created mailman above)

To visit the list :

http://localhost/mailman/listinfo/
http://localhost/mailman/listinfo/mailman

I will add FAQ's soon