Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-18-2006, 10:09 AM   #1
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Rep: Reputation: 15
Software RAID on an existing system

I already have a linux server installed and running, but it doesn't use RAID.
Is it possible to setup a software RAID 1 on the root partition without formatting everything?

Or would it be better, easier if I just bought 2 more hard drives, and setup a software raid 1 on another mount point and put important files there?

Old 12-18-2006, 10:55 AM   #2
Registered: Jul 2003
Location: Hamilton, OH
Distribution: Redhat 9, SuSE 10.1 & 10.2, Kubuntu
Posts: 173

Rep: Reputation: 30
i took one of my servers, and switched distros. I had all the junk i wanted to keep on a seperate drive, and all i had to do was add the drive to the fstab.

it appeared, but the permissions where all jacked up. I got angry and wrote a shell script to fix the permissions issues, but all and all, it worked.

It is possible to do, but my problem was with the old permissions on the drive... so, if you can work with correcting that, I think you'll be alright, provided you are talking 2 different drives... if it's one drive partitioned up, one false move and you're liable to delete everything...
Old 12-18-2006, 12:45 PM   #3
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Original Poster
Rep: Reputation: 15
Ok, but can I stick another HD into the server and fireup linux software raid so the original HD is mirrored? I'm thinking I can't becaue the drives need to be formated as "linux raid autodetect" which would destroy the data on my original drive.
Old 12-18-2006, 01:05 PM   #4
LQ Newbie
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
I have just done exactly what you are describing, i had an existing setup over 2 ide drives and added raid1 operation on a usb external drive. I did not have to reformat anything - i've tried this on my fs (ext2), ext3 shoudl be ok and reiserfs works if you do an fsck against /dev/mdX to fix up some superblock problems
i set it all up with mdadm, using the create option. First create a partition table on the blank harddrive matching the block counts for any partitions you plan on raiding. Unmount the partitions you will transform to raid then match up the partitions on the old with the new using mdadm. The only requirement is that you specify your _current_ drive first, new drive second, otherwise you will clobber your existing filesystem..

for example
mdadm --create /dev/mdX --level=1 --raid-devices=2 /dev/hdaY /dev/hdbZ

where mdX is the new raid device you will use, hda is your current one and hdb is the new one and Y & Z are corresponding partitions.

note that you should man mdadm for the options, you may want more but definately your current one must go before the new one.

once you execute the command above it may confirm that you have an existing filesystem on your current drive, just say yes...

if all goes well you can watch the progress by cating /proc/mdstat while it is replicating. Anytime during or after the replication you can just mount /dev/mdX and it will give you access to the files. again, read up on man mdadm as it has a lot of nice toys to get you exactly where you want to be.

as always it is a good idea to back up your data before doing anything like this...



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Software RAID 1 from Existing Boot Drive johnwyles Linux - General 1 08-05-2005 11:42 AM
How do I add a spare to existing software RAID 5 ? philforrest Linux - Software 1 12-28-2003 09:33 PM
New Software Raid - Want to use as existing /home/ ... Migration??? How??? trekk Linux - Software 5 11-03-2003 10:32 AM
add software raid-1 to existing system hoover93 Linux - Hardware 1 10-07-2003 10:52 AM
Software RAID 1 setup w/ existing ext2fs partition system Linux - General 3 01-26-2002 11:07 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:58 PM.

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