Archive for September, 2009

RAID Concepts and Configuration – RAID 0, RAID 1, RAID 5

Friday, September 25th, 2009

RAID  – Redundant Array Of Independent Disks

The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array to accomplish performance or redundancy goals not attainable with one large and expensive drive. This array of drives will appear to the computer as a single logical storage unit or drive.

Concept of RAID

Concept of RAID

The current RAID drivers in Linux supports the following levels:

Linear mode 

 a)  Two or more disks are combined into one physical device. The disks are “appended” to each other, so writing linearly to the RAID device will fill up disk 0 first, then disk 1 and so on.

 b) The disks does not have to be of the same size. In fact, size doesn’t matter at all here :)
 There is no redundancy in this level. If one disk crashes you will most probably lose all your data. You can however be lucky to recover some data, since the filesystem will just be missing one large consecutive chunk of data.

c) The read and write performance will not increase for single reads/writes. But if several users use the device, you may be lucky that one user effectively is using the first disk, and the other user is accessing files which happen to reside on the second disk. If that happens, you will see a performance gain.

Linear Mode RAID Configuration

Ok, so you have two or more partitions which are not necessarily the same size (but of course can be), which you want to append to each other.

Set up the /etc/raidtab file to describe your setup. I set up a raidtab for two disks in linear mode, and the file looked like this:

raiddev /dev/md0
        raid-level      linear
        nr-raid-disks   2
        chunk-size      32
        persistent-superblock 1
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
Spare-disks are not supported here. If a disk dies, the array dies with it. There’s no information to put on a spare disk.

You’re probably wondering why we specify a chunk-size here when linear mode just appends the disks into one large array with no parallelism. Well, you’re completely right, it’s odd. Just put in some chunk size and don’t worry about this any more.

Ok, let’s create the array. Run the command
  mkraid /dev/md0

This will initialize your array, write the persistent superblocks, and start the array.

If you are using mdadm, a single command like
   mdadm –create –verbose /dev/md0 –level=linear –raid-devices=2 /dev/sdb6 /dev/sdc5
should create the array. The parameters talk for themselves. The output might look like this
  mdadm: chunk size defaults to 64K
  mdadm: array /dev/md0 started.

Have a look in /proc/mdstat. You should see that the array is running.

Now, you can create a filesystem, just like you would on any other device, mount it, include it in your /etc/fstab and so on.

RAID-0 (RAID zero)

a) Also called “stripe” mode. The devices should (but need not) have the same size. Operations on the array will be split on the devices; for example, a large write could be split up as 4 kB to disk 0, 4 kB to disk 1, 4 kB to disk 2, then 4 kB to disk 0 again, and so on. If one device is much larger than the other devices, that extra space is still utilized in the RAID device, but you will be accessing this larger disk alone, during writes in the high end of your RAID device. This of course hurts performance.

b)  Like linear, there is no redundancy in this level either. Unlike linear mode, you will not be able to rescue any data if a drive fails. If you remove a drive from a RAID-0 set, the RAID device will not just miss one consecutive block of data, it will be filled with small holes all over the device. e2fsck or other filesystem recovery tools will probably not be able to recover much from such a device.

c)  The read and write performance will increase, because reads and writes are done in parallel on the devices. This is usually the main reason for running RAID-0. If the busses to the disks are fast enough, you can get very close to N*P MB/sec.

RAID 0 Configuration

You have two or more devices, of approximately the same size, and you want to combine their storage capacity and also combine their performance by accessing them in parallel.

Set up the /etc/raidtab file to describe your configuration. An example raidtab looks like:
raiddev /dev/md0
        raid-level      0
        nr-raid-disks   2
        persistent-superblock 1
        chunk-size     4
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
Like in Linear mode, spare disks are not supported here either. RAID-0 has no redundancy, so when a disk dies, the array goes with it.

Again, you just run
  mkraid /dev/md0
to initialize the array. This should initialize the superblocks and start the raid device. Have a look in /proc/mdstat to see what’s going on. You should see that your device is now running.

/dev/md0 is now ready to be formatted, mounted, used and abused.

RAID – 1

a)  This is the first mode which actually has redundancy. RAID-1 can be used on two or more disks with zero or more spare-disks. This mode maintains an exact mirror of the information on one disk on the other disk(s). Of Course, the disks must be of equal size. If one disk is larger than another, your RAID device will be the size of the smallest disk.

