Software RAID1 on SuSE Linux 9.2...How the heck is this done?

Hello.

I currently have the following on my IBM xSeries 306:

Two 80 GIG SATA drives

OS: SuSE 9.2 Pro

I am trying to figure out how the heck I can mirror these drives (80 GIG to 80 GIG). The Suse 9.2 Administrators Book does not help in the least (very vague).
If someone could please point me in the right direction I would much appreciate it! When it comes to software RAID 1 Windows is sooo much easier!
supercell29Asked:
Who is Participating?
 
DonConsolioConnect With a Mentor Commented:
if you are not sure you can just make one large root partition
0
 
DonConsolioCommented:
in Yast2 go to System->Partition
press the "RAID" button
0
 
supercell29Author Commented:
I created the two /dev/md0 partitions and mirrored them, however I cannot mount / nor swap within these partitions. The only way to create the / and swap mounts in Linux RAID would be by separately creating them outside the /dev/md0 partitions which, to me, makes no sense whatsoever. Logic would say that / and swap would be created within the md0 mounts in order for them to be mirrored.

Here is what I have natively from CD installation (w/o RAID1):

                                                                                                 mount         start     end
/dev/sda     74.5 GB     6Y080MO                                                                     0         9729

/dev/sda1     1.0 GB     F Linux swap                                              swap           0         130

/dev/sda2    73.5 GB    F Linux native 9    F Linux Native (Reiser)      /                 131      9728


----------------------


                                                                                                 mount         start     end
/dev/sdb     74.5 GB     6Y080MO                                                                     0         9729

/dev/sdb1     1.0 GB     F Linux swap                                              swap           0         130

/dev/sdb2    73.5 GB    F Linux native 9    F Linux Native (Reiser)                        131      9728


My attempt with RAID1:


                                                                                                 mount         start     end        used by
/dev/sda     74.5 GB     6Y080MO                                                                     0         9729      

/dev/sda1   74.5 GB     Linux RAID                                                                    0         9729     /dev/md0

---------------------------------------

/dev/sdb     74.5 GB     6Y080MO                                                                     0          9729

/dev/sdb1    74.5 GB    Linux RAID                                                                    0         9729    /dev/md0

/dev/md0     74.5 GB    F MD RAID (Reiser)                                        /              --          --


Can you install linux on a single hard drive and later on, when introducing a second hard drive, mirror the second drive? Or do you need to format both and mount /dev/md0's and then reinstall the linux OS in order to mirror them?

Thanks for all the help! Sorry, I am new to the whole Linux RAID deal.

supercell


0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
DonConsolioCommented:
1) create a small (not mirrored) /boot partition on both disks (type linux) and manually copy /boot (sda1) to /boot2 (sdb1) later (this is a software raid, so there is no use in mirroring the boot process with md)
2) create 2 type fd (Linux raid autodetect) partitions for /
3) create md0 on those and install linux there
4) do the same for /home , etc if needed
5) personally i wouldn't mirror swap spance (there are no valuable data on swap anyways :-) - you better create  a swap partition on each drive (better performance and more swap space)

i.e.

/dev/sda1 /boot
/dev/sdb1 /boot2 (manually copied, probably kept in sync manually or by a cron job)
/dev/sda2 + sdb2 ==> /dev/md0 ==> /
/dev/sda3, /dev/sdb3  swap space with equal priority
/dev/sda4 + /dev/sdb4 - extended partitions
/dev/sda5 + /dev/sdb5 ==> /dev/md1 ==> /var
/dev/sda6 + /dev/sdb6 ==> /dev/md2 ==> /home

possibly /dev/sda7 as /tmp /if you don't need /tmp mirrored) and /dev/sdb7 as /install (copy your install DVD here) if you still have some free space

0
 
supercell29Author Commented:
So you have to mount each /"mount-point" using RAID1 - I see. (NOT RAID REALTED): Why, when creating a default Suse-made partition, does /home, /var, /usr, /tmp, /local, /srv, and /opt not shown in the partition window? Obviously they are all within /. (RAID1 RELATED): Do I need to create /dev/sda8 ==> /dev/md3 ==> /usr? How about /opt, /srv, and /local? What sizes do you recommend for each mount given the size of the hard drives I have? Thanks!
0
 
DonConsolioCommented:
/usr, /opt, ..  are not needed - if you do not know how those might help you, you don't need to create'em  :-)

/home is good if you want to keep data and system in different partitions (good upgrade, backup, etc.)
0
 
supercell29Author Commented:
Thank you. What sizes do you recommend for each? I take it / gets the most space and /home second?
0
 
DonConsolioCommented:
Depends on your needs and installed software :-)

For normal use you should be ok with 10G root, RAMx2 as swap, remaining space for data
0
 
supercell29Author Commented:
It will be Apache 2, MySQL and VMware 5.0. I would assume / would get the most space allotted?
0
 
supercell29Author Commented:
Thank you for all your help!!
0
 
DonConsolioCommented:
no problem
0
 
supercell29Author Commented:
Here is the setup I now have on the SuSE 9.2 IBM Blade (Software RAID):

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md0              76041256   2464476  73576780   4% /
tmpfs                   516940        20    516920   1% /dev/shm
/dev/sda1              1052184     38832   1013352   4% /boot
/dev/sdb1              1052184     32840   1019344   4% /boot2
/dev/fd0                  4314      3814       500  89% /media/floppy

I shut off the IBM blade and pulled one of the hard drives out (sda1). I restarted the server and got a blinking cursor. How do I get sdb1 to boot? I just assumed RAID1 would automatically boot up the second drive in the unfortunate event sda1 died. Please help.

Thank you,

supercell29
0
 
DonConsolioCommented:
In this setup RAID is used to protect your data. If you also want
to protect your boot process you need to:

-) write a MBR (master boot record) to the 2nd HDD
-) configure your BIOS to boot from the 2nd HDD if the 1st one fails
(if your BIOS can't do this you better get a hardware RAID)
0
 
supercell29Author Commented:
How would I go about writing a MBR to the second HDD?
0
 
DonConsolioCommented:
Yast -> System -> Boot Loader
select Location of Boot Loader, write new MBR (e.g. on /dev/hdb if your disk is hdb:-)
0
 
supercell29Author Commented:
Simple enough, however, there is a lot to choose from in the boot loader section of Suse 9.2!

HERE'S WHAT I HAVE IN BOOT LOADER SETUP:

Boot Loader Type                                           GRUB

Disk Order                                                     /dev/sda, /dev/sdb

Default Section                                              SUSE LINUX 9.2

Available Sections                                          SUSE LINUX 9.2 (default), Floppy, Failsafe -- SUSE LINUX 9.2

Activate Boot Loader Partition                          Yes, Activate /dev/sda  (SHOULD I ADD /dev/sdb?)

Replace Code in MBR                                      Leave Untouched

Back up Affected Disk Areas                             Yes

Add Saved MBR to Boot Loader Menu                No

Save Method                                                  Save Only Changed Files

-----------------------

color                                                              white/blue black/light-gray

timeout                                                          8 s

gfxmenu                                                        (hd0,0)/message



NEXT THERE ARE MENUS WITHIN THE BOOT LOADER SETUP:

(MENU.LST):

# Modified by YaST2. Last modification on Tue Apr 19 09:29:40 2005


color white/blue black/light-gray
default 0
timeout 8
gfxmenu (hd0,0)/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 9.2
    kernel (hd0,0)/vmlinuz root=/dev/md0 vga=0x317 selinux=0 splash=silent resume=/dev/sda2 desktop elevator=as showopts
    initrd (hd0,0)/initrd

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    root (fd0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 9.2
    kernel (hd0,0)/vmlinuz root=/dev/md0 showopts ide=nodma apm=off acpi=off vga=normal noresume selinux=0 barrier=off nosmp noapic maxcpus=0  3
    initrd (hd0,0)/initrd

---------------------------------------------------------------------------------

DO I ADD TO THIS WHAT YOU SEE BELOW?:

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 9.2
    kernel (hd1,0)/vmlinuz root=/dev/md0 vga=0x317 selinux=0 splash=silent resume=/dev/sdb2 desktop elevator=as showopts
    initrd (hd1,0)/initrd

-----------------------------------------------------------------------------------
THE DEVICE MAP IS AS FOLLOWS:

(hd0)      /dev/sda
(hd1)      /dev/sdb
(fd0)      /dev/fd0

------------------------------------------------------------------------------------

DO I NEED TO CHANGE THIS AS WELL? (GRUB.CONF):

root (hd0,0)
install  --stage2=/boot/grub/stage2 /grub/stage1 (hd0) /grub/stage2 0x8000 (hd0,0)/grub/menu.lst
quit

-------------------------------------------------------------------------------------

BY ADDING THIS?

root (hd1,0)
install  --stage2=/boot2/grub/stage2 /grub/stage1 (hd1) /grub/stage2 0x8000 (hd1,0)/grub/menu.lst
quit

--------------------------------------------------------------------------------------


As you can see it is a little involved. Any further info you can share would be much appreciated!


Ian



0
 
DonConsolioCommented:
what i would try:

copy /boot oto /boot2
unmount /boot and /boot2
mount /boot2 as /boot

then tell yast to:

boot from sdb
write new MBR to /dev/sdb (Replace Code in MBR = yes)
activate boot on sdb

write boot loader

then test and see what BIOS does when you pull the 2nd drive

you might need to modify the grub config for /boot2 to use BIOS
disk 0 instead of BIOS disk 1

if you need a setup able to boot on error i still recommend considering
a hardware RAID controller :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.