HowTo: EIDE/ATA-100 + RAID 1 + LVM
Hi,
I don't know much about RAID and LVM.
I have to set up a server, and I'd like to know if it's possible -and reliable- to setup a server with RAID 1 (mirrored disk) with a pure software solution (not RAID controller) and LVM
* disks: two 40 GB IBM 60GXP (ATA-100).
* motherboard: Asus with AMD760 + DDR (Athlon Thunderbird)
* distribution: SuSE 7.2, with Linux kernel 2.4.4
- Are there some known issues/bugs with this configuration ?
- Where can I start (documentation URL I should know, ...)
- What is the installation order to follow (between software installation, RAID setup, LVM setup, ...)
- Any other suggestion
As the server has to be mostly remote-administrated (from other countries...), reliability is a key. Is LVM stable enough with RAID-1 and Linux 2.4.x ?
Thanks in advance,
Emmanuel.
Quoted 11 lines · Emmanuel Blot
Hi,
I don't know much about RAID and LVM.
I have to set up a server, and I'd like to know if it's possible -and reliable- to setup a server with RAID 1 (mirrored disk) with a pure software solution (not RAID controller) and LVM
* disks: two 40 GB IBM 60GXP (ATA-100).
* motherboard: Asus with AMD760 + DDR (Athlon Thunderbird)
* distribution: SuSE 7.2, with Linux kernel 2.4.4
Quoted 8 lines
- Are there some known issues/bugs with this configuration ?
- Where can I start (documentation URL I should know, ...)
- What is the installation order to follow (between software installation, RAID setup, LVM setup, ...)
- Any other suggestionAs the server has to be mostly remote-administrated (from other countries...), reliability is a key. Is LVM stable enough with RAID-1 and Linux 2.4.x ?
Lately I've been experimenting with layering Linux's softare RAID implementation with LVM, both LVM on top of RAID and RAID on top of LVM (the former seems to be more reasonable).
My test hardware is plain _shit_ (P75 with 16 MB RAM and two 6-year old IDE disks, 400 MB and 800 MB), but was enough to test the aforementioned configurations. I had no problems at all, and everything seemed to run OK.
However, layering LVM/RAID (or RAID/LVM) can mean a much greater overhead on IO. My tests _seem_ to show noticeable slowdonws on raw throughput (both dd and bonnie) and array reconstruction speeds. But a decent hardware could show a much better behaviour than what I saw.
On the other hand, you must be very careful with designing the setup, specially with RAID on top of LVM. If you are building a 2-"disk" RAID-1, and extents for both "disks" are taken from the same physical hard drive, your mirror is quite unuseful in case a disk dies.
Another parameter to take into consideration is the filesystem you will be using, the parameters used to create it, the usage pattern for this filesystem, AND interaction with the unbderlying "block device". For example, an ext2 filesystem with 4 KB blocks on top of a stripped LV built from a 2-disk RAID-0 underlaying device with 32 KB stripe maybe is not optimal in terms of troughput and/or IO latency.
To get all this working, download a "stable" kernel (2.4.4 gave me no ptoblems), download LVM patches (version 0.9.1-beta7) and recompile. You must enable LVM and RAID when using your favourite "make *config". Although both can be compiled as modules, is not advisable to do so on a production machine (I've experienced problems with RAID devices not autostarting upon reboot, manual intervention required). Don't forget to build LVM tools from the tarball you should have downloaded previously. Download raidtools2 (version 0.9x) for your distribution.
RAID building and usage is quite well documented on several HOWTO, from www.linuxdoc.org (mainly Software-RAID-HOWTO).
With respect to LVM, there is the LVM-HOWTO. Not very thorough, but enough to make it work quickly.
Just one tip to ease your task: LVM on top of RAID is just a matter of create the RAID device and then making a VG using /dev/md0 as the Physical Device. Once you have a VG available, create LV (similar to partitions) and create filesystems on them as usual.
PS: I'm currently trying to finish a HOWTO-like document about Linux's software RAID usage, with some information about LVM and their mutual relationships and combined usage and applications. The master document is being written in Spanish, but as soon as I finish it, I've the intention to translate it to English. The Spanish version should be ready during July, and the English one maybe during August or September. Stay tuned :)
Signature · 5 lines
Jos� Luis Domingo L�pez Linux Registered User #189436 Debian GNU/Linux Potato (P166 64 MB RAM) jdomingo EN internautas PUNTO org => � Spam ? Atente a las consecuencias jdomingo AT internautas DOT org => Spam at your own risk
Quoted 1 line · Emmanuel Blot
I have to set up a server, and I'd like to know if it's possible
yes
Quoted 1 line
- and reliable- to setup a server with RAID 1 (mirrored disk) with a
perhapes
Quoted 4 lines
pure software solution (not RAID controller) and LVM
[ ... ]
* motherboard: Asus with AMD760 + DDR (Athlon Thunderbird)
I don't know about the reliability of the AMD760 ATA100 port, the VIA one is pritty screwed. If you can you should perhapes get a prommise ATA100 controller.
Quoted 3 lines
[ ... ]
- Any other suggestion
Just a few hints and MHO:
- use just one drive per channel (e.g. /dev/hda and /dev/hdc not hdb)
- the 2.4.x series of linux kernels is called stable but probably not realy ready for primetime yet. (mainly VM problems)
- with 2.2.x the softraid drivers are a lot older (e.g. not so reliable) and you'd have to create your own patches. and the stock 2.2.x kernel does not come with the new IDE drivers. But 2.2.x is more stable.
- always get the latest LVM patches, if you can wait for 1.0
- never try RAID on top of LVM. This is nice for testing, but I can't see why you might want to do this.
- If you can partition your disk like this:
128MB /dev/hd[ac]1 /boot for savety put boot /onto its own partition (2x)RAM /dev/hd[ac]2 swap putting swap onto raid does not make
sence to me. The 2.4.x kernel NEEDS twice the ammound of RAM as swap. The kernel can do raid0 with swap partitions (on its own)
rest /dev/hd[ac]3 md0 put the rest into a RAID1 device
make /dev/md0 the only PV, with your VG in it.
- put some recovery tools into /boot (this will not realy help you if your server stands to far away, but perhapes you can attach a serial console connected to a different box ...)
- while the newest LILO beta can boot from a raid1 device, I would not stress it and just put one individual version /boot on each harddrive (with it's own bootloader) and handsync them (e.g. rsync). You should not have to much changes to the /boot partition, so I think this is ok.
- after the installation, make a full backup and than realy beat the system (focus on the ATA controller, cabeling, disks) to check it. Silent data corruption realy sucks, if it results from bad cabeling not even RAID will help you.
(- don't use SUSE if you can. Ok, well ignore this, this is just MVHO)
Signature · 2 lines
Goetz Bock IT Consultant Dipl.-Inf. Univ.
Hi, Goetz!
Goetz Bock ([email protected]) wrote 80 lines:
Quoted 2 lines
(2x)RAM /dev/hd[ac]2 swap putting swap onto raid does not make
sence to me. The 2.4.x kernel NEEDS
Swap on RAID will not give you speed (it will slow you rather), but a HD failure will not crash the server, because suddenly the swap has gone. And without stability even over the loss of a HD -- what is RAID worth? Speed you can gain by striping partitions -- at the cost of having to hope that all HDs survive, instead of a quorum as with RAID.
-Wolfgang