b)  If up to N-1 disks are removed (or crashes), all data are still intact. If there are spare disks available, and if the system (eg. SCSI drivers or IDE chipset etc.) survived the crash, reconstruction of the mirror will immediately begin on one of the spare disks, after detection of the drive fault.

c)  Write performance is often worse than on a single device, because identical copies of the data written must be sent to every disk in the array. With large RAID-1 arrays this can be a real problem, as you may saturate the PCI bus with these extra copies.
This is in fact one of the very few places where Hardware RAID solutions can have an edge over Software solutions – if you use a hardware RAID card, the extra write copies of the data will not have to go over the PCI bus, since it is the RAID controller that will generate the extra copy.
Read performance is good, especially if you have multiple readers or seek-intensive workloads.
The RAID code employs a rather good read-balancing algorithm, that will simply let the disk whose heads are closest to the wanted disk position perform the read operation.
Since seek operations are relatively expensive on modern disks (a seek time of 6 ms equals a read of 123 kB at 20 MB/sec), picking the disk that will have the shortest seek time does actually give a noticeable performance improvement.

Configuration of RAID 1

Configuration of RAID 1

RAID 1 Configuration

You have two devices of approximately same size, and you want the two to be mirrors of each other. Eventually you have more devices, which you want to keep as stand-by spare-disks, that will automatically become a part of the mirror if one of the active devices break.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
If you have spare disks, you can add them to the end of the device specification like
        device          /dev/sdd5
        spare-disk      0
Remember to set the nr-spare-disks entry correspondingly.

Ok, now we’re all set to start initializing the RAID. The mirror must be constructed, eg. the contents (however unimportant now, since the device is still not formatted) of the two devices must be synchronized.

Issue the
  mkraid /dev/md0
command to begin the mirror initialization.

Check out the /proc/mdstat file. It should tell you that the /dev/md0 device has been started, that the mirror is being reconstructed, and an ETA of the completion of the reconstruction.

Reconstruction is done using idle I/O bandwidth. So, your system should still be fairly responsive, although your disk LEDs should be glowing nicely.

The reconstruction process is transparent, so you can actually use the device even though the mirror is currently under reconstruction.

Try formatting the device, while the reconstruction is running. It will work. Also you can mount it and use it while reconstruction is running. Of Course, if the wrong disk breaks while the reconstruction is running, you’re out of luck.

RAID-4

a)  This RAID level is not used very often. It can be used on three or more disks. Instead of completely mirroring the information, it keeps parity information on one drive, and writes data to the other disks in a RAID-0 like way. Because one disk is reserved for parity information, the size of the array will be (N-1)*S, where S is the size of the smallest drive in the array. As in RAID-1, the disks should either be of equal size, or you will just have to accept that the S in the (N-1)*S formula above will be the size of the smallest drive in the array.

b)  If one drive fails, the parity information can be used to reconstruct all data. If two drives fail, all data is lost.

c)  The reason this level is not more frequently used, is because the parity information is kept on one drive. This information must be updated every time one of the other disks are written to. Thus, the parity disk will become a bottleneck, if it is not a lot faster than the other disks. However, if you just happen to have a lot of slow disks and a very fast one, this RAID level can be very useful.

RAID 4 Configuration

You have three or more devices of roughly the same size, one device is significantly faster than the other devices, and you want to combine them all into one larger device, still maintaining some redundancy information. Eventually you have a number of devices you wish to use as spare-disks.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      4
        nr-raid-disks   4
        nr-spare-disks  0
        persistent-superblock 1
        chunk-size      32
        device          /dev/sdb1
        raid-disk       0
        device          /dev/sdc1
        raid-disk       1
        device          /dev/sdd1
        raid-disk       2
        device          /dev/sde1
        raid-disk       3
If we had any spare disks, they would be inserted in a similar way, following the raid-disk specifications;
        device         /dev/sdf1
        spare-disk     0
as usual.

Your array can be initialized with the
   mkraid /dev/md0
command as usual.

You should see the section on special options for mke2fs before formatting the device.

RAID-5

