From vger.rutgers.edu!owner-linux-raid-outgoing Fri Oct 22 00:32:59 1999 Return-Path: Received: from nic2.funet.fi(really [128.214.248.46]) by planet via smail with esmtp id for ; Fri, 22 Oct 1999 00:32:56 -0700 (PDT) (Smail-3.2.0.90 1996-Dec-4 #9 built 1996-Dec-8) Received: from vger.rutgers.edu ([128.6.190.2]:9759 "EHLO vger.rutgers.edu") by nic2.funet.fi with ESMTP id ; Fri, 22 Oct 1999 10:25:46 +0300 Received: by vger.rutgers.edu via listexpand id ; Fri, 22 Oct 1999 03:25:08 -0400 Received: by vger.rutgers.edu id ; Fri, 22 Oct 1999 03:24:50 -0400 Received: from mailout08.btx.dtag.de ([194.25.2.156]:21687 "EHLO mailout08.btx.dtag.de") by vger.rutgers.edu with ESMTP id ; Fri, 22 Oct 1999 03:24:28 -0400 Received: from fwd04.btx.dtag.de ([194.25.2.164]) by mailout08.btx.dtag.de with smtp id 11eZ3q-0004Yl-00; Fri, 22 Oct 1999 09:24:26 +0200 Received: from nb010010143 (320037348657-0001(btxid)@[62.158.34.18]) by fwd04.btx.dtag.de with smtp id ; Fri, 22 Oct 1999 09:24:13 +0200 Reply-To: tw@com-ma.de Organization: com_ma, Computer nach Masz To: Admin Mailing Lists , linux-raid@vger.rutgers.edu Subject: mini root-RAID5-howto Date: Fri, 22 Oct 1999 08:03:56 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain; charset=US-ASCII References: In-Reply-To: MIME-Version: 1.0 Message-Id: <99102208461201.07873@nb010010143> Content-Transfer-Encoding: 7BIT X-Sender: 320037348657-0001@t-dialin.net From: ThomasWaldmann@t-online.de (Thomas Waldmann) Sender: owner-linux-raid@vger.rutgers.edu Precedence: bulk X-Loop: majordomo@vger.rutgers.edu X-Orcpt: rfc822;linux-raid-outgoing Status: RO > Is there any chance of getting the software raid and/or root raid howto > updated for whatever the current features of the MD device driver is? > I'm thinking of using raid1 on a bootable drive (/, /usr, /var, /home > partitions) and the documents mention some pitfalls, which may have been > fixed in the MD driver but not documented in the HOWTO Using latest raidpatch and raidtools, things got quite easy. Feel free to verify what I wrote (I did that multiple times, but I wrote that just out of my (volatile ;-) memory) and put it into a mini-howto: Example with root-RAID5 on 3 SCSI disks, /boot manually mirrored: ID 0 sda, ID 1 sdb, ID 2 sdc - this will get our future root-RAID array ID 3 sdd - this will be used for install only and removed later - get the raid stuff from ftp.kernel.org (or better from a mirror) - /pub/linux/daemons/raid/alpha/ - you need a patch for your kernel and the raidtools of same date - install your system to sdd - boot from sdd (set it as boot device in your scsi controller) - read docs in raidtools subdirectory, read man pages of raidtools - patch / compile / install RAID-Kernel, compile / install raidtools - create partitions on sda, e.g.: -- sda1 /boot 10 MB -- sda2 swap 100 MB -- sda3 / Rest (use id FD [raid autodetect]) - dd this partition table to the other raid disks: -- dd if=/dev/sda of=/dev/sdb count=1 -- dd if=/dev/sda of=/dev/sdc count=1 - shutdown / reboot (with RAID kernel, still from sdd) - create /etc/raidtab for sda3 sdb3 sdc3 (samples see docs in raidtools subdirectory) - mkraid /dev/md0 - check /proc/mdstat for ongoing resync - read docs in raidtools subdirectory (search for description of mke2fs options) - mke2fs ........... /dev/md0 - mke2fs /dev/sda1 - mkswap /dev/sda2 (same with sdb2 and sdc2) - mount your future root partition (/dev/md0) to /mnt - mount your future /boot partition (/dev/sda1) to /mnt/boot - copy your whole system to /mnt - adapt /mnt/etc/fstab to have /dev/md0 as root filesystem, make correct entries for swap (sda2 sdb2 sdc2, all same pri=1) and for /boot (sda1) - edit /mnt/etc/lilo.conf and adapt it to boot from 1st RAID disk (sda), root device will be /dev/md0. Better make a raid kernel backup entry in LILO to be sure to have a working RAID kernel in ANY case - lilo -r /mnt - check /proc/mdstat - wait until resync has completed - shutdown / reboot - change boot device to boot from sda - if it boots and all is OK, duplicate boot stuff to other disks: dd if=/dev/sda of=/dev/sdb count=1 dd if=/dev/sda of=/dev/sdc count=1 dd if=/dev/sda1 of=/dev/sdb1 dd if=/dev/sda1 of=/dev/sdc1 (this is what you have to do if you install a new kernel or change LILO stuff) Now you have: - (manually) mirrored MBR with LILO on all 3 disks - (manually) mirrored /boot on all 3 disks - /dev/md0 as root RAID5 device - swapping to all 3 disks - if any single disk fails, you are able to boot from any other disk (getting /dev/sda in that case) You may need some special options for lilo for getting it boot correctly. Hint: the bios will make the boot disk BIOS 0x80 - if this is not sda (or hda) or will change later, you will have to tell lilo the correct bios ID for your (future) boot disk. See the LILO docs for details ("bios="). Unsolved problem: some distributions want to boot from disk or cdrom before upgrading a whole system (e.g. SuSE does that). The problem is that they don' t have a RAID kernel on their floppy/cdrom boot system, so you won' t be able to access your installation on /dev/md0. Workarounds: - use a non-RAID device: copy all your stuff on it, upgrade and copy all back to your raid device - make your own boot/install disk with a RAID kernel - don' t do this kind of update but update single packages Thomas -- Thomas Waldmann (com_ma, Computer nach Masz) email: tw@com-ma.de www: www.com-ma.de Please be patient if sending me email, response may be slow. Bitte Geduld, wenn Sie mir email senden, Antwort kann dauern.