July 8, 2010

RAID: Using Multiple Hard Drives for Performance and Reliability

Back in the late 1980's and early 1990's, computer information servers were encountering a dramatic increase in the amount of data they needed to serve and store. Storage technologies were getting very expensive to place a large number of high capacity hard drives in the servers. A solution was needed and thus RAID was born.

So what exactly is RAID? First of all, the acronym stands for Redundant Array of Inexpensive Disks. It was a system developed whereby a large number of low cost hard drives could be linked together to form a single large capacity storage device that offered superior performance, storage capacity and reliability over older storage solutions. It has been widely used and deployed method for storage in the enterprise and server markets, but over the past 5 years has become much more common in end user systems.

You Can follow the below for RAID Calculator to find the disk space.

http://www.ibeast.com/content/tools/RaidCalc/RaidCalc.asp


RAID 0

The lowest designated level of RAID, level 0, is actually not a valid type of RAID. It was given the designation of level 0 because it fails to provide any level of redundancy for the data stored in the array. Thus, if one of the drives fails, all the data is damaged.

RAID 0 uses a method called striping. Striping takes a single chunk of data like a graphic image, and spreads that data across multiple drives. The advantage that striping has is in improved performance. Twice the amount of data can be written in a given time frame to the two drives compared to that same data being written to a single drive.

Below is an example of how data is written in a RAID 0 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2
Block 1 1 2
Block 2 3 4
Block 3 5 6

Thus, if the 6 blocks of data above constitute a single data file, it can be read and written to the drive much faster than if it were on a single drive. Each drive working in parallel could read only 3 physical blocks while it would take a single drive twice as long because it has to read 6 physical blocks. The drawback of course is that if one drive fails, the data is no longer functional. All 6 data blocks are needed for the file, but only three are accessible.

Advantages:

* Increased storage performance
* No loss in data capacity

Disadvantages:

* No redundancy of data

RAID 1

RAID version 1 was the first real implementation of RAID. It provides a simple form of redundancy for data through a process called mirroring. This form typically requires two individual drives of similar capacity. One drive is the active drive and the secondary drive is the mirror. When data is written to the active drive, the same data is written to the mirror drive.

The following is an example of how the data is written in a RAID 1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2
Block 1 1 1
Block 2 2 2
Block 3 3 3

This provides a full level of redundancy for the data on the system. If one of the drives fails, the other drive still has all the data that existed in the system. The big drawback of course is that the capacity of the RAID will only be as big as the smallest of the two drives, effectively halving the amount of storage capacity if the two drives were used independently.

Advantages:

* Provides full redundancy of data

Disadvantages

* Storage capacity is only as large as the smallest drive
* No performance increases
* Some downtime to change active drive during a failure

RAID 0+1

This is a hybrid form of RAID that some manufacturers have implemented to try and give the advantages of each of the two versions combined. Typically this can only be done on a system with a minimum of 4 hard drives. It then combines the methods of mirroring and striping to provide the performance and redundancy. The first set of drives will be active and have the data striped across them while the second set of drives will be a mirror of the data on the first two.

Below is an example of how data is written in a RAID 0+1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2 Drive 3 Drive 4
Block 1 1 2 1 2
Block 2 3 4 3 4
Block 3 5 6 5 6

In this case, the data blocks will be striped across the drives within each of the two sets while it is mirrors between the sets. This gives the increased performance of RAID 0 because it takes the drive half the time to write the data compared to a single drive and it provides redundancy. The major drawback of course is the cost. This implementation requires a minimum of 4 hard drives.

Advantages:

* Increased performance
* Data is fully redundant

Disadvantages:

* Large number of drives required
* Effective data capacity is halved

RAID 10 or 1+0

RAID 10 is effectively a similar version to RAID 0+1. Rather than striping data between the disk sets and then mirroring them, the first two drives in the set are a mirrored together. The second two drives form another set of disks that is are mirror of one another but store striped data with the first pair. This is a form of nested RAID setup. Drives 1 and 2 are a RAID 1 mirror and drives 3 and 4 are also a mirror. These two sets are then setup as stripped array.

Below is an example of how data is written in a RAID 10 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 Drive 2 Drive 3 Drive 4
Block 1 1 1 2 2
Block 2 3 3 4 4
Block 3 5 5 6 6

Just like the RAID 0+1 setup, RAID 10 requires a minimum of four hard drives to function. Performance is pretty much the same but the data is a bit more protected than the RAID 0+1 setup.

Advantages:

* Increased performance
* Data is fully redundant

Disadvantages:

* Large number of drives required
* Effective data capacity is halved

RAID 5

This is the most powerful form of RAID that can be found in a desktop computer system. Typically it requires the form of a hardware controller card to manage the array, but some desktop operating systems can create these via software. This method uses a form of striping with parity to maintain data redundancy. A minimum of three drives is required to build a RAID 5 array and they should be identical drives for the best performance.

Parity is essentially a form of binary math that compares two blocks a data and forms a third data block based upon the first two. The easiest way to explain it is even and odd. If the sum of the two data blocks is even, then the parity bit is even. If the sum of the two data blocks is odd, the parity bit is odd. So 0+0 and 1+1 both equal 0 while 0+1 or 1+0 will equal 1. Based on this form of binary math, a failure in one drive in the array will allow the parity bit to reconstruct the data when the drive is replaced.

With that information in mind, here is an example of how a RAID 5 array would work. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block. A "P" indicates a parity bit for two blocks of data.
Drive 1 Drive 2 Drive 3
Block 1 1 2 P
Block 2 3 P 4
Block 3 P 5 6

The parity bit shifts between the drives to increase the performance and reliability of the data. The drive array will still have increased performance over a single drive because the multiple drives can write the data faster than a single drive. The data is also fully redundant because of the parity bits. In the case of drive 2 failing, the data can be rebuilt based on the data and parity bits on the two remaining drives. Data capacity is reduced due to the parity data blocks. In practice the capacity of the array is based on the following equation where n is the number of drives and z is the capacity:

(n-1)z = Array Capacity

In the case of three 500 gigabyte hard drives, the total capacity would be (3-1)x500GB or 1000 gigabytes.

Hardware RAID 5 implementations can also have a function called hot swap. This allows for drives to be replaced while the array is still functioning to either increase the drives capacity or to replace a damaged drive. The drive controller then takes time while the array is running to rebuild the data array across the drives. This is a valuable feature for systems that require 24x7 operation.

Advantages:

* Increased storage array performance
* Full data redundancy
* Ability to run 24x7 with hot swap

Disadvantages

* High costs to implement
* Performance degrades during rebuilding

Drive Selection

For the best results, all hard drives in the array should be the same brand and model. This means that all of the hard drives will have the same capacity and performance levels. It is not a requirement that the drives be matched, but mismatching the drives can actually hurt the RAID array.

The capacity of the RAID array will depend upon the method implemented. In the case of RAID 0, the striping can only be done across an equal amount of space on the two drives. As a result, if an 80GB and 100GB drive are used to make the array, the final capacity of the array would only be 160GB. Similarly, in RAID 1 the drives can only mirror data equal to the smallest size. Thus based on the two drives mentioned before, the final data size would only be 80GB. RAID 5 is a bit more complicated because of the formula mentioned before. Once again the smallest capacity would be used. So if a 80GB, 100 GB and 120GB drive were used to make a RAID 5 array, the final capacity would be 160GB of data.

You can refer below links for more details.

http://compreviews.about.com/od/storage/l/aaRAIDPage1.htm
http://www.prepressure.com/library/technology/raid

April 2, 2010

Windows 7 rebooting Issue

Refer http://www.coolbuster.net/2010/03/stop-windows-7-rc-expiry.html for more details.

March 29, 2010

To enable exe files in Linux

Installing Wine in Linux CentOS

Wine enables Linux, Mac, FreeBSD, and Solaris users to run Windows applications without a copy of Microsoft Windows. Wine is free software under constant development. You can find the details from the url: http://www.winehq.com/

Installation of wine 1.1.39 in CentOS:

You can download the wine 1.1.39 from the url: http://www.winehq.org/announce/1.1.39 or http://sourceforge.net/projects/wine/files/Source/

