[H-GEN] Software raid under linux

Mark Suter suter at zwitterion.humbug.org.au
Wed Aug 23 21:36:41 EDT 2000


Patrick,

> I'm thinking seriously about playing around with using a *software* raid
> setup to use as my home directories.  I was hoping somebody had played
> with this before me, and they could tell me if what I am attempting to do
> is reasonable.

I've been using software raid for quite some time now.  My
software mirror has survived to harddrives dying ;)

I've recently purchased a IDE hardware RAID controller.  When the
drives come back from Quantum, I'll let you know how well it all
works ;)

    http://www.3ware.com/products/escalade6000.shtml

> I have my home directories shared as a samba share, and these can be (and
> are) used by the windows boxes on my home lan to save all my documents/uni
> work etc...

Strange, I do that here too...

> My current setup is one large partition on a 3.2GB (disk 2) ide hdd.
> 
> I'm thinking of adding a second 4.3GB (disk 1), partitioning it into the
> following.
> 
> /dev/hda1 - /     ~ 1 GB
> /dev/hda2 - swap  ~ 64 MB
> /dev/hda3 - /home ~ 3.2 GB Raid 1
> 
> /dev/hdc1 - swap  ~ 64 MB
> /dev/hdc2 - /home ~ 3.2 GB Raid 1
> 
> If I do it like this, and disk 2 fails, then I've just got to find a
> replacement disk for it.

Be aware that, even without the swap, the failed disk might cause
the system to fail.  In my cause, my system failed once because
of the swap and the second time I was able to shutdown cleanly.

This is one of the main reasons that I'm going with Hardware
RAID.  The fact that the 3Ware people have written their own
kernel code helps ;)

> If disk 1 fails, then I have to reinstall the system from a backup (which
> will likely be held on the raid filesystem on disk 2 - cron based
> backup?).  In both cases I'll not lose my data.

Yes; however, see below.

> So if you have managed to read through all that and aren't confused I've
> got the following questions.
> 
> 1) Do I need to assign whole disks to raid, or can I just use a partition
> as I have planned (/dev/hda vs /dev/hda2)?

You can use partitions, as I have below.  Yes, this is in a
degraded state :(

    $ uname -a
    Linux zwitterion.humbug.org.au 2.4.0-test6 #1 Tue Aug 22 15:36:50 EST 2000 i586 unknown
    $ cat /proc/mdstat
    Personalities : [raid1] 
    read_ahead 1024 sectors
    md0 : active raid1 hda5[1]
	  2562240 blocks [2/1] [_U]
	  
    md1 : active raid1 hda7[1]
	  3622528 blocks [2/1] [_U]
	  
    unused devices: <none>
    $ sudo fdisk -l 
    Disk /dev/hda: 255 heads, 63 sectors, 784 cylinders
    Units = cylinders of 16065 * 512 bytes

       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1             1         5     40131   83  Linux
    /dev/hda2             6       784   6257317+   5  Extended
    /dev/hda5             6       324   2562336   fd  Linux raid autodetect
    /dev/hda6           325       333     72261   82  Linux swap
    /dev/hda7           334       784   3622626   fd  Linux raid autodetect

> 2) Is it possible to recover my system from a filesystem stored on a raid
> device? (as when disk 1 fails)

Yes, it is possible - I strongly recommend that you practice the
procedure.  You will need a distro on floppy to repartition the
other disk, re-activate the mirror and copy the files over.

> 3) Does what I'm proposing seem reasonable?

I would recommend the following structure.

    /dev/hda1 - /     ~ 1.0 GB md0 ---|
    /dev/hda2 - swap  ~ 64 MB         |
    /dev/hda3 - /tmp? ~ 1.1 GB        |
    /dev/hda4 - /home ~ 2.2 GB md1 -| |
                                    | |
    /dev/hdc1 - /     ~ 1.0 GB md0 -|-|
    /dev/hdc2 - swap  ~ 64 MB       |
    /dev/hdc3 - /home ~ 2.2 GB md1 -|

Yes, you can boot the raid1 mirror (see HOWTO below).  I did
this this week and it works very well.  I've left the 40MB /boot
partition in place because it isn't worth the effort to recover
that space.

No matter what you decide, I offer the following advice.

    * Understand that RAID1 does not replace backups.

    * Use a 2.4 series kernel rather than trying to patch 2.2.
    I've had no problems so far with 2.4.0-test6.

    * Read the following HOWTO - it contains the info on how to
    boot raid and how to do the upgrade to raid without losing
    the data or needing to restore from a separate backup.

	http://mirror.aarnet.edu.au/LDP/HOWTO/Boot+Root+Raid+LILO.html

    * Memorize the following.  You must know what to do when a
    drive fails - practice!.  The most important thing is not to
    look like you are panicking ;)

	http://mirror.aarnet.edu.au/LDP/HOWTO/Software-RAID-HOWTO.html

Yours sincerely,

-- Mark John Suter  | I know that you  believe  you understand
suter at humbug.org.au | what you think I said, but I am not sure
GPG key id F2FEBB36 | you realise that what you  heard  is not
Ph: +61 4 1126 2316 | what I meant.                  anonymous
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 267 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20000824/1d0bea45/attachment-0001.sig>


More information about the General mailing list