On Tue, 17 Aug 1999, Michael Ghens wrote:

> I have a running system that I would like to put into raid1. However, what
> I have read is that the mkraid command would erase everything. Is this
> true? Will I loose my data that I have, or is it only the second disk that
> bites it.

Michael, you cannot (as yet, AFAIK) take an existing ext2 partition and
raid it without "reformatting" it. The only way to do it is to back up
your data, repartition (as necessary), set up your raid, mkfs, and then
restore the data into the new (multi-partition/drive-based) filesystem.

Also, to share some of my experiences (suppliment the out-of-date
documentation, really) having just set up a raid-linear successfully - I
hope...  ;) I'll recount what happened to me:

Needing to use a new 2.2 kernel for other reasons, I had to go to a
current raid ftp archive and FTP both the raidtools (19990724) and kernel
patch for 2.2.10. Then I had to patch the kernel (in /usr/src/linux):

cd /usr/src
patch -p0 < raid0145-19990724-2.2.10

and recompile. Then compile the matching raidtools distribution.

Once booted with the patched kernel, you make an /etc/raidtab file. I
found the instructions for doing so, even in the updated HOWTO given in
the raidtools archive, were incorrect for raid-linear; though I gather
this isn't a very fashionable use for software raid, it seems to be what I
need (just a whopping huge single partition)... anyway, I trust the raid-1
config examples actually do work better.

BTW; if there is a good reason _not_ to have really big (i.e. 30 gig)
md partitions, I'd like to hear it.

In my case, I discovered that in addition to:

raiddev /dev/md0
          raid-level      linear
          nr-raid-disks   2
          persistent-superblock 1
          device          /dev/sdb6
          raid-disk       0
          device          /dev/sdc5
          raid-disk       1

seeming to confuse the parser in the raidtools somehow, when I remove all
the extra spaces, mkraid still fails with a lot of debug output. When I
was pouring through it, it occurred to me that perhaps mkraid was
expecting a chunk-size parameter as well. I put in 

chunk-size 8

after the persistent-superblock line, and sure enough, mkraid worked, and
after typing both my partitions 0xfd, the kernel automatically recognizes
them on boot, as well. Of course, the number 8 came right out of my ass
(or some other example for some other raid level somewhere), and I have no
idea what chunk size means in the context of raid-linear. But whatever, it
seems to work.

Then I just ran

mke2fs /dev/md0

and then you can mount it, add /dev/md0 to your /etc/fstab, or whatever.
Of course, raid-1 has additional considerations vis-a-vis how it handles
failures, how to add/remove additional mirrors (I assume), etc... but just
to get it working, I hope this is helpful...

____________________________________________________
David Wood | Templar Studios Inc.
157 Ludlow Street N 600 | New York, NY 10002
tel 212.982.9360 | fax 212.982.9370

Reply via email to