LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-21-2008, 04:21 PM   #1
twn2
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
Need help setting up RAID 1 on existing system


Hi all. This is actually my first post here. I read all the time, but now I'm stuck. I'm a bit of a newbie so go easy on my.

I have a mailserver setup with SuSE SLES 10. I crashed a couple weeks ago and got it back up in a several days and didn't put a raid 1 on it, but now I want to. Let me know if this makes sense:

I have SDA as my primary right now. It's partitioned as sda1=swap and sda2=/. I have 2 more drives in the system getting ready for mirroring. I have sdb and sdc. I'm going to use the RAID in SLES to do this.

My plan was to use Partitioner in Yast and setup a raid 1 with sdb and sdc. Then boot off Knoppix CD and dd sda to my md0 (sdb and sdc mirrored). Then unplug sda and boot off md0. How would I copy over the boot partition?

How does this sound? If it's a pretty jacked up method, I'm open to suggestions.

Thanks,
Tom
 
Old 01-21-2008, 06:55 PM   #2
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
That would work, kinda.

One, no need to dd the whole puppy, that's just brutal on the disks:

After the array is built, and reboot at least once with the array in your already existing fstab to make certain that it assembles correctly on boot:

mount /dev/md0 /mnt/somewhere
rsync -Sav --exclude /proc --exclude /sys /* /mnt/somewhere
mkdir /mnt/somewhere/proc
mkdir /mnt/somewhere/sys

The excludes are so you don't end up copying a bunch of everchanging kernelspace goop that you don't need there anyway, you just need the mount points.

Now... make it bootable and mountable:

edit /mnt/somewhere/etc/fstab and change the entry for / from /dev/sda1 to /dev/md0

Then...

chroot /mnt/somewhere
mount -t proc proc /proc
edit /boot/grub/grub.conf to reflect the new boot and root drives and re-run grub.

The last part is where it gets hinky. I never use grub much, and I know the lilo option to write the mbr spread accross a mirror, but not the grub one. It might take more research. Of course, the easy way, is to just make a seperate /dev/sdb1 for /boot and put it in /etc/fstab so that /boot is on its own wee little partition and not part of the mirror.

Cheers,

Finegan
 
Old 01-22-2008, 12:06 AM   #3
twn2
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by finegan View Post
That would work, kinda.

One, no need to dd the whole puppy, that's just brutal on the disks:

After the array is built, and reboot at least once with the array in your already existing fstab to make certain that it assembles correctly on boot:

mount /dev/md0 /mnt/somewhere
rsync -Sav --exclude /proc --exclude /sys /* /mnt/somewhere
mkdir /mnt/somewhere/proc
mkdir /mnt/somewhere/sys

The excludes are so you don't end up copying a bunch of everchanging kernelspace goop that you don't need there anyway, you just need the mount points.

Now... make it bootable and mountable:

edit /mnt/somewhere/etc/fstab and change the entry for / from /dev/sda1 to /dev/md0

Then...

chroot /mnt/somewhere
mount -t proc proc /proc
edit /boot/grub/grub.conf to reflect the new boot and root drives and re-run grub.

The last part is where it gets hinky. I never use grub much, and I know the lilo option to write the mbr spread accross a mirror, but not the grub one. It might take more research. Of course, the easy way, is to just make a seperate /dev/sdb1 for /boot and put it in /etc/fstab so that /boot is on its own wee little partition and not part of the mirror.

Cheers,

Finegan
Thanks for the help!! I think I get it. There's no way for the main hard drive (sda) to go tits-up using the above example is there???

Also, how would I add the boot partition, on an existing system??

Thanks!!
Tom
 
  


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 do I add RAID 1 to existing system on SLES 10 twn2 Suse/Novell 0 01-12-2008 01:08 PM
Software RAID on an existing system endfx Linux - General 3 12-18-2006 02:05 PM
Adding a IDE HDD to an existing system and make a Soft-RAID Sören Schneider Linux - Hardware 1 04-08-2006 04:57 PM
setting up a dual boot with an existing XP system benjam Linux - General 3 05-18-2004 05:43 PM
add software raid-1 to existing system hoover93 Linux - Hardware 1 10-07-2003 11:52 AM


All times are GMT -5. The time now is 09:37 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration