LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Need help setting up RAID 1 on existing system (https://www.linuxquestions.org/questions/linux-hardware-18/need-help-setting-up-raid-1-on-existing-system-615274/)

twn2 01-21-2008 03:21 PM

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

finegan 01-21-2008 05:55 PM

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

twn2 01-21-2008 11:06 PM

Quote:

Originally Posted by finegan (Post 3030721)
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


All times are GMT -5. The time now is 01:05 AM.