a)  This is perhaps the most useful RAID mode when one wishes to combine a larger number of physical disks, and still maintain some redundancy. RAID-5 can be used on three or more disks, with zero or more spare-disks. The resulting RAID-5 device size will be (N-1)*S, just like RAID-4. The big difference between RAID-5 and -4 is, that the parity information is distributed evenly among the participating drives, avoiding the bottleneck problem in RAID-4.

b)  If one of the disks fail, all data are still intact, thanks to the parity information. If spare disks are available, reconstruction will begin immediately after the device failure. If two disks fail simultaneously, all data are lost. RAID-5 can survive one disk failure, but not two or more.

c)  Both read and write performance usually increase, but can be hard to predict how much. Reads are similar to RAID-0 reads, writes can be either rather expensive (requiring read-in prior to write, in order to be able to calculate the correct parity information), or similar to RAID-1 writes. The write efficiency depends heavily on the amount of memory in the machine, and the usage pattern of the array. Heavily scattered writes are bound to be more expensive.

RAID 5 Disks

RAID 5 Disks

RAID 5 Configuration

You have three or more devices of roughly the same size, you want to combine them into a larger device, but still to maintain a degree of redundancy for data safety. Eventually you have a number of devices to use as spare-disks, that will not take part in the array before another device fails.

If you use N devices where the smallest has size S, the size of the entire array will be (N-1)*S. This “missing” space is used for parity (redundancy) information. Thus, if any disk fails, all data stay intact. But if two disks fail, all data is lost.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      5
        nr-raid-disks   7
        nr-spare-disks  0
        persistent-superblock 1
        parity-algorithm        left-symmetric
        chunk-size      32
        device          /dev/sda3
        raid-disk       0
        device          /dev/sdb1
        raid-disk       1
        device          /dev/sdc1
        raid-disk       2
        device          /dev/sdd1
        raid-disk       3
        device          /dev/sde1
        raid-disk       4
        device          /dev/sdf1
        raid-disk       5
        device          /dev/sdg1
        raid-disk       6
If we had any spare disks, they would be inserted in a similar way, following the raid-disk specifications;
        device         /dev/sdh1
        spare-disk     0
And so on.

A chunk size of 32 kB is a good default for many general purpose filesystems of this size. The array on which the above raidtab is used, is a 7 times 6 GB = 36 GB (remember the (n-1)*s = (7-1)*6 = 36) device. It holds an ext2 filesystem with a 4 kB block size. You could go higher with both array chunk-size and filesystem block-size if your filesystem is either much larger, or just holds very large files.

Ok, enough talking. You set up the /etc/raidtab, so let’s see if it works. Run the
  mkraid /dev/md0
command, and see what happens. Hopefully your disks start working like mad, as they begin the reconstruction of your array. Have a look in /proc/mdstat to see what’s going on.

If the device was successfully created, the reconstruction process has now begun. Your array is not consistent until this reconstruction phase has completed. However, the array is fully functional (except for the handling of device failures of course), and you can format it and use it even while it is reconstructing.

See the section on special options for mke2fs before formatting the array.

Ok, now when you have your RAID device running, you can always stop it or re-start it using the
  raidstop /dev/md0
or
  raidstart /dev/md0
commands.

With mdadm you can stop the device using
  mdadm -S /dev/md0
and re-start it with
  mdadm -R /dev/md0
Instead of putting these into init-files and rebooting a zillion times to make that work, read on, and get autodetection running.

Source: tldp.org

Tell a friend

Biploar Disorder

Thursday, September 24th, 2009

What is Bipolar Disorder ?

Bipolar Disorder is a state of manic depression. This is also called as bipolar affective disorder.

This is a brain disorder that causes unusual shifts in mood, energy, activity levels, and the ability to carry out day-to-day tasks. If this disease is left untreated it may lead to suicide.

Bipolar disorder starts to develop in a individual’s late teens or early adult years. At least half of all cases start before age 25. Some people have their first symptoms during childhood, while others may develop symptoms late in life. 

 

Biploar-Depression

Biploar-Depression

 

Symptoms of Bipolar Disorder

The symptoms include most of the mental characteristics. This may look normal at the beginning. It will take a longer time to diagnose the disease. This disease accompanies two phases.

  1. Manic Phase

  2. Depressive Phase 

 

 

Symptoms-of-bipolar disorder

Symptoms-of-bipolar disorder

 

Symptoms of Depressive Phase

Sadness

Hopelessness

Suicidal thoughts or behavior

Guilt

Appetite problems

Loss of interest in daily activities

Symptoms of Manic Phase

Extreme optimism

Poor judgment

Rapid speech

Increased drive to perform or achieve goals

Tendency to be easily distracted

Decreased need for sleep

Types of Bipolar Disorder

The Bipolar disorder is classified into 3 important types. Utmost 4 types. They are

    1. Bipolar I disorder – The person must had at least one manic episode with or without previous episodes of depression.

    2. Bipolar II disorder – The person should have get affected by at least one episode of depression and at least one hypomanic episode.

Hypomanic Episode: This is similar to manic depression but not severe lasts only for few days.

This results in irritability in mood, some changes in character, but it will not affect the normal day t to day activities.

            3. Cyclothymia -  This is a very mild bipolar disorder. This has high and low mood swings. But not much s severe as in the case of manic depression.

Bipolar-Moods

Bipolar-Moods

Causes of Bipolar Disorder

It is not possible to point out specific cause for this. The reasons may include the daily living environment or from the persons we have relationship with.

Biochemical factors: This is also due to the unexpected physical changes in Brain. There are brain chemicals called Neurotransmitters. These neurotransmitters are tied to mood. Scientists believe these chemicals also can cause this disorder.

Genes: Bipolar disorder may also happen due to the heredity problems by the transfer of genes to the offspring’s. So it Is a genetic disorder too.

Environment: Environment also is thought to play a causal role in some way. Environmental causes may include problems with self-esteem, significant loss or high stress.

Causes-of-bipolar-disorder

Causes-of-bipolar-disorder

Preventing Bipolar disorder

There is no proper way to prevent this disease. One should take care of his mental health. Treatment in earlier stage of symptoms will reduce the risk of getting manic depression.

Treatment for Bipolar Disorder

Bipolar disorder normally requires life long treatment. Even in the course of the treatment you may feel good. But it is still recommended to continue the treatment.

Medications for Bipolar Disorder

Medications are the important treatment for Bipolar disorder. Medications for Bipolar disorder can cause serious side effects. But the side effects are not in the majority case. They are observed rarely.

Mood stabilizers

Lithium (Eskalith, Lithobid) is used as major mood stabilizer in the treatment. This help in keeping the mood in

control so that it will not swing between depression and mania. Consulting your doctor is recommended before taking medication and continuing it.

Anti-seizure medications

Medicines, such as valproic acid (Depakene), divalproex (Depakote) and lamotrigine (Lamictal), are widely used as mood regulators. These are also called as anticonvulsants.

Antidepressants

Use of antidepressants in bipolar disorder, although once common, is now controversial.Cognitive behavioral therapy

Psychotherapy for Bipolar Disorder

The focus of cognitive behavioral therapy is identifying unhealthy, negative beliefs and behaviors and replacing them with healthy, positive ones.

Family therapy

Family therapy involves you and your family members. Family therapy can help identify and reduce stress within your family. It can help your family improve its communication style and problem-solving skills and resolve conflicts.

Group therapy

Group therapy provides a forum to communicate with and learn from others in a similar situation. It may also help build better relationship skills.

Regards,
R.Gopinath

Tell a friend

Who is God, Where is God,Finding God

Thursday, September 17th, 2009

Hey visitors, thanks for your continuous support for Neuronring.com !!

Who is God ?

Are you really getting angry on me when seeing this topic ! Yes i know the reason for your rage.
It is the age of the earth where our fellow humans indulge in activities of  “Showing God, Talking with God, Mediator of God, I am the God… etc.,” lol.. ha.. ha.. ha… :-)

So don’t worry i am not going to burn all your beliefs. I am just giving my views without disturbing your spiritual beliefs.

Picture of God

Picture of God ?

Different Names of GOD

Well, God is so called using different names arround the world such as Allah, Jesus, Shiva, Bhagwan etc., But he is “ONE”.

Let me explain this using a simple example.

Assume you are a father and you have 4 children. How they will call you.

Kid 1 calls you Papa, Kid 2 calls you as Daddy, Kid 3 calls you lovely as Pops. But you are the same person right? Now i cant say that “Like the same way God is ONE” because you will not agrees with me. But it is my faith.

People from every Religion believe in God  and named him according to their forefathers and holy books and preachings. O.K. lets stop discussing about religious beliefs and concentrate on our business.

Finding God….

Waiting for a revolutionary answer ? Stop your imaginations and “Look at your Palm“. Are there numerous long and short lines running through the palm and colliding with each other? What  are they, we call them as hand prints and finger prints.

In Search of God

In Search of God

How come it is not similar to any two persons in the earth. How did they came ? How many combinations of finger prints possible from the day human race evolved ? Who sketched up this finger print project on Humans. It is a “Super Power” (may be nature). We call it (him) as GOD.

Amazing finger prints

Amazing finger prints

Where is God ?

Are you very bored by reading series of questions ? (Ah… infact this is also a question :-(   ) But the only way you can realise your own and God is  by asking questions to yourself, continuous questions.

Athesits say “GOD IS NOWHERE” but i redefine the phrase “GOD IS NOW HERE”.  Yes, God (no need to call him as ‘God’ , just a master of everyting)  is everywhere. You need proof ?

God is in the form of Seeds

Did u observe seeds ? Do you think they have life ? Definitely,May be. Until they are buried inside the soil they don’t have life. Once the water is supplied and soil gives all the nutrition BOOM !!!!! what happened ?????

God inside seeds ?

God inside seeds ?

The seed is now a Child Plant (of course  a living organism !!!!)… gradually into a giagantic tree…. Great formula of nature. But who is the programmer?

God living in plants ?

God living in plants ?

The Human Brain Program

We are proud to say as Human Beings, we have that much of excellent knowledge. But the knowledge is absolutely from The Brain (just 1. 3 kg weighing part of the body). You cant refuse this.

Responsibilities of Brain

Responsibilities of Brain

 Click here for larger view

Why does this amazing, extraordinary, excellent human scientsts still not able to give a sketch or map about the complete Brain function. So who programmed our brain ?

We got defeated !! Find the programmer of The Human Brain.

Exciting  DNA code

Do you know that each cell in our body is programmed in advance with perfect calculation. Like in Computers they operate using programs written in “Binary Codes”.  010001110100011

Binary codes in computer

Binary codes in computer

The human body functions with same codes in DNA “CGTGTGACTCGCTCCTGAT” and so on.
A- Adenine, T – Thymine,  G – Guanine and C- Cytosine . If even  a single letter is mislocated the whole functionality of body will be degraded.

DNA code in every cell of human body

DNA code in every cell of human body

Do you think this perfect system is designed without a master ? It came just like jumping from sky or popped out from soil?

So God is EVERYWHERE. I am stressing again you need not call it/him as God. Mean it in your own way.

Finding God

You are now ready to shoot out questions on me. Yes, it is absolutely your turn. You are going to ask  “If God is such a person, why can’t we see him, feel him?”. Tough question but appreciable.

There certain things in the world which can be enjoyed only by selected sense organs.

 For example If you eat Chocolate, its tatse and sweetness can be felt only by tongue by tasting it. You cannot come ask me to show you how the taste of chocolate will be. It should be enjoyed by you.

NOT SATISFIED WITH THE EXPLANATION ? If so write to me: gopi@neuronring.com. I can solve your doubts.

Feeling GOD

Feeling GOD

Steps to feel Divine power.

1. Find a calm and pleasent place in your surrounding and sit straight.
2. Close your eyes (don’t sleep)
3. Listen to your heart beat.
4. Listen to your respiration.
5. Listen to the taste buds in your tongue.
6. Detach your concentration from the outside world.

Thats it you are now in the perfect track of feeling the power within  you.

…….. to be continued..

Regards,
R.Gopinath

If you like this page. Tell  to your friend :-)

Tell a friend

IPC 97 – Indian Penal Code 97

Thursday, September 17th, 2009

IPC Section Number: 97

IPC Section Name: Right of private defence of the body and of property

Explanation

Every person has a right, subject to the restrictions contained in section 99, to defend  himself.

Firstly – His own body, and  the body of any other person, against any offence affecting the human body.

 Secondly – The property, whether movable  or immovable, of himself or of any  other person, against any act which is an offence falling under the  definition of theft, robbery, mischief or criminal trespass, or which is an attempt to commit theft, robbery, mischief or criminal trespass.

Tell a friend