nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Setting up RAID 1 mirroring on a running remote Linux system

This is a discussion on Setting up RAID 1 mirroring on a running remote Linux system within the Getting started tutorials forums, part of the Linux Getting Started category; Howto: Setting up RAID 1 mirroring on a running remote Linux system over ssh connection Caution : Make sure you ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-20-2006, 06:40 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default Setting up RAID 1 mirroring on a running remote Linux system

Howto: Setting up RAID 1 mirroring on a running remote Linux system over ssh connection

Caution: Make sure you backup all-important data before using this tutorial. I will be not responsible for data loss

But what is a RAID 1?
A single hard drive is mirrored i.e. an exact copy is made of the original drive. Thus, it result into the increased fault tolerance and easy data recovery option for single server.

Why I am setting a RAID-1 on running system?
Old sys admin did not setup RAID -1 at the time of installation. It is true that the best and easy way to setup a RAID 1 is during installation. Simply create RAID software partition and install the system. Nevertheless, it wasn’t done during installation; so I was asked to do so…

Procedure
Setting up RAID 1 mirroring is easy on running system. Recently we ordered new dedicated hosting server. But they did not setup mirroring for 2 hard disk. My setup was as follows:
/dev/hdb (/dev/hdb1 – 40 GB)
/dev/hdc (/dev/hdc1 – 40 GB)

Each partition has been 40 GB size ext3 formatted (make sure partition id is set to Linux raid auto).

RAID tools and software was installed. It is called mdadm.

Remember first software device will be /dev/md0, second will be /dev/md1 and so on…

You need to type following command to setup /dev/md0:
Code:
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hdb1 /dev/hdc1
You can see status, health of /dev/md0 at /proc/mdstat. Type the following command:
Code:
cat /proc/mdstat
Better uses watch command to refresh it automatically:
Code:
watch cat /proc/mdstat
Format /dev/md0 as ext3 fs:
Code:
mkfs.ext3 /dev/md0
Mount /dev/md0 at /data2 directory:
Code:
mkdir /data2
mount /dev/md0 /data2
Don't forget to add /dev/md0 to /etc/fstab:
Code:
vi /etc/fstab
Append following text:
Code:
/dev/md0                /data2                       ext3    defaults        0 0
Reference:
==> Remote Conversion to Linux Software RAID-1 for Crazy Sysadmins HOWTO
http://togami.com/~warren/guides/remoteraidcrazies/
==> man mdadm

Enjoy!!!
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-20-2006, 06:59 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 4
tom is on a distinguished road
Default

gr8 work
Reply With Quote
  #3 (permalink)  
Old 06-20-2006, 11:00 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Your howto may come in handy one day for me
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #4 (permalink)  
Old 06-21-2006, 05:45 PM
Member
User
 
Join Date: Jun 2005
Posts: 78
Rep Power: 0
jerry
Default

ill try out this in sandbox as i don't wanna loss my data.

BTW nice tutorial
Reply With Quote
  #5 (permalink)  
Old 06-21-2006, 06:53 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Nice, quick, and dirty article.

Just in case any one of you using Windowz XP, see:
http://www.informit.com/articles/article.asp?p=474240
Reply With Quote
  #6 (permalink)  
Old 06-21-2006, 10:18 PM
Junior Member
User
 
Join Date: Sep 2005
Posts: 25
Rep Power: 0
charvi
Default

Thank you, this'll come in handy!
Reply With Quote
  #7 (permalink)  
Old 06-21-2006, 10:34 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Sweta,

Now you are a seasoned admin
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #8 (permalink)  
Old 06-22-2006, 01:18 AM
Junior Member
 
Join Date: Jun 2006
Posts: 1
Rep Power: 0
joetopjian
Default

Nice!

Coincidentally, I did this exact same thing over the weekend -- even down to the

Code:
watch cat /proc/mdstat
Reply With Quote
  #9 (permalink)  
Old 06-22-2006, 12:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default

yo, thanks for feedback
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #10 (permalink)  
Old 09-22-2008, 06:04 PM
Junior Member
User
 
Join Date: Mar 2007
Posts: 2
Rep Power: 0
ajeetraina
Default How to Setup UUCP?

Pls advise.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
smartd on 3ware RAID under Linux sweta Linux hardware 1 08-10-2007 08:59 PM
Ubuntu server allow tcp Mysql connection from remote system raj Databases servers 3 06-12-2007 12:06 AM
Difference between Linux RAID 0, RAID 1 and RAID 5 jerry Linux software 3 06-26-2006 07:48 PM
linux setting system-wide path Linux software 1 01-28-2006 12:19 PM
remotely running X from other system ricc Linux software 4 09-15-2005 12:19 PM


All times are GMT +5.5. The time now is 02:27 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36