Before installing wine make sure you have done following steps so that wine dependencies are already installed in CentOS Server.

# yum upgrade (Its not necessary)

# Download flex 2.5.33 from the url: http://rpm.pbone.net/index.php3/stat/4/idpl/9770752/com/flex-2.5.33-11.fc8.i386.rpm.html
and run

#rpm –ivh flex-2.5.33-11.fc8.i386.rpm --force

# yum install XFree86-devel arts-devel audiofile-devel bison cups-devel cyrus-sasl-devel e2fsprogs-devel esound-devel expat-devel fontconfig-devel freetype-devel gcc glib2-devel gphoto2-devel isdn4k-utils-devel krb5-devel libao-devel libjpeg-devel libmng-devel libogg-devel libpng-devel libusb-devel libvorbis-devel libxml-devel libxml2-devel libxslt-devel ncurses-devel openldap-devel openssl-devel pkgconfig qt-devel sane-backends-devel zlib-devel rpm-build


Once you've installed the build dependencies you need, you're ready to compile the package. In the terminal window, after having navigated to the Wine source tree, run the following commands:

# ./configure

# make depend

# make

# make install



To uninstall Wine from source, once again navigate to the same source folder that you used to install Wine using the terminal. Then, run the following command:

# make uninstall


CodeWeavers offers paid support for Wine. You can find the details from the url: http://www.codeweavers.com/

March 11, 2010

GDM and XDMCP configuration for remote graphical Linux desktop access

You can follow the link: http://www.yolinux.com/TUTORIALS/GDM_XDMCP.html

Disable Firefox browser in Linux:

To Disable Firefox browser in Linux or Restricting web access using the Firefox browser: You can follow below commands:

For example, if we need to block Firefox for an user “rad” you can use the command below:

root@server# setfacl -m u:rad:x /usr/bin/firefox

To unblock it, you can use following command:

root@server# setfacl -x u:rad /usr/bin/firefox

Moving Mails from Windows Outlook Express to Thunderbird of Linux

Step # 1: Import mails from Outlook using Thunderbird in Windows.
* Download thunderbird for Windows XP from http://www.mozillamessaging.com/en-US/thunderbird/
* Install Thunderbird
* Start Mozilla Thunderbird
* Do not setup Thunderbird as your default email client.
* Since this is your first run, it will prompt you to import mail and other settings.
* At Import dialog box, select Mail > Next
* Select Outlook > Next
* Within few minutes it will migrate all emails from Outlook to Thunderbird. Click Finish and shutdown Thunderbird application.

Step # 2: Transfer Thunderbird mail to USB
First, you need to find out your profile folder under Thunderbird application (you can also use Windows Explore to find out Thunderbird profile folder):.
Click on Start > Run > Type the command “cmd”
And hit [Enter] key
Type the following commands to locate Profile folder:
C:> cd %APPDATA%\\Thunderbird
C:> cd Profiles
Now locate directory called "Local Folders". Again use CD command to go to Local Folders:
C:> cd "Local Folders"
Now Locate required directory and copy all files to USB pen or use network connection to copy files to your Linux home-directory (~/.mozilla-thunderbird)

Step #3: Import mail to Linux Thunderbird.
Copy all files from USB to mail directory of thunderbird, now you can open mail using Linux thunderbird client. You can find the mail directory in the server settings of particular mail account.

Installation of Mozilla thunderbird mail client in Linux:

Download Thunderbird from http://www.mozillamessaging.com/en-US/thunderbird/ to your Linux desktop

Let us say you would like to install thunderbird in your own home directory called /home/rad/

Copy your downloaded file to /home/rad/ and untar it:
$ cp /home/tom/Desktop/thunderbird-2.0.0.0.tar.gz .
$ tar -zxvf thunderbird-2.0.0.0.tar.gz
Now software was installed. To start Thunderbird mail client, enter:
$ cd thunderbird
$ ./thunderbird

To create thunderbird icon on desktop.

Right click on your Linux desktop
Select Create Launcher
Fill the details as follows:
* Set name to : Thunderbird
* Set command to : browse "thunderbird" inside the directory Thunderbird.
* Set comment to : My Email Client
* Hit OK to create an ICON