How To Configure Swap Partition Over Raid-1 In Linux Rhel 4&5

In This Tutorial We Are Going To Learn How To Configure Swap Partition Over Raid-1 It IS Very Easy To configure Just Follow These Simple Steps

Step-1 Firstly We Have To Create The Partition 2 Partition In /dev/sda For Creating The Raid-1 Then We HAve To create The Swap partition Over The Raid-1

First Check This Diagram

Here Is The Command Of Creating The Partition 

fdisk -l
fdisk /dev/sda
n {for New Partition}
Select Partition 2
t {For Change Partition}
fd {For Raid Partition}
p {For Check Partition Is created Or Not}
w {For Save}
Partprobe /Dev/Sda {For Refresh}

fdisk -l
fdisk /dev/sda
n {for New Partition}
Select Partition 3
t {For Change Partition}
fd {For Raid Partition}
p {For Check Partition Is created Or Not}
w {For Save}
Partprobe /Dev/Sda {For Refresh}

Step-2 Now We Have To Create The Raid-1 By Using This Partition

#mdadm –create/dev/md0 –level=1–raid-devices=2 /dev/sda2 /dev/sda3 
#mdadm –detail /dev/md0 {For Check Raid Is Created Or Not}
 

Now Oue Portition Of Creating The Raid Is Complete Now We Have To Create The Raid Partition Over The Raid

Step-3 Here Is The Command Of Creating The Swap Partition Over Raid-1

#mkswap /dev/md0
#swapon /dev/md0

Now We complete All The task Of Creating The Swap Partition Over Raid-1

Now How To delete Them

Step-4 Now We Delete The Swap Partition Then We Have To Delete The Raid-1

#swapoff /dev/md0

Step-5 Now The Portition Of Deleting The raid-1 

Here Is The Command Of Deleting The Raid-1

#mdadm –detail /dev/md0
#mdadm –stop /dev/md0
#mdadm –remove /dev/md0

Step-6 Now We Removed The Raid Now We Have To Delete The Partition 

Here Is The Command Of Deleting The Partition

fdisk /dev/sda
d {For Del The Partition}
Select Partition 2
p {For Check Partition Is Del Or Not}
w {For Save
Partprobe /Dev/Sdb {For Refresh}

fdisk /dev/sda
d {For Del The Partition}
Select Partition 3
p {For Check Partition Is Del Or Not}
w {For Save}
Partprobe /Dev/Sdb {For Refresh}

This Is All How We Create Swap Partition Over Raid-1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s