?
Solved

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

Posted on 2005-04-14
17
Medium Priority
?
399 Views
Last Modified: 2013-12-16
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!
0
Comment
Question by:supercell29
  • 9
  • 8
17 Comments
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13790827
in Yast2 go to System->Partition
press the "RAID" button
0
 

Author Comment

by:supercell29
ID: 13791834
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
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13792326
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:supercell29
ID: 13792746
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
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13793243
/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
 

Author Comment

by:supercell29
ID: 13793371
Thank you. What sizes do you recommend for each? I take it / gets the most space and /home second?
0
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13794071
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
 

Author Comment

by:supercell29
ID: 13794418
It will be Apache 2, MySQL and VMware 5.0. I would assume / would get the most space allotted?
0
 
LVL 15

Accepted Solution

by:
DonConsolio earned 500 total points
ID: 13794672
if you are not sure you can just make one large root partition
0
 

Author Comment

by:supercell29
ID: 13794734
Thank you for all your help!!
0
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13794811
no problem
0
 

Author Comment

by:supercell29
ID: 13808377
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
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13811776
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
 

Author Comment

by:supercell29
ID: 13812239
How would I go about writing a MBR to the second HDD?
0
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13814245
Yast -> System -> Boot Loader
select Location of Boot Loader, write new MBR (e.g. on /dev/hdb if your disk is hdb:-)
0
 

Author Comment

by:supercell29
ID: 13816700
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
 
LVL 15

Expert Comment

by:DonConsolio
ID: 13820404
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question