LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-21-2007, 10:52 AM   #1
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Rep: Reputation: 0
Create a RAID-1 of the boot disk and a new disk


Hello,
I had one disk before (/dev/sda) with two partitions, one swap and one ext3 where all the files are located. Now I've added a second disk (/dev/sdb) and want to create a RAID-1 disk of the two disks (based on the current /dev/sda disk). How can I do that? I've installed mdadm but I can't figure out how to create the RAID-1 since I'm running the system on /dev/sda.

Best Regards
Oskar R
 
Old 09-21-2007, 11:23 AM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
partition your /dev/sdb similar to /dev/sda. I personally would use fdisk
Code:
fdisk /dev/sdb
Another user on here, i_grok, helped me and also mentioned that you could use the sfdisk command, but I haven't tried it. It's suppose to replicate the partitions to the other drive. For example,
Code:
sfdisk -d /dev/sda1 | sfdisk /dev/sdb1
After, create the initial /dev/md0, /dev/md1, etc...

Code:
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1
mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda2
etc...
Now sync up /dev/sdb with /dev/sda
Code:
mdadm /dev/md0 --add /dev/sdb1
mdadm /dev/md1 --add /dev/sdb2
etc...
check the progress of the syncing
Code:
cat /proc/mdstat
You can always find more information
Code:
man mdadm
I could be wrong about all this, though. I've only done the software RAID once or twice and am recalling this from memory.

You can also google up this question as there are tons of articles online that will explain this

Last edited by Micro420; 09-21-2007 at 11:45 AM.
 
Old 09-21-2007, 04:45 PM   #3
Oskare100
LQ Newbie
 
Registered: Jun 2005
Posts: 15

Original Poster
Rep: Reputation: 0
OK, I'll try that, however, I created /dev/md0 and /dev/md1 now by misstake when I tried another guide and now I can't remove them... They are (or should be) based on /dev/sdb1 and /dev/sdb2. How can I remove /dev/md0 and /dev/md1 now to be able to continue without reinstalling the system again?
 
Old 09-21-2007, 07:45 PM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
try
Code:
mdadm /dev/md0 --manage --stop 
mdadm /dev/md0 --manage --remove 
etc...

Last edited by Micro420; 09-21-2007 at 07:46 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create an initial raid 5 array with 2 disk? metabaron Linux - General 2 12-09-2006 05:54 PM
Create a boot disk a24011981 Slackware - Installation 3 06-30-2006 05:13 AM
Create A Boot Disk maxf15 Amigo 5 04-16-2005 11:39 PM
how to create a boot disk vichet Linux - Newbie 3 04-20-2002 06:12 AM
how do i create a boot disk? glock19 Linux - General 7 11-16-2001